| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 |
|
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 |
|
| 26 | guix package --version
|
| 27 |
|
| 28 | readlink_base ()
|
| 29 | {
|
| 30 | basename `readlink "$1"`
|
| 31 | }
|
| 32 |
|
| 33 | |
| 34 | |
| 35 | shebang_too_long ()
|
| 36 | {
|
| 37 | test `echo $NIX_STORE_DIR/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bootstrap-binaries-0/bin/bash | wc -c` \
|
| 38 | -ge 128
|
| 39 | }
|
| 40 |
|
| 41 | if ! guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null \
|
| 42 | || shebang_too_long
|
| 43 | then
|
| 44 | |
| 45 | exit 77
|
| 46 | fi
|
| 47 |
|
| 48 |
|
| 49 | profile="t-profile-$$"
|
| 50 | profile_alt="t-profile-alt-$$"
|
| 51 | rm -f "$profile"
|
| 52 |
|
| 53 | module_dir="t-guix-package-net-$$"
|
| 54 | mkdir "$module_dir"
|
| 55 |
|
| 56 | trap 'rm -f "$profile" "$profile_alt" "$profile.lock" "$profile_alt.lock" "$profile-"[0-9]* "$profile_alt-"[0-9]* ; rm -r "$module_dir" t-home-'"$$" EXIT
|
| 57 |
|
| 58 |
|
| 59 | guix package --bootstrap -p "$profile" -i guile-bootstrap
|
| 60 | test -L "$profile" && test -L "$profile-1-link"
|
| 61 | test ! -f "$profile-2-link"
|
| 62 | test -f "$profile/bin/guile"
|
| 63 |
|
| 64 | boot_make="(@ (guix tests) gnu-make-for-tests)"
|
| 65 | boot_make_drv="`guix build -e "$boot_make" | grep -v -e -debug`"
|
| 66 | guix package --bootstrap -p "$profile" -i "$boot_make_drv"
|
| 67 | test -L "$profile-2-link"
|
| 68 | test -f "$profile/bin/make" && test -f "$profile/bin/guile"
|
| 69 |
|
| 70 | |
| 71 | |
| 72 | |
| 73 | installed="`guix package -p "$profile" --list-installed | cut -f1 | xargs echo | sort`"
|
| 74 | case "x$installed" in
|
| 75 | "guile-bootstrap make-boot0")
|
| 76 | true;;
|
| 77 | "make-boot0 guile-bootstrap")
|
| 78 | true;;
|
| 79 | "*")
|
| 80 | false;;
|
| 81 | esac
|
| 82 |
|
| 83 | test "`guix package -p "$profile" -I 'g.*e' | cut -f1`" = "guile-bootstrap"
|
| 84 |
|
| 85 | guix package --bootstrap -p "$profile_alt" -i gcc-bootstrap
|
| 86 | installed="`guix package -p "$profile" -p "$profile_alt" -I | cut -f1 | xargs echo | sort`"
|
| 87 | case "x$installed" in
|
| 88 | "gcc-bootstrap guile-bootstrap make-boot0")
|
| 89 | true;;
|
| 90 | "*")
|
| 91 | false;;
|
| 92 | esac
|
| 93 | test "`guix package -p "$profile_alt" -p "$profile" -I | wc -l`" = "3"
|
| 94 | rm "$profile_alt"
|
| 95 |
|
| 96 | |
| 97 | test "`guix package -p "$profile" -l | cut -f1 | grep guile | head -n1`" \
|
| 98 | = " guile-bootstrap"
|
| 99 |
|
| 100 | |
| 101 | guix package -p "$profile" --list-generations=42 && false
|
| 102 | guix package -p "$profile" --switch-generation=99 && false
|
| 103 |
|
| 104 | |
| 105 | guix package --bootstrap -p "$profile" -r "guile-bootstrap"
|
| 106 | test -L "$profile-3-link"
|
| 107 | test -f "$profile/bin/make" && test ! -f "$profile/bin/guile"
|
| 108 |
|
| 109 | |
| 110 | guix package --roll-back -p "$profile"
|
| 111 | test "`readlink_base "$profile"`" = "$profile-2-link"
|
| 112 | test -x "$profile/bin/guile" && test -x "$profile/bin/make"
|
| 113 | guix package --roll-back -p "$profile"
|
| 114 | test "`readlink_base "$profile"`" = "$profile-1-link"
|
| 115 | test -x "$profile/bin/guile" && test ! -x "$profile/bin/make"
|
| 116 |
|
| 117 | |
| 118 | guix package -p "$profile" --switch-generation=2
|
| 119 | test "`readlink_base "$profile"`" = "$profile-2-link"
|
| 120 | guix package -p "$profile" --switch-generation=-1
|
| 121 | test "`readlink_base "$profile"`" = "$profile-1-link"
|
| 122 |
|
| 123 | |
| 124 | for i in `seq 1 3`
|
| 125 | do
|
| 126 | guix package --bootstrap --roll-back -p "$profile"
|
| 127 | test ! -f "$profile/bin"
|
| 128 | test ! -f "$profile/lib"
|
| 129 | test "`readlink_base "$profile"`" = "$profile-0-link"
|
| 130 | done
|
| 131 |
|
| 132 | |
| 133 | test -z "`guix package -p "$profile" -l 0`"
|
| 134 |
|
| 135 | |
| 136 | guix package --bootstrap -p "$profile" -e "$boot_make"
|
| 137 | test "`readlink_base "$profile"`" = "$profile-1-link"
|
| 138 | test -x "$profile/bin/guile" && test ! -x "$profile/bin/make"
|
| 139 |
|
| 140 | |
| 141 | test "`guix package -p "$profile" -l 1 | cut -f3 | head -n1`" = "(current)"
|
| 142 |
|
| 143 | |
| 144 | guix package --bootstrap -p "$profile" --roll-back -i guile-bootstrap
|
| 145 | test "`readlink_base "$profile"`" = "$profile-1-link"
|
| 146 | test -x "$profile/bin/guile" && test ! -x "$profile/bin/make"
|
| 147 |
|
| 148 | |
| 149 | guix package --bootstrap -p "$profile" -e "$boot_make"
|
| 150 | test "`readlink_base "$profile"`" = "$profile-2-link"
|
| 151 | test -x "$profile/bin/guile" && test -x "$profile/bin/make"
|
| 152 | grep "`guix build -e "$boot_make"`" "$profile/manifest"
|
| 153 |
|
| 154 | |
| 155 | |
| 156 | rm "$profile-1-link"
|
| 157 | guix package --bootstrap -p "$profile" --roll-back
|
| 158 | test "`readlink_base "$profile"`" = "$profile-0-link"
|
| 159 | guix package -p "$profile" --switch-generation=+1
|
| 160 | test "`readlink_base "$profile"`" = "$profile-2-link"
|
| 161 |
|
| 162 | |
| 163 | guix package --bootstrap -p "$profile" -i guile-bootstrap -i gcc-bootstrap
|
| 164 | guix package -p "$profile" --search-paths | grep LIBRARY_PATH
|
| 165 |
|
| 166 | |
| 167 | guix package -p "$profile" --switch-generation=2
|
| 168 |
|
| 169 | |
| 170 | guix package -p "$profile" --delete-generations=3
|
| 171 | test -z "`guix package -p "$profile" -l 3`"
|
| 172 |
|
| 173 | |
| 174 | |
| 175 | rm "$profile"
|
| 176 | guix package --bootstrap -p "$profile" -i guile-bootstrap
|
| 177 | guix package --bootstrap -p "$profile_alt" -i gcc-bootstrap
|
| 178 | guix package -p "$profile" --search-paths | grep LIBRARY_PATH && false
|
| 179 | guix package -p "$profile" -p "$profile_alt" --search-paths \
|
| 180 | | grep "LIBRARY_PATH.*$profile/lib.$profile_alt/lib"
|
| 181 |
|
| 182 | |
| 183 | cat > "$module_dir/new.scm" <<EOF
|
| 184 | (define-module (new)
|
| 185 | #:use-module (guix)
|
| 186 | #:use-module (gnu packages bootstrap))
|
| 187 |
|
| 188 | (define-public new-guile
|
| 189 | (package (inherit %bootstrap-guile)
|
| 190 | (version (string-append "42." (getenv "V_MINOR")))))
|
| 191 | (define-public new-gcc
|
| 192 | (package (inherit %bootstrap-gcc)
|
| 193 | (version (string-append "77." (getenv "V_MINOR")))))
|
| 194 | EOF
|
| 195 |
|
| 196 | guix package --bootstrap -p "$profile" -i gcc-bootstrap
|
| 197 | installed="`guix package -p "$profile" -I | cut -f1`"
|
| 198 |
|
| 199 | |
| 200 | |
| 201 | V_MINOR=0
|
| 202 | export V_MINOR
|
| 203 | profile_before="$(readlink "$profile")"
|
| 204 | guix package -p "$profile" --bootstrap -L "$module_dir" -u |
| 205 | guix package -p "$profile" --roll-back
|
| 206 | guix package -p "$profile" --bootstrap -L "$module_dir" -u . -n |
| 207 | test "$(readlink "$profile")" = "$profile_before"
|
| 208 |
|
| 209 | for i in 1 2
|
| 210 | do
|
| 211 | V_MINOR="$i"
|
| 212 | export V_MINOR
|
| 213 |
|
| 214 | guix package -p "$profile" --bootstrap -L "$module_dir" -u .
|
| 215 | post_upgrade="`guix package -p "$profile" -I | cut -f1`"
|
| 216 | test "$post_upgrade" = "$installed"
|
| 217 | done
|
| 218 |
|
| 219 | |
| 220 | |
| 221 | |
| 222 |
|
| 223 | XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
|
| 224 | export XDG_CACHE_HOME
|
| 225 | HOME="$PWD/t-home-$$"
|
| 226 | export HOME
|
| 227 |
|
| 228 | mkdir -p "$HOME"
|
| 229 |
|
| 230 | |
| 231 | HOME="`cd $HOME; pwd -P`"
|
| 232 |
|
| 233 | guix package --bootstrap -e "$boot_make"
|
| 234 | test -f "$HOME/.guix-profile/bin/make"
|
| 235 |
|
| 236 | guix package --bootstrap --roll-back
|
| 237 | test ! -f "$HOME/.guix-profile/bin/make"
|