From ce3b7a619d6e57b18d79ff5f97d71523e23f1f9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 8 May 2013 15:11:20 +0200 Subject: [PATCH] package: Preserve the installed package output when upgrading. * guix/scripts/package.scm (guix-package)[find-package]: Add optional parameter `output'. Use it. [process-actions]: When computing UPGRADE, pass OUTPUT to `find-package'. --- guix/scripts/package.scm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index b970c2b7b9..1d17911dc1 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -520,10 +520,11 @@ Install, remove, or upgrade PACKAGES in a single transaction.\n")) ((_ version pkgs ...) pkgs) (#f '())))) - (define (find-package name) + (define* (find-package name #:optional (output "out")) ;; Find the package NAME; NAME may contain a version number and a ;; sub-derivation name. If the version number is not present, - ;; return the preferred newest version. + ;; return the preferred newest version. If the sub-derivation name is not + ;; present, use OUTPUT. (define request name) (define (ensure-output p sub-drv) @@ -535,7 +536,7 @@ Install, remove, or upgrade PACKAGES in a single transaction.\n")) (let*-values (((name sub-drv) (match (string-rindex name #\:) - (#f (values name "out")) + (#f (values name output)) (colon (values (substring name 0 colon) (substring name (+ 1 colon)))))) ((name version) @@ -687,7 +688,8 @@ Install, remove, or upgrade PACKAGES in a single transaction.\n")) (and (any (cut regexp-exec <> name) upgrade-regexps) (upgradeable? name version path) - (find-package name))) + (find-package name + (or output "out")))) (_ #f)) installed)))) (install (append