aboutsummaryrefslogtreecommitdiff
path: root/tests/guix-refresh.sh
blob: 2ce3c592ab0b37222936dedac2f9a65db70b88d7 (about) (plain)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# GNU Guix --- Functional package management for GNU
# Copyright © 2023 Ludovic Courtès <ludo@gnu.org>
#
# This file is part of GNU Guix.
#
# GNU Guix is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or (at
# your option) any later version.
#
# GNU Guix is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

#
# Test the 'guix refresh' command-line utility.
#

guix refresh --version

manifest="t-guix-refresh-manifest-$$.scm"
module_dir="t-guix-refresh-modules-$$"
trap 'rm -f "$manifest"; rm -rf "$module_dir"' EXIT

# Tell the 'test' updater what to simulate.
export GUIX_TEST_UPDATER_TARGETS
idutils_version="$(guix package -A ^idutils$ | cut -f2)"
GUIX_TEST_UPDATER_TARGETS='
  (("guile" "3" (("12.5" "file:///dev/null")
                 ("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"
                                   ("grep" "sed" "libreoffice")))))'

# No newer version available.
guix refresh -t test idutils	# XXX: should return non-zero?
case "$(guix refresh -t test idutils 2>&1)" in
    *"$idutils_version"*"already the latest version"*) true;;
    *) false;;
esac
guix refresh -t test libreoffice # XXX: should return non-zero?
case "$(guix refresh -t test libreoffice 2>&1)" in
    *"greater than the latest known version"*"1.0"*) true;;
    *) false;;
esac

# Various ways to specify packages.
cat > "$manifest" <<EOF
(specifications->manifest (list "guile@3.0"))
EOF
default_IFS="$IFS"
IFS=_
for spec in "guile"					\
	    "guile@3.0"					\
	    "-e_(@ (gnu packages guile) guile-3.0)"	\
	    "-m_$manifest"				\
	    "-r_guile"					\
	    "-s_core"
do
    guix refresh -t test $spec
    case "$(guix refresh -t test $spec 2>&1)" in
	*"would be upgraded"*"12.5"*)
	    true;;
	*)
	    false;;
    esac
done
IFS="$default_IFS"

# Actually updating.
mkdir "$module_dir"
echo hello > "$module_dir/source"
cat > "$module_dir/sample.scm"<<EOF
(define-module (sample)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (gnu packages base))

(define-public my-thing
  (package
    (inherit hello)
    (name "the-test-package")
    (version "4.3")
    (source (origin
              (method url-fetch)
              (uri (string-append "mirror://gnu/hello/hello-" version
                                  ".tar.gz"))
              (sha256
               (base32
                "086vqwk2wl8zfs47sq2xpjc9k066ilmb8z6dn0q6ymwjzlm196cd"))))
    (inputs (list coreutils tar))
    (properties '((updater-ignored-inputs . ("libreoffice"))))))
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?
case "$(guix refresh -t test guile=2.0.0 2>&1)" in
    *"failed to find"*"2.0.0"*) true;;
    *) false;;
esac

guix refresh -t test guile --target-version=2.0.0 # XXX: should return non-zero?
case "$(guix refresh -t test guile --target-version=2.0.0 2>&1)" in
    *"failed to find"*"2.0.0"*) true;;
    *) false;;
esac

for spec in "guile=1.6.4" "guile@3=1.6.4"
do
    guix refresh -t test "$spec"
    case "$(guix refresh -t test "$spec" 2>&1)" in
	*"would be downgraded"*"1.6.4"*) true;;
	*) false;;
    esac
done

