summaryrefslogtreecommitdiff
path: root/tests/guix-package.sh
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-01-04 22:42:42 +0100
committerLudovic Courtès <ludo@gnu.org>2014-01-04 22:45:33 +0100
commit1a43e4dc572c49e01380c86cdf09934aa0560917 (patch)
tree1d4835b5b60273f00060503823579857198d069b /tests/guix-package.sh
parentaebaeaee33231d5027dc26c05ac510e8324af3dd (diff)
guix package: Gracefully deal with EPIPE on stdout for --list-*.
* guix/scripts/package.scm (leave-on-EPIPE): New macro. (guix-package): Use it for 'list-installed', 'list-available', and '--list-generations'. * tests/guix-package.sh: Add test.
Diffstat (limited to 'tests/guix-package.sh')
-rw-r--r--tests/guix-package.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/guix-package.sh b/tests/guix-package.sh
index 47a2d06cb3..b79c4951d8 100644
--- a/tests/guix-package.sh
+++ b/tests/guix-package.sh
@@ -1,5 +1,5 @@
# GNU Guix --- Functional package management for GNU
-# Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
+# Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
# Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
#
# This file is part of GNU Guix.
@@ -218,3 +218,10 @@ done
# Extraneous argument.
if guix package install foo-bar;
then false; else true; fi
+
+# Make sure the "broken pipe" doesn't yield an error.
+# Note: 'pipefail' is a Bash-specific option.
+set -o pipefail || true
+guix package -A g | head -1 2> "$HOME/err1"
+guix package -I | head -1 2> "$HOME/err2"
+test "`cat "$HOME/err1" "$HOME/err2"`" = ""