gnu: surgescript: Update to 0.5.4.4.
[jackhill/guix/guix.git] / tests / guix-build-branch.sh
CommitLineData
96915a44 1# GNU Guix --- Functional package management for GNU
3cea5507 2# Copyright © 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
96915a44
LC
3#
4# This file is part of GNU Guix.
5#
6# GNU Guix is free software; you can redistribute it and/or modify it
7# under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 3 of the License, or (at
9# your option) any later version.
10#
11# GNU Guix is distributed in the hope that it will be useful, but
12# WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19#
20# Test 'guix build --with-branch'.
21#
22
23guix build --version
24
25# 'guix build --with-branch' requires access to the network to clone the
26# Git repository below.
27
28if ! guile -c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev/null
29then
30 # Skipping.
31 exit 77
32fi
33
34orig_drv="`guix build guile-gcrypt -d`"
35latest_drv="`guix build guile-gcrypt --with-branch=guile-gcrypt=master -d`"
36test -n "$latest_drv"
37test "$orig_drv" != "$latest_drv"
38
39# FIXME: '-S' currently doesn't work with non-derivation source.
40# checkout="`guix build guile-gcrypt --with-branch=guile-gcrypt=master -S`"
41checkout="`guix gc --references "$latest_drv" | grep guile-gcrypt | grep -v -E '(-builder|\.drv)'`"
42test -d "$checkout"
43test -f "$checkout/COPYING"
44
45orig_drv="`guix build guix -d`"
46latest_drv="`guix build guix --with-branch=guile-gcrypt=master -d`"
47guix gc -R "$latest_drv" | grep guile-gcrypt-git.master
48test "$orig_drv" != "$latest_drv"
b18f7234
LC
49
50v0_1_0_drv="`guix build guix --with-commit=guile-gcrypt=9e3eacdec1d -d`"
51guix gc -R "$v0_1_0_drv" | grep guile-gcrypt-git.9e3eacd
52test "$v0_1_0_drv" != "$latest_drv"
53test "$v0_1_0_drv" != "$orig_drv"
a3d77c51 54
177fecb5 55v0_1_0_drv="`guix build guix --with-commit=guile-gcrypt=v0.1.0 -d`"
3c82f125 56guix gc -R "$v0_1_0_drv" | grep guile-gcrypt-0.1.0
3cea5507 57guix gc -R "$v0_1_0_drv" | grep guile-gcrypt-8fe64e8 # this is the tag ID
177fecb5
LC
58test "$v0_1_0_drv" != "$latest_drv"
59test "$v0_1_0_drv" != "$orig_drv"
60
a3d77c51
LC
61if guix build guix --with-commit=guile-gcrypt=000 -d
62then false; else true; fi