aboutsummaryrefslogtreecommitdiff
# GNU Guix --- Functional package management for GNU
# Copyright © 2013, 2014, 2015, 2019, 2020 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 archive' command-line utility.
#

guix archive --version

archive="t-archive-$$"
archive_alt="t-archive-alt-$$"
tmpdir="t-archive-dir-$$"
rm -f "$archive" "$archive_alt"
rm -rf "$tmpdir"

trap 'rm -f "$archive" "$archive_alt"; chmod -R +w "$tmpdir"; rm -rf "$tmpdir"' EXIT

guix archive --export guile-bootstrap > "$archive"
guix archive --export guile-bootstrap:out > "$archive_alt"
cmp "$archive" "$archive_alt"

guix archive --export							\
    -e '(@ (gnu packages bootstrap) %bootstrap-guile)' > "$archive_alt"
cmp "$archive" "$archive_alt"

guix archive --export `guix build guile-bootstrap` > "$archive_alt"
cmp "$archive" "$archive_alt"

# Check the exit value upon import.
guix archive --import < "$archive"

guix archive --export something-that-does-not-exist && false

# This one must not be listed as missing.
guix build guile-bootstrap > "$archive"
guix archive --missing < "$archive"
test "`guix archive --missing < "$archive"`" = ""

# Two out of three should be listed as missing.
echo "$NIX_STORE_DIR/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo" >> "$archive"
echo "$NIX_STORE_DIR/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bar" >> "$archive"
guix archive --missing < "$archive" > "$archive_alt"
echo "$NIX_STORE_DIR/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-foo" > "$archive"
echo "$NIX_STORE_DIR/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bar" >> "$archive"
cmp "$archive" "$archive_alt"

# This is not a valid store file name, so an error.
echo something invalid > "$archive"
guix archive --missing < "$archive" && false

