diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2026-04-23 16:48:30 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2026-05-10 17:01:08 +0200 |
| commit | f13901f6cbd663019090963664ace72345165461 (patch) | |
| tree | 294a2ea6f49725a6ac105bb99604d62d6d3dc0d4 /tests | |
| parent | 4b81a4df19bc659915e156fed9b12fb9319b11fb (diff) | |
pull, time-machine: Accept content SWHIDs as arguments to ‘--channels’.
* guix/swh.scm (swhid-content-data): New procedure.
(call): Do not close ‘port’ when ‘result’ is the same as ‘port’.
* guix/scripts/pull.scm (swhid-content-data*): New procedure.
(channel-list): Accept ‘file’ as a SWHID.
* tests/guix-time-machine.sh: Add test.
* doc/guix.texi (Invoking guix pull): Document it.
(Invoking guix time-machine): Likewise.
Change-Id: I8145cd8685fe2926b1548d4a2dcd54804d89228a
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/guix-time-machine.sh | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/guix-time-machine.sh b/tests/guix-time-machine.sh index 35b186ad6d1..262e3d5fef8 100644 --- a/tests/guix-time-machine.sh +++ b/tests/guix-time-machine.sh | |||
| @@ -22,7 +22,8 @@ | |||
| 22 | # | 22 | # |
| 23 | 23 | ||
| 24 | channels_file="channels-test-$$.scm" | 24 | channels_file="channels-test-$$.scm" |
| 25 | trap "rm -f $channels_file" EXIT | 25 | log_file="log-test-$$.log" |
| 26 | trap "rm -f $channels_file $log_file" EXIT | ||
| 26 | 27 | ||
| 27 | cat > "$channels_file" <<EOF | 28 | cat > "$channels_file" <<EOF |
| 28 | (system "echo rm -rf /") | 29 | (system "echo rm -rf /") |
| @@ -73,6 +74,19 @@ cat > "$channels_file" <<EOF | |||
| 73 | EOF | 74 | EOF |
| 74 | guix repl -- "$channels_file" | 75 | guix repl -- "$channels_file" |
| 75 | 76 | ||
| 77 | if guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null | ||
| 78 | then | ||
| 79 | # Ignore the user's ~/.config/guix/trusted-channels.scm. Under | ||
| 80 | # ./pre-inst-env zero channels are trusted by default so the following | ||
| 81 | # command must fail. | ||
| 82 | XDG_CONFIG_HOME="$XDG_CACHE_HOME/dot-config" \ | ||
| 83 | guix time-machine \ | ||
| 84 | -C swh:1:cnt:003e1e0c1b9b358082201332c926ae54e9549002 \ | ||
| 85 | 2> "$log_file" \ | ||
| 86 | && false | ||
| 87 | grep "'guix' is not trusted" "$log_file" | ||
| 88 | fi | ||
| 89 | |||
| 76 | if [ -d "$abs_top_srcdir/.git" ] \ | 90 | if [ -d "$abs_top_srcdir/.git" ] \ |
| 77 | || guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null | 91 | || guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null |
| 78 | then | 92 | then |
