X-Git-Url: http://git.hcoop.net/jackhill/guix/guix.git/blobdiff_plain/ee5408576d9a3d4cec24682bb76921d2d4839470..37ce56af34c5067edae77e172e3d8409321650d8:/tests/guix-package-net.sh diff --git a/tests/guix-package-net.sh b/tests/guix-package-net.sh index cf3233bee2..6d21c6cff6 100644 --- a/tests/guix-package-net.sh +++ b/tests/guix-package-net.sh @@ -1,6 +1,7 @@ # GNU Guix --- Functional package management for GNU -# Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès +# Copyright © 2012, 2013, 2014, 2015, 2017, 2019 Ludovic Courtès # Copyright © 2013 Nikita Karetnikov +# Copyright © 2020 Simon Tournier # # This file is part of GNU Guix. # @@ -46,9 +47,10 @@ fi profile="t-profile-$$" +profile_alt="t-profile-alt-$$" rm -f "$profile" -trap 'rm -f "$profile" "$profile-"[0-9]* ; rm -rf t-home-'"$$" EXIT +trap 'rm -f "$profile" "$profile_alt" "$profile-"[0-9]* "$profile_alt-"[0-9]* ; rm -rf t-home-'"$$" EXIT guix package --bootstrap -p "$profile" -i guile-bootstrap @@ -56,7 +58,7 @@ test -L "$profile" && test -L "$profile-1-link" ! test -f "$profile-2-link" test -f "$profile/bin/guile" -boot_make="(@@ (gnu packages commencement) gnu-make-boot0)" +boot_make="(@ (guix tests) gnu-make-for-tests)" boot_make_drv="`guix build -e "$boot_make" | grep -v -e -debug`" guix package --bootstrap -p "$profile" -i "$boot_make_drv" test -L "$profile-2-link" @@ -77,15 +79,24 @@ esac test "`guix package -p "$profile" -I 'g.*e' | cut -f1`" = "guile-bootstrap" +guix package --bootstrap -p "$profile_alt" -i gcc-bootstrap +installed="`guix package -p "$profile" -p "$profile_alt" -I | cut -f1 | xargs echo | sort`" +case "x$installed" in + "gcc-bootstrap guile-bootstrap make-boot0") + true;; + "*") + false;; +esac +test "`guix package -p "$profile_alt" -p "$profile" -I | wc -l`" = "3" +rm "$profile_alt" + # List generations. test "`guix package -p "$profile" -l | cut -f1 | grep guile | head -n1`" \ = " guile-bootstrap" # Exit with 1 when a generation does not exist. -if guix package -p "$profile" --list-generations=42; -then false; else true; fi -if guix package -p "$profile" --switch-generation=99; -then false; else true; fi +! guix package -p "$profile" --list-generations=42 +! guix package -p "$profile" --switch-generation=99 # Remove a package. guix package --bootstrap -p "$profile" -r "guile-bootstrap" @@ -147,7 +158,7 @@ test "`readlink_base "$profile"`" = "$profile-2-link" # Make sure LIBRARY_PATH gets listed by `--search-paths'. guix package --bootstrap -p "$profile" -i guile-bootstrap -i gcc-bootstrap -guix package --search-paths -p "$profile" | grep LIBRARY_PATH +guix package -p "$profile" --search-paths | grep LIBRARY_PATH # Roll back so we can delete #3 below. guix package -p "$profile" --switch-generation=2 @@ -156,6 +167,45 @@ guix package -p "$profile" --switch-generation=2 guix package -p "$profile" --delete-generations=3 test -z "`guix package -p "$profile" -l 3`" +# Search path of combined profiles. 'LIBRARY_PATH' should show up only in the +# combination, not in the individual profiles. +rm "$profile" +guix package --bootstrap -p "$profile" -i guile-bootstrap +guix package --bootstrap -p "$profile_alt" -i gcc-bootstrap +! guix package -p "$profile" --search-paths | grep LIBRARY_PATH +guix package -p "$profile" -p "$profile_alt" --search-paths \ + | grep "LIBRARY_PATH.*$profile/lib.$profile_alt/lib" + +# Simulate an upgrade and make sure the package order is preserved. +module_dir="t-guix-package-net-$$" +trap 'rm -rf "$module_dir"' EXIT + +mkdir "$module_dir" +cat > "$module_dir/new.scm" <