1 # GNU Guix --- Functional package management for GNU
2 # Copyright © 2018, 2019 Ludovic Courtès <ludo@gnu.org>
4 # This file is part of GNU Guix.
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.
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.
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/>.
20 # Test 'guix build --with-branch'.
25 # 'guix build --with-branch' requires access to the network to clone the
26 # Git repository below.
28 if ! guile
-c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev
/null
34 orig_drv
="`guix build guile-gcrypt -d`"
35 latest_drv
="`guix build guile-gcrypt --with-branch=guile-gcrypt=master -d`"
37 test "$orig_drv" != "$latest_drv"
39 # FIXME: '-S' currently doesn't work with non-derivation source.
40 # checkout="`guix build guile-gcrypt --with-branch=guile-gcrypt=master -S`"
41 checkout
="`guix gc --references "$latest_drv" | grep guile-gcrypt | grep -v -E '(-builder|\.drv)'`"
43 test -f "$checkout/COPYING"
45 orig_drv
="`guix build guix -d`"
46 latest_drv
="`guix build guix --with-branch=guile-gcrypt=master -d`"
47 guix gc
-R "$latest_drv" |
grep guile-gcrypt-git.master
48 test "$orig_drv" != "$latest_drv"
50 v0_1_0_drv
="`guix build guix --with-commit=guile-gcrypt=9e3eacdec1d -d`"
51 guix gc
-R "$v0_1_0_drv" |
grep guile-gcrypt-git
.9e3eacd
52 test "$v0_1_0_drv" != "$latest_drv"
53 test "$v0_1_0_drv" != "$orig_drv"
55 v0_1_0_drv
="`guix build guix --with-commit=guile-gcrypt=v0.1.0 -d`"
56 guix gc
-R "$v0_1_0_drv" |
grep guile-gcrypt-git.v0.1
.0
57 guix gc
-R "$v0_1_0_drv" |
grep guile-gcrypt-9e3eacd
58 test "$v0_1_0_drv" != "$latest_drv"
59 test "$v0_1_0_drv" != "$orig_drv"
61 if guix build guix
--with-commit=guile-gcrypt
=000 -d
62 then false
; else true
; fi