# Listing updaters.  This should work whether or not networking is available.
guix refresh --list-updaters
lass='logheader'>2017-10-20gnu: webkitgtk: Update to 2.18.1.Leo Famulari * gnu/packages/webkit.scm (webkitgtk): Update to 2.18.1. 2017-10-20gnu: youtube-dl: Update to 2017.10.20.Tobias Geerinckx-Rice * gnu/packages/video.scm (youtube-dl): Update to 2017.10.20. 2017-10-20gnu: dovecot: Update to 2.2.33.2.Tobias Geerinckx-Rice * gnu/packages/mail.scm (dovecot): Update to 2.2.33.2. 2017-10-20gnu: ola: Build with protobuf@2.Tobias Geerinckx-Rice This follows up commit dd12d4aad02fc83e00e7b09d676aa78bcb7dd476. * gnu/packages/protobuf.scm (protobuf-2): New variable. * gnu/packages/lighting.scm (ola)[propagated-inputs]: Use it. 2017-10-20gnu: font-hack: Update to 3.000.Tobias Geerinckx-Rice * gnu/packages/fonts.scm (font-hack): Update to 3.000. [source]: Download from new account. [license]: Explicitly list all licences. 2017-10-20gnu: Add aegisub.Julien Lepiller * gnu/packages/video.scm (aegisub): New variable. 2017-10-20gnu: Add ffms2.Julien Lepiller * gnu/packages/video.scm (aegisub): New variable. 2017-10-20gnu: speexdsp: Fix building on aarch64-linux.Efraim Flashner * gnu/packages/xiph.scm (speexdsp)[arguments]: On aarch64-linux, disable neon optimisations. 2017-10-20gnu: Add emacs-json-snatcher.Oleg Pykhalov * gnu/packages/emacs.scm (emacs-json-snatcher): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> 2017-10-20gnu: shellcheck: Update to 0.4.6.ng0 * gnu/packages/haskell.scm (shellcheck): Update to 0.4.6. Signed-off-by: Ludovic Courtès <ludo@gnu.org> 2017-10-20gnu: dos2unix: Update to 7.4.0.Tobias Geerinckx-Rice * gnu/packages/textutils.scm (dos2unix): Update to 7.4.0. 2017-10-20gnu: cowsay: Swap ‘build’ and ‘install’ phases.Tobias Geerinckx-Rice * gnu/packages/games.scm (cowsay)[arguments]: Invoke ‘install.sh’ during the ‘install’ phase. Delete the ‘build’ phase, as there's nothing to be built. 2017-10-20gnu: cowsay: Update to 3.04.Tobias Geerinckx-Rice * gnu/packages/games.scm (cowsay): Update to 3.04. [source]: Download from new location. [home-page]: Point directly to the relevant page. [description]: Correct mark-up and expand slightly. 2017-10-20gnu: colordiff: Use HTTPS home page.Tobias Geerinckx-Rice * gnu/packages/patchutils.scm (colordiff)[home-page]: Use HTTPS. 2017-10-20gnu: unbound: Update to 1.6.7.Tobias Geerinckx-Rice * gnu/packages/dns.scm (unbound): Update to 1.6.7. 2017-10-20gnu: neofetch: Update to 3.3.0.Tobias Geerinckx-Rice * gnu/packages/admin.scm (neofetch): Update to 3.3.0. [arguments]: Add ‘install’ phase replacement that manually invokes make. 2017-10-20gnu: qtox: Update to 1.12.1.Tobias Geerinckx-Rice * gnu/packages/messaging.scm (qtox): Update to 1.12.1. 2017-10-20gnu: speedtest-cli: Update to 1.0.7.Tobias Geerinckx-Rice * gnu/packages/networking.scm (speedtest-cli): Update to 1.0.7. 2017-10-20gnu: cppcheck: Update to 1.81.Tobias Geerinckx-Rice * gnu/packages/check.scm (cppcheck): Update to 1.81. 2017-10-19gnu: python-sge-pygame: Update source URL.Kei Kebreau * gnu/packages/game-development.scm (python-sge-pygame)[source]: Update URL. 2017-10-19gnu: musl: Update to 1.1.17.Leo Famulari * gnu/packages/musl.scm (musl): Update to 1.1.17. [source]: Remove patch. * gnu/packages/patches/musl-CVE-2016-8859.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. 2017-10-19vm: Always use GRUB/i386.Ludovic Courtès Fixes <https://bugs.gnu.org/28768>. Reported by Oleg Pykhalov <go.wigust@gmail.com>. * gnu/system/vm.scm (virtualized-operating-system): Override the 'bootloader' field. 2017-10-19gnu: linux-libre: Update to 4.13.8.Mark H Weaver * gnu/packages/linux.scm (%linux-libre-version): Update to 4.13.8. (%linux-libre-hash): Update hash. 2017-10-19gnu: linux-libre@4.9: Update to 4.9.57.Mark H Weaver * gnu/packages/linux.scm (linux-libre-4.9): Update to 4.9.57. 2017-10-19gnu: linux-libre@4.4: Update to 4.4.93.Mark H Weaver * gnu/packages/linux.scm (linux-libre-4.4): Update to 4.4.93. 2017-10-19gnu: linux-libre@4.1: Update to 4.1.45.Mark H Weaver * gnu/packages/linux.scm (linux-libre-4.1): Update to 4.1.45. Remove patch that is now included upstream. 2017-10-19gnu: yadifa: Update to 2.2.6.Marius Bakke * gnu/packages/dns.scm (yadifa): Update to 2.2.6. 2017-10-19gnu: Add zathura-pdf-mupdf.Marius Bakke * gnu/packages/pdf.scm (zathura-pdf-mupdf): New variable. 2017-10-19gnu: qemu: Build with libjpeg-turbo.Marius Bakke This gets rid of a compile warning since SPICE uses libjpeg-turbo, and reduces the closure size by 0.8MiB. * gnu/packages/virtualization.scm (qemu)[inputs]: Replace LIBJPEG-8 with LIBJPEG-TURBO. 2017-10-19gnu: emacs: Fix Man default C header file search path.Oleg Pykhalov * gnu/packages/emacs.scm (emacs): Make sure Man looks for C header files in the right places. Signed-off-by: Ludovic Courtès <ludo@gnu.org> 2017-10-19gnu: speex: Build and install 'speexdec' and 'speexenc'.宋文武 * gnu/packages/xiph.scm (speex)[native-inputs]: Add 'pkg-config'. [inputs]: Add 'speexdsp'. Signed-off-by: Ludovic Courtès <ludo@gnu.org> 2017-10-19gnu: virt-manager: Fix default URI check.Andy Patterson Allows virt-manager to connect to qemu://system by default. * gnu/packages/virtualization.scm (virt-manager)[arguments]<#:phases>: Add 'fix-default-uri. Signed-off-by: Ludovic Courtès <ludo@gnu.org> 2017-10-19gnu: virt-manager: Enable statistics graphing support.Andy Patterson * gnu/packages/virtualization.scm (virt-manager)[inputs]: Add python2-pycairo. Signed-off-by: Ludovic Courtès <ludo@gnu.org>