From 652163154c06b47936a453f44ea35938789718de Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 11 Nov 2018 17:13:20 +0100 Subject: guix package: '--show' errors when asked for a non-existent package. Fixes . Reported by swedebugia . * guix/scripts/package.scm (process-query): Call 'leave' when 'find-packages-by-name' returns the empty list. * tests/guix-package.sh: Test it. --- guix/scripts/package.scm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'guix/scripts') 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) -- cgit v1.2.3 From 6c843907e90c9f6a1af389f9624cac8b6b01ecbb Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 11 Nov 2018 23:48:53 +0100 Subject: guix system: Invoking 'guix system init' twice keeps timestamps zeroed. Fixes a bug whereby running 'guix system init config.scm /mnt' twice would, on the second run, change timestamps in /mnt/gnu/store from the Epoch to now. This is because the 'register-path' call would bypass the 'reset-timestamps' phase altogether in that case, as a consequence of commit bb3b6ccb05550fbfbeb459c68819a752327d6e1e. Reported by Christopher Baines. * guix/scripts/system.scm (install): When TARGET/var/guix exists, delete it. As a side-effect, this ensures that later on, the 'register-path' call invokes 'reset-timestamps' on all the copied store items. --- guix/scripts/system.scm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'guix/scripts') 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)) -- cgit v1.2.3