summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2023-05-17 16:52:54 +0200
committerLudovic Courtès <ludo@gnu.org>2023-05-31 23:25:25 +0200
commitec0a2fc87bd651ebc8f253f6369ba4485912d9b2 (patch)
tree1aff0cf18ee1ba57147b3c3bd972d1118cf51d2b /tests
parent9f3ea03516b506d7c0440867b9db08898390a981 (diff)
downloadguix-ec0a2fc87bd651ebc8f253f6369ba4485912d9b2.tar.gz
upstream: 'update-package-source' edits input fields.
Previously, 'guix refresh r-ggplot2 -u' and similar commands would print
of list of input changes that would have to be made manually.  With this
change, 'guix refresh -u' takes care of updating input fields
automatically.

* guix/upstream.scm (update-package-inputs): New procedure.
(update-package-source): Call it when 'upstream-source-inputs' returns
true.
* guix/scripts/refresh.scm (update-package): Remove iteration over the
result of 'changed-inputs'.
* guix/import/test.scm (available-updates): Add support for input
lists.
* tests/guix-refresh.sh (GUIX_TEST_UPDATER_TARGETS): Add input list for
"the-test-package".
Make sure 'guix refresh -u' updates 'inputs' accordingly.
* doc/guix.texi (Invoking guix refresh): Mention it.
Diffstat (limited to 'tests')
-rw-r--r--tests/guix-refresh.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/guix-refresh.sh b/tests/guix-refresh.sh
index 691020b031..9d7a57a36e 100644
--- a/tests/guix-refresh.sh
+++ b/tests/guix-refresh.sh
@@ -34,7 +34,8 @@ GUIX_TEST_UPDATER_TARGETS='
                  ("1.6.4" "file:///dev/null")))
    ("libreoffice" "" (("1.0" "file:///dev/null")))
    ("idutils" "" (("'$idutils_version'" "file:///dev/null")))
-   ("the-test-package" "" (("5.5" "file://'$PWD/$module_dir'/source"))))'
+   ("the-test-package" "" (("5.5" "file://'$PWD/$module_dir'/source"
+                                   ("grep" "sed")))))'
 
 # No newer version available.
 guix refresh -t test idutils	# XXX: should return non-zero?
@@ -91,13 +92,15 @@ cat > "$module_dir/sample.scm"<<EOF
                                   ".tar.gz"))
               (sha256
                (base32
-                "086vqwk2wl8zfs47sq2xpjc9k066ilmb8z6dn0q6ymwjzlm196cd"))))))
+                "086vqwk2wl8zfs47sq2xpjc9k066ilmb8z6dn0q6ymwjzlm196cd"))))
+    (inputs (list coreutils tar))))
 EOF
 guix refresh -t test -L "$module_dir" the-test-package
 guix refresh -t test -L "$module_dir" the-test-package -u \
      --keyring="$module_dir/keyring.kbx"  # so we don't create $HOME/.config
 grep 'version "5.5"' "$module_dir/sample.scm"
 grep "$(guix hash -H sha256 -f nix-base32 "$module_dir/source")" "$module_dir/sample.scm"
+grep '(inputs (list grep sed))' "$module_dir/sample.scm"
 
 # Specifying a target version.
 guix refresh -t test guile=2.0.0 # XXX: should return non-zero?