aboutsummaryrefslogtreecommitdiff
# GNU Guix --- Functional package management for GNU
# Copyright © 2018, 2019, 2020, 2022 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 'guix build --with-branch'.
#

guix build --version

# 'guix build --with-branch' requires access to the network to clone the
# Git repository below.

if ! guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null
then
    # Skipping.
    exit 77
fi

orig_drv="`guix build guile-gcrypt -d`"
latest_drv="`guix build guile-gcrypt --with-branch=guile-gcrypt=master -d`"
test -n "$latest_drv"
test "$orig_drv" != "$latest_drv"

# FIXME: '-S' currently doesn't work with non-derivation source.
# checkout="`guix build guile-gcrypt --with-branch=guile-gcrypt=master -S`"
checkout="`guix gc --references "$latest_drv" | grep guile-gcrypt | grep -v -E '(-builder|\.drv)'`"
test -d "$checkout"
test -f "$checkout/COPYING"

orig_drv="`guix build guix -d`"
latest_drv="`guix build guix --with-branch=guile-gcrypt=master -d`"
guix gc -R "$latest_drv" | grep guile-gcrypt-git.master
test "$orig_drv" != "$latest_drv"

v0_1_0_drv="`guix build guix --with-commit=guile-gcrypt=9e3eacdec1d -d`"
guix gc -R "$v0_1_0_drv" | grep guile-gcrypt-git.9e3eacd
test "$v0_1_0_drv" != "$latest_drv"
test "$v0_1_0_drv" != "$orig_drv"

v0_1_0_drv="`guix build guix --with-commit=guile-gcrypt=v0.1.0 -d`"
guix gc -R "$v0_1_0_drv" | grep guile-gcrypt-0.1.0
guix gc -R "$v0_1_0_drv" | grep guile-gcrypt-9e3eacd
test "$v0_1_0_drv" != "$latest_drv"
test "$v0_1_0_drv" != "$orig_drv"

guix build guix --with-commit=guile-gcrypt=000 -d && false

exit 0
>Maxim Cournoyer 2023-04-09guix-install.sh: Source both profiles, default user's and home....Andrew Tropin 2023-02-17guix-install.sh: Add GUIX_ALLOW_OVERWRITE environment variable....Maxim Cournoyer 2022-12-16guix-install.sh: Directly exit in case of errors in chk_require....Maxim Cournoyer 2022-12-16guix-install.sh: Add missing "useradd" command....Maxim Cournoyer 2022-12-11guix-install.sh: Gracefully fail on | bash....Tobias Geerinckx-Rice 2022-12-09guix-install.sh: Authorize all project build farms at once....Tobias Geerinckx-Rice 2022-11-16guix-install.sh: Expand mktemp template for busybox compatibility....Maxim Cournoyer 2022-11-14guix-install.sh: Remove unnecessary XDG_DATA_DIRS export....Prafulla Giri 2022-11-08guix-install.sh: Run guix.sh script in /etc/profile.d last....Konrad Hinsen 2022-10-16guix-install.sh: Cosmetically tweak non-interactive output....Tobias Geerinckx-Rice 2022-10-16guix-install.sh: Warn if we suspect dodgy automation....Tobias Geerinckx-Rice 2022-10-16guix-install.sh: Treat all uncaught errors as fatal....Tobias Geerinckx-Rice 2022-10-16guix-install.sh: Suggest what to do if fetching OpenPGP key(s) fails....Tobias Geerinckx-Rice 2022-10-16guix-install.sh: Time out fetching OpenPGP keys....Tobias Geerinckx-Rice 2022-10-11guix-install.sh: Restore compatibility with "yes" invocation....Maxim Cournoyer 2022-10-07guix-install.sh: Add Bash prompt customization option....Maxim Cournoyer 2022-10-07guix-install.sh: Introduce 'die' utility function....Maxim Cournoyer 2022-10-07guix-install.sh: Improve prompt_yes_no procedure....Maxim Cournoyer 2022-07-04etc/guix-install.sh: Check for profile from 'guix home'....Philip McGrath 2022-07-04etc/guix-install.sh: Initialize XDG base directories....Philip McGrath 2021-11-07guix-install.sh: Undo some bugs introduced by shellcheck....Tobias Geerinckx-Rice 2021-09-29guix-install.sh: Don't swallow wget errors....Tobias Geerinckx-Rice 2021-07-14guix-install.sh: Untabify....Maxim Cournoyer 2021-07-07guix-install.sh: Prompt for configuring substitutes discovery....Maxim Cournoyer 2021-07-07guix-install.sh: No longer export GUIX_PROFILE....Hartmut Goebel