summaryrefslogtreecommitdiff
path: root/src/chroot-tools/libremakepkg
diff options
context:
space:
mode:
Diffstat (limited to 'src/chroot-tools/libremakepkg')
-rwxr-xr-xsrc/chroot-tools/libremakepkg11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg
index a226e38..7f0acfd 100755
--- a/src/chroot-tools/libremakepkg
+++ b/src/chroot-tools/libremakepkg
@@ -5,7 +5,7 @@ set -euE
# Copyright (C) 2010-2012 Nicolás Reynolds <fauno@parabola.nu>
# Copyright (C) 2010-2012 Joshua Ismael Haase Hernández (xihh) <hahj87@gmail.com>
# Copyright (C) 2012 Michał Masłowski <mtjm@mtjm.eu>
-# Copyright (C) 2012-2015 Luke Shumaker <lukeshu@sbcglobal.net>
+# Copyright (C) 2012-2015, 2017 Luke Shumaker <lukeshu@sbcglobal.net>
#
# License: GNU GPLv2+
#
@@ -69,14 +69,15 @@ exit_copy() {
}
# Usage; run_hook $hookname $args...
-run_hook() {
+run_hook() (
local hookname=$1; shift
local hookvar="hook_${hookname}[@]"
local fails=()
+ set -o pipefail
for hook in "${!hookvar}"; do
- "$hook" "$@" || fails+=("$hook")
- done |& indent
+ { "$hook" "$@" |& indent; } || fails+=("$hook")
+ done
if [[ ${#fails[@]} -gt 0 ]]; then
error "Failure(s) in %s: %s" "$hookname" "${fails[*]}"
@@ -84,7 +85,7 @@ run_hook() {
else
return 0
fi
-}
+)
# Usage: add_to_local_repo $copydir $pkgfiles...
add_to_local_repo() {