| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 |
|
| 19 | |
| 20 | |
| 21 | |
| 22 |
|
| 23 | guix pack --version
|
| 24 |
|
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 |
|
| 30 | storedir="`guile -c '(use-modules (guix config))(display %storedir)'`"
|
| 31 | localstatedir="`guile -c '(use-modules (guix config))(display %localstatedir)'`"
|
| 32 | NIX_STORE_DIR="$storedir"
|
| 33 | GUIX_DAEMON_SOCKET="$localstatedir/guix/daemon-socket/socket"
|
| 34 | GUIX_BUILD_OPTIONS="--timeout=`guile -c '(use-modules (guix tests))(display %tests-build-timeout)'`"
|
| 35 | export NIX_STORE_DIR GUIX_DAEMON_SOCKET GUIX_BUILD_OPTIONS
|
| 36 |
|
| 37 | if ! guile -c '(use-modules (guix)) (exit (false-if-exception (open-connection)))'
|
| 38 | then
|
| 39 | exit 77
|
| 40 | fi
|
| 41 |
|
| 42 | |
| 43 | the_pack="`guix pack -C none --localstatedir --profile-name=current-guix \
|
| 44 | guile-bootstrap`"
|
| 45 | test_directory="`mktemp -d`"
|
| 46 | trap 'chmod -Rf +w "$test_directory"; rm -rf "$test_directory"' EXIT
|
| 47 |
|
| 48 | cd "$test_directory"
|
| 49 | tar -xf "$the_pack"
|
| 50 |
|
| 51 | profile="`find -name current-guix`"
|
| 52 | test "`readlink $profile`" = "current-guix-1-link"
|
| 53 | test -s "`dirname $profile`/../../../db/db.sqlite"
|
| 54 | test -x ".`guix build guile-bootstrap`/bin/guile"
|
| 55 | cd -
|
| 56 |
|
| 57 | |
| 58 | guile -c "(use-modules (sqlite3) (guix config) (ice-9 match))
|
| 59 |
|
| 60 | (define db
|
| 61 | (sqlite-open (string-append \"$test_directory\"
|
| 62 | %localstatedir
|
| 63 | \"/guix/db/db.sqlite\")
|
| 64 | SQLITE_OPEN_READONLY))
|
| 65 |
|
| 66 | (define stmt
|
| 67 | (sqlite-prepare db \"SELECT * FROM ValidPaths;\"))
|
| 68 |
|
| 69 | (match (sqlite-fold cons '() stmt)
|
| 70 | ((#(ids paths hashes times derivers sizes) ...)
|
| 71 | (exit (member \"`guix build guile-bootstrap`\" paths))))"
|