From a76b36ec0b53a494f48280b61373d295f7314146 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rapha=C3=ABl=20Hertzog?= <hertzog@debian.org>
Date: Fri, 20 Feb 2015 15:47:25 +0100
Subject: [PATCH] Properly catch errors even when we use --verbose

The usage of the pipe did hide errors from us when we were using
--verbose. We use a bashism to detect failures in pipes so update
the shebang accordingly.
---
 auto/config | 6 +++---
 build.sh    | 4 +++-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/auto/config b/auto/config
index 1168443..962e2ab 100755
--- a/auto/config
+++ b/auto/config
@@ -23,15 +23,15 @@ while [ $# -gt 0 ]; do
 		temp="$temp "'"'"$2"'"'
 		shift
 		;;
-	--proposed-updates)
+	-p|--proposed-updates)
 		enable_pu="1"
 		;;
-	--kali-dev)
+	-d|--kali-dev)
 		dist="kali-dev"
 		# No security repo
 		lb_opts="--security false --initsystem systemd"
 		;;
-	--kali-rolling)
+	-r|--kali-rolling)
 		dist="kali-rolling"
 		lb_opts="--initsystem systemd"
 		;;
diff --git a/build.sh b/build.sh
index f25d0db..798e7f9 100755
--- a/build.sh
+++ b/build.sh
@@ -1,6 +1,7 @@
-#!/bin/sh
+#!/bin/bash
 
 set -e
+set -o pipefail  # Bashism
 
 KALI_DIST=kali
 KALI_VERSION="${VERSION:-daily}"
@@ -37,6 +38,7 @@ run_and_log() {
 	else
 		"$@" >>build.log 2>&1
 	fi
+	return $?
 }
 
 # Parsing command line options