summaryrefslogtreecommitdiff
path: root/guix/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'guix/scripts')
-rw-r--r--guix/scripts/package.scm10
-rw-r--r--guix/scripts/system.scm7
2 files changed, 14 insertions, 3 deletions
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 500fc9ac90..5743816324 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -771,9 +771,13 @@ processed, #f otherwise."
(('show requested-name)
(let-values (((name version)
(package-name->name+version requested-name)))
- (leave-on-EPIPE
- (for-each (cute package->recutils <> (current-output-port))
- (find-packages-by-name name version)))
+ (match (find-packages-by-name name version)
+ (()
+ (leave (G_ "~a~@[@~a~]: package not found~%") name version))
+ (packages
+ (leave-on-EPIPE
+ (for-each (cute package->recutils <> (current-output-port))
+ packages))))
#t))
(('search-paths kind)
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index d2be0cf8fb..9ba9428a08 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -235,6 +235,13 @@ When INSTALL-BOOTLOADER? is true, install bootloader using BOOTCFG."
the ownership of '~a' may be incorrect!~%")
target))
+ ;; If a previous installation was attempted, make sure we start anew; in
+ ;; particular, we don't want to keep a store database that might not
+ ;; correspond to what we're actually putting in the store.
+ (let ((state (string-append target "/var/guix")))
+ (when (file-exists? state)
+ (delete-file-recursively state)))
+
(chmod target #o755)
(let ((os-dir (derivation->output-path os-drv))
(format (lift format %store-monad))