diff options
author | Mark H Weaver <mhw@netris.org> | 2015-06-18 01:32:37 -0400 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2015-06-18 01:32:37 -0400 |
commit | 2abf678682c42842c16e026c51d96b1fa86be88f (patch) | |
tree | 7bd59bd08dbaf00f23f37a91d1e7ae3d7a915843 /guix/scripts/package.scm | |
parent | 9ae1e920718e95577c12de890754b6a6a4ff70a1 (diff) | |
parent | c362a40a5825faafc76b72f69fb6595fa29d3f60 (diff) |
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/scripts/package.scm')
-rw-r--r-- | guix/scripts/package.scm | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index d9f38fb8bc..56a6e2db64 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -47,8 +47,7 @@ #:use-module (gnu packages base) #:use-module (gnu packages guile) #:use-module ((gnu packages bootstrap) #:select (%bootstrap-guile)) - #:export (specification->package+output - switch-to-generation + #:export (switch-to-generation switch-to-previous-generation roll-back delete-generation @@ -324,39 +323,6 @@ similar." (primitive-_exit 0) (apply throw args))))) -(define* (specification->package+output spec #:optional (output "out")) - "Return the package and output specified by SPEC, or #f and #f; SPEC may -optionally contain a version number and an output name, as in these examples: - - guile - guile-2.0.9 - guile:debug - guile-2.0.9:debug - -If SPEC does not specify a version number, return the preferred newest -version; if SPEC does not specify an output, return OUTPUT." - (define (ensure-output p sub-drv) - (if (member sub-drv (package-outputs p)) - sub-drv - (leave (_ "package `~a' lacks output `~a'~%") - (package-full-name p) - sub-drv))) - - (let-values (((name version sub-drv) - (package-specification->name+version+output spec output))) - (match (find-best-packages-by-name name version) - ((p) - (values p (ensure-output p sub-drv))) - ((p p* ...) - (warning (_ "ambiguous package specification `~a'~%") - spec) - (warning (_ "choosing ~a from ~a~%") - (package-full-name p) - (location->string (package-location p))) - (values p (ensure-output p sub-drv))) - (() - (leave (_ "~a: package not found~%") spec))))) - (define (upgradeable? name current-version current-path) "Return #t if there's a version of package NAME newer than CURRENT-VERSION, or if the newest available version is equal to CURRENT-VERSION but would have |