1 # GNU Guix --- Functional package management for GNU
2 # Copyright © 2012 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 the `guix-package' command-line utility.
23 guix-package
--version
25 profile
="t-profile-$$"
28 trap 'rm "$profile" "$profile-"[0-9]*' EXIT
30 guix-package
-b -p "$profile" \
31 -i `guix-build -e '(@@ (distro packages base) %bootstrap-guile)'`
32 test -L "$profile" && test -L "$profile-1-link"
33 test -f "$profile/bin/guile"
35 # Installing the same package a second time does nothing.
36 guix-package
-b -p "$profile" \
37 -i `guix-build -e '(@@ (distro packages base) %bootstrap-guile)'`
38 test -L "$profile" && test -L "$profile-1-link"
39 ! test -f "$profile-2-link"
40 test -f "$profile/bin/guile"
42 # Check whether we have network access.
43 if guile
-c '(getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)' 2> /dev
/null
45 guix-package
-b -p "$profile" \
46 -i `guix-build -e '(@@ (distro packages base) gnu-make-boot0)'`
47 test -L "$profile-2-link"
48 test -f "$profile/bin/make" && test -f "$profile/bin/guile"
51 # Check whether `--list-installed' works.
52 # XXX: Change the tests when `--install' properly extracts the package
53 # name and version string.
54 installed
="`guix-package -p "$profile" --list-installed | cut -f1 | xargs echo | sort`"
56 "guile-bootstrap make-boot0")
58 "make-boot0 guile-bootstrap")
64 test "`guix-package -p "$profile" -I 'g.*e' | cut -f1`" = "guile-bootstrap"
67 guix-package
-b -p "$profile" -r "guile-bootstrap"
68 test -L "$profile-3-link"
69 test -f "$profile/bin/make" && ! test -f "$profile/bin/guile"
72 # Make sure the `:' syntax works.
73 guix-package
-b -i "libsigsegv:lib" -n
75 # Check whether `--list-available' returns something sensible.
76 guix-package
-A 'gui.*e' |
grep guile