From 9f2b087650fc27d80e91e9f44d1af3a94155b95e Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 18 Jun 2017 12:30:08 +0200 Subject: whatsupnix: exit 2 if there were build errors --- krebs/5pkgs/simple/whatsupnix/whatsupnix.bash | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'krebs/5pkgs/simple/whatsupnix') diff --git a/krebs/5pkgs/simple/whatsupnix/whatsupnix.bash b/krebs/5pkgs/simple/whatsupnix/whatsupnix.bash index 7089e8897..1d93f3e5c 100644 --- a/krebs/5pkgs/simple/whatsupnix/whatsupnix.bash +++ b/krebs/5pkgs/simple/whatsupnix/whatsupnix.bash @@ -1,14 +1,21 @@ #!/usr/bin/env bash - +# # Prints build logs for failed derivations in quiet build mode (-Q). # See https://github.com/NixOS/nix/issues/443 # # Usage: # -# set -o pipefail # nix-build ... -Q ... | whatsupnix [user@target[:port]] # - +# Exit Codes: +# +# 0 No failed derivations could be found. This either means there where +# no build errors, or stdin wasn't nix-build output. +# +# 1 Usage error; arguments couldn't be parsed. +# +# 2 Build error; at least one failed derivation could be found. +# GAWK=${GAWK:-gawk} NIX_STORE=${NIX_STORE:-nix-store} @@ -69,4 +76,8 @@ while read -r drv; do echo done < "$broken" -exit 0 +if test -s "$broken"; then + exit 2 +else + exit 0 +fi -- cgit v1.2.3