From 0ec1af59e564c00fb48359fec84d049138589dee Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 14 Jan 2013 23:44:58 +0100 Subject: guix-package: Create or diagnose missing profile directory. Reported by Andreas Enge. * guix-package.in (%profile-directory): Honor $NIX_STATE_DIR. (guix-package)[ensure-default-profile]: Use it. [process-actions]: Call it when the `profile' option is %CURRENT-PROFILE. * tests/guix-package.sh: Add installation test with $HOME set, using the default profile. --- tests/guix-package.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'tests/guix-package.sh') diff --git a/tests/guix-package.sh b/tests/guix-package.sh index 6c8258032b..e5b8db7088 100644 --- a/tests/guix-package.sh +++ b/tests/guix-package.sh @@ -25,10 +25,11 @@ guix-package --version profile="t-profile-$$" rm -f "$profile" -trap 'rm "$profile" "$profile-"[0-9]*' EXIT +trap 'rm "$profile" "$profile-"[0-9]* ; rm -rf t-home-'"$$" EXIT -guix-package --bootstrap -p "$profile" \ - -i `guix-build -e '(@@ (distro packages base) %bootstrap-guile)'` +boot_guile="`guix-build -e '(@ (distro packages bootstrap) %bootstrap-guile)'`" + +guix-package --bootstrap -p "$profile" -i "$boot_guile" test -L "$profile" && test -L "$profile-1-link" test -f "$profile/bin/guile" @@ -75,3 +76,15 @@ guix-package --bootstrap -i "binutils:lib" -p "$profile" -n # Check whether `--list-available' returns something sensible. guix-package -A 'gui.*e' | grep guile +# Try with the default profile. + +XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" +export XDG_CACHE_HOME +HOME="t-home-$$" +export HOME + +mkdir -p "$HOME" + +guix-package --bootstrap -i "$boot_guile" +test -L "$HOME/.guix-profile" +test -f "$HOME/.guix-profile/bin/guile" -- cgit v1.2.3