aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-05-08 15:11:20 +0200
committerLudovic Courtès <ludo@gnu.org>2013-05-08 15:11:20 +0200
commitce3b7a619d6e57b18d79ff5f97d71523e23f1f9d (patch)
treeaf150691444cbbe50e7b51e4adac17fd1388f31f
parentfd982732f45c7f5e8adb025d11d106d2192d6723 (diff)
downloadguix-ce3b7a619d6e57b18d79ff5f97d71523e23f1f9d.tar
guix-ce3b7a619d6e57b18d79ff5f97d71523e23f1f9d.tar.gz
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'.
-rw-r--r--guix/scripts/package.scm10
1 files 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