# GNU Guix --- Functional package management for GNU # Copyright © 2023 Ludovic Courtès # # 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 . # # 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" <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"<&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 ges/lisp.scm, gnu/packages/lxde.scm, gnu/packages/machine-learning.scm, gnu/packages/mail.scm, gnu/packages/maths.scm, gnu/packages/messaging.scm, gnu/packages/monitoring.scm, gnu/packages/mp3.scm, gnu/packages/music.scm, gnu/packages/netpbm.scm, gnu/packages/networking.scm, gnu/packages/node.scm, gnu/packages/nvi.scm, gnu/packages/ocaml.scm, gnu/packages/pdf.scm, gnu/packages/perl.scm, gnu/packages/php.scm, gnu/packages/plotutils.scm, gnu/packages/pretty-print.scm, gnu/packages/profiling.scm, gnu/packages/pulseaudio.scm, gnu/packages/python-crypto.scm, gnu/packages/python.scm, gnu/packages/qt.scm, gnu/packages/robotics.scm, gnu/packages/sawfish.scm, gnu/packages/scanner.scm, gnu/packages/scheme.scm, gnu/packages/scribus.scm, gnu/packages/sdl.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/slang.scm, gnu/packages/smalltalk.scm, gnu/packages/ssh.scm, gnu/packages/sync.scm, gnu/packages/syncthing.scm, gnu/packages/tbb.scm, gnu/packages/terminals.scm, gnu/packages/texinfo.scm, gnu/packages/text-editors.scm, gnu/packages/textutils.scm, gnu/packages/tls.scm, gnu/packages/unrtf.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/vpn.scm, gnu/packages/web.scm, gnu/packages/wm.scm, gnu/packages/wxwidgets.scm, gnu/packages/xdisorg.scm, gnu/packages/xorg.scm: In all snippets, report errors using exceptions, or else return #t. 2018-01-30gnu: Add Aseba.Ludovic Courtès * gnu/packages/robotics.scm (aseba): New variable. 2018-01-30gnu: Add Enki.Ludovic Courtès * gnu/packages/robotics.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it.