# Check '--extract'.
guile -c "(use-modules (guix serialization))
  (call-with-output-file \"$archive\"
    (lambda (port)
      (write-file \"$(guix build guile-bootstrap)\" port)))"
guix archive -x "$tmpdir" < "$archive"
test -x "$tmpdir/bin/guile"
test -d "$tmpdir/lib/guile"

# Check '--list'.
guix archive -t < "$archive" | grep "^D /share/guile"
guix archive -t < "$archive" | grep "^x /bin/guile"
guix archive -t < "$archive" | grep "^r /share/guile.*/boot-9\.scm"

echo foo | guix archive --authorize && false

exit 0
92c249d'>gnu: bear: Don't use unstable tarball....* gnu/packages/build-tools.scm (bear)[source]: Use GIT-FETCH and GIT-FILE-NAME. Tobias Geerinckx-Rice 2018-07-28gnu: meson: Update to 0.47.1....* gnu/packages/build-tools.scm (meson): Update to 0.47.1. * gnu/packages/patches/meson-for-build-rpath.patch: Adjust to file rename and indendation change. Marius Bakke 2018-06-11Merge branch 'master' into stagingMarius Bakke 2018-06-11gnu: meson: Update to 0.46.1....* gnu/packages/build-tools.scm (meson): Update to 0.46.1. Marius Bakke 2018-05-31gnu: bear: Fix python path....* gnu/packages/build-tools.scm (bear) [inputs]: Add python-wrapper. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Fis Trivial 2018-04-30gnu: meson: Update to 0.46.0....* gnu/packages/build-tools.scm (meson): Update to 0.46.0. * gnu/packages/patches/meson-for-build-rpath.patch: Adapt. Marius Bakke 2018-04-25Merge branch 'master' into stagingMarius Bakke 2018-04-21gnu: Add osc.... * gnu/packages/build-tools.scm (osc): New variable. Tomáš Čech 2018-04-16Merge branch 'master' into stagingMarius Bakke 2018-04-08gnu: Add bear....* gnu/packages/build-tools.scm (bear): New public variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Fis Trivial 2018-03-22gnu: meson: Update to 0.45.1....* gnu/packages/build-tools.scm (meson): Update to 0.45.1. Marius Bakke 2018-03-18Merge branch 'master' into stagingMarius Bakke 2018-03-17gnu: Fix common unquote typos....It's easy to mistype ‘("foo" foo)’ as ‘("foo", foo)’ (which also works). Fix such typos for the proper edification of our young. * gnu/packages/android.scm: Move unquotes to their operands. * gnu/packages/bootloaders.scm: Likewise. * gnu/packages/build-tools.scm: Likewise. * gnu/packages/chemistry.scm: Likewise. * gnu/packages/compression.scm: Likewise. * gnu/packages/connman.scm: Likewise. * gnu/packages/django.scm: Likewise. * gnu/packages/emulators.scm: Likewise. * gnu/packages/engineering.scm: Likewise. * gnu/packages/file-systems.scm: Likewise. * gnu/packages/freedesktop.scm: Likewise. * gnu/packages/games.scm: Likewise. * gnu/packages/gimp.scm: Likewise. * gnu/packages/gl.scm: Likewise. * gnu/packages/gnome.scm: Likewise. * gnu/packages/graphics.scm: Likewise. * gnu/packages/haskell.scm: Likewise. * gnu/packages/irc.scm: Likewise. * gnu/packages/julia.scm: Likewise. * gnu/packages/kde-frameworks.scm: Likewise. * gnu/packages/linux.scm: Likewise. * gnu/packages/lua.scm: Likewise. * gnu/packages/mail.scm: Likewise. * gnu/packages/make-bootstrap.scm: Likewise. * gnu/packages/messaging.scm: Likewise. * gnu/packages/music.scm: Likewise. * gnu/packages/networking.scm: Likewise. * gnu/packages/ocaml.scm: Likewise. * gnu/packages/perl.scm: Likewise. * gnu/packages/python.scm: Likewise. * gnu/packages/python-web.scm: Likewise. * gnu/packages/qt.scm: Likewise. * gnu/packages/ratpoison.scm: Likewise. * gnu/packages/sdl.scm: Likewise. * gnu/packages/sml.scm: Likewise. * gnu/packages/terminals.scm: Likewise. * gnu/packages/text-editors.scm: Likewise. * gnu/packages/video.scm: Likewise. * gnu/packages/virtualization.scm: Likewise. * gnu/packages/vulkan.scm: Likewise. * gnu/packages/wget.scm: Likewise. * gnu/packages/wine.scm: Likewise. * gnu/packages/wm.scm: Likewise. * gnu/packages/xdisorg.scm: Likewise. * gnu/packages/xml.scm: Likewise. * gnu/packages/xorg.scm: Likewise. Tobias Geerinckx-Rice 2018-03-12gnu: meson: Update to 0.45.0....* gnu/packages/build-tools.scm (meson): Update to 0.45.0. [arguments]: Explicitly disable tests (they were skipped before). Marius Bakke 2018-03-12gnu: meson-for-build: Update to 0.44.0....* gnu/packages/build-tools.scm (meson-for-build)[version]: Remove field. [source]: Inherit from MESON. Marius Bakke 2018-03-12gnu: meson: Don't wrap the meson executable....* gnu/packages/build-tools.scm (meson)[arguments]: Delete WRAP-PHASE. Marius Bakke 2018-03-07gnu: meson: Mark up description....* gnu/packages/build-tools.scm (meson)[description]: Use @dfn. Tobias Geerinckx-Rice 2017-12-12gnu: meson: Update to 0.44.0....* gnu/packages/build-tools.scm (meson): Update to 0.44.0 Tobias Geerinckx-Rice 2017-10-13gnu: meson: Update to 0.43.0....* gnu/packages/build-tools.scm (meson): Update to 0.43.0. Ricardo Wurmus 2017-10-09gnu: meson: Update to 0.42.1....* gnu/packages/build-tools.scm (meson, meson-for-build): Update to 0.42.1. Tobias Geerinckx-Rice 2017-09-16gnu: Add meson-for-build....* gnu/packages/build-tools.scm (meson-for-build): New variable. * gnu/packages/patches/meson-for-build-rpath.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Peter Mikkelsen 2017-09-16gnu: meson: Update to 0.42.0....* gnu/packages/build-tools.scm (meson): Update to 0.42.0. [propagated-inputs]: Add python. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Peter Mikkelsen 2017-07-20gnu: Add premake4....* gnu/packages/build-tools.scm (premake4): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Oleg Pykhalov 2017-07-19gnu: meson: Update to 0.41.1....* gnu/packages/build-tools.scm (meson) Update to 0.41.1. Tobias Geerinckx-Rice 2017-05-07gnu: meson: Update to 0.40.1....* gnu/packages/build-tools.scm (meson): Update to 0.40.1. Tobias Geerinckx-Rice 2017-04-20gnu: Add Meson....* gnu/packages/build-tools.scm (meson): New variables. Co-authored-by: Ludovic Courtès <ludo@gnu.org> Corentin Bocquillon 2017-04-13gnu: Add bam....* gnu/packages/build-tools.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. Ricardo Wurmus