From 1c67d639d5497cdae5bf7a6ececdd789e8537a01 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 12 Dec 2012 00:01:17 +0100 Subject: guix-package: Gracefully handle multiple installs of the same path. * guix-package.in (guix-package)[process-actions]: Compute PACKAGES such that packages listed in INSTALL* are first removed from the remainder of the list. When PROF is equal to the previous profile's store path, do nothing. Reported by Andreas Enge . * tests/guix-package.sh: Test the behavior of installing the same store path twice. When removing a package, omit its version number. --- tests/guix-package.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tests/guix-package.sh') diff --git a/tests/guix-package.sh b/tests/guix-package.sh index 2bc8c573ec..83108601cf 100644 --- a/tests/guix-package.sh +++ b/tests/guix-package.sh @@ -30,6 +30,12 @@ guix-package -b -p "$profile" \ test -L "$profile" && test -L "$profile-1-link" test -f "$profile/bin/guile" +# Installing the same package a second time does nothing. +guix-package -b -p "$profile" \ + -i `guix-build -e '(@@ (distro packages base) %bootstrap-guile)'` +test -L "$profile" && test -L "$profile-1-link" +! test -f "$profile-2-link" +test -f "$profile/bin/guile" guix-package -b -p "$profile" \ -i `guix-build -e '(@@ (distro packages base) gnu-make-boot0)'` @@ -53,7 +59,7 @@ esac test "`guix-package -p "$profile" -I 'g.*e' | cut -f1`" = "guile-bootstrap" # Remove a package. -guix-package -b -p "$profile" -r "guile-bootstrap-2.0" +guix-package -b -p "$profile" -r "guile-bootstrap" test -L "$profile-3-link" test -f "$profile/bin/make" && ! test -f "$profile/bin/guile" -- cgit v1.2.3