diff options
Diffstat (limited to 'src/chroot-tools/libremakepkg')
-rwxr-xr-x | src/chroot-tools/libremakepkg | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg index 5b86c03..cd9e60e 100755 --- a/src/chroot-tools/libremakepkg +++ b/src/chroot-tools/libremakepkg @@ -69,14 +69,16 @@ 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" "$@" |& indent; } || fails+=("$hook") + # The "<&0&wait $!" trick is to prevent "||" from + # disabling "set -e" + { "$hook" "$@" |& indent; } <&0&wait $! || fails+=("$hook") done if [[ ${#fails[@]} -gt 0 ]]; then @@ -85,7 +87,7 @@ run_hook() ( else return 0 fi -) +} # Usage: add_to_local_repo $copydir $pkgfiles... add_to_local_repo() { |