guix-package: Extract version strings when installing a direct store path.

* guix-package.in (guix-package)[process-actions]: Extract the version
  string from store paths.
* tests/guix-package.sh: Adjust accordingly.
This commit is contained in:
Ludovic Courtès 2012-11-19 23:51:08 +01:00
parent ef1ee6b221
commit 5075e28305
2 changed files with 12 additions and 6 deletions

View File

@ -338,8 +338,11 @@ Report bugs to: ~a.~%") "@PACKAGE_BUGREPORT@"))
(install* (append (install* (append
(filter-map (match-lambda (filter-map (match-lambda
(('install . (? store-path? path)) (('install . (? store-path? path))
`(,(store-path-package-name path) (let-values (((name version)
#f #f ,path)) (package-name->name+version
(store-path-package-name
path))))
`(,name ,version #f ,path)))
(_ #f)) (_ #f))
opts) opts)
(map (lambda (tuple drv) (map (lambda (tuple drv)

View File

@ -42,12 +42,15 @@ test -f "$profile/bin/make" && test -f "$profile/bin/guile"
# name and version string. # name and version string.
installed="`guix-package -p "$profile" --list-installed | cut -f1 | xargs echo | sort`" installed="`guix-package -p "$profile" --list-installed | cut -f1 | xargs echo | sort`"
case "x$installed" in case "x$installed" in
"guile* make*") true;; "guile-bootstrap make-boot0")
"make* guile*") true;; true;;
"*") false;; "make-boot0 guile-bootstrap")
true;;
"*")
false;;
esac esac
test "`guix-package -p "$profile" -I 'g.*e' | cut -f1`" = "guile-bootstrap-2.0" test "`guix-package -p "$profile" -I 'g.*e' | cut -f1`" = "guile-bootstrap"
# Remove a package. # Remove a package.
guix-package -b -p "$profile" -r "guile-bootstrap-2.0" guix-package -b -p "$profile" -r "guile-bootstrap-2.0"