aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ingmar Vanhassel <ingmar@exherbo.org> 2008-08-17 16:39:35 +0200
committerAvatar Ingmar Vanhassel <ingmar@exherbo.org> 2008-08-17 16:39:35 +0200
commit818399bd8ad5e3871084ee6951ba63a38ce92394 (patch)
tree17eaaa75f968358cca519817e098feb7b43f3dfa
parentd606d20248af8d2e4b48130086d53cf88a271ac3 (diff)
downloadpaludis-818399bd8ad5e3871084ee6951ba63a38ce92394.tar.gz
paludis-818399bd8ad5e3871084ee6951ba63a38ce92394.tar.xz
Make expatch die when it's passed an empty directory.
Otherwise patch hangs, waiting for input from stdin...
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/build_functions.bash4
1 files changed, 3 insertions, 1 deletions
diff --git a/paludis/repositories/e/ebuild/exheres-0/build_functions.bash b/paludis/repositories/e/ebuild/exheres-0/build_functions.bash
index 0af313d..741e335 100644
--- a/paludis/repositories/e/ebuild/exheres-0/build_functions.bash
+++ b/paludis/repositories/e/ebuild/exheres-0/build_functions.bash
@@ -40,7 +40,7 @@ expatch()
die "expatch called in EBUILD_PHASE ${EBUILD_PHASE}"
fi
- local recognise= patchlevel= options=() cmd= appliedpatches=0
+ local recognise= patchlevel= options=() cmd= appliedpatches=0 dirpatches=()
if [[ ${1} == "--recognised-suffixes" ]]; then
recognise=true
@@ -53,6 +53,8 @@ expatch()
elif [[ ${1} == -+([^[:space:]]) ]]; then
options+=("${1}")
elif [[ -d ${1} ]]; then
+ dirpatches=("${1}"/*)
+ [[ -f ${dirpatches[0]} ]] || die "expatch called with empty directory $1"
expatch --recognised-suffixes ${patchlevel} "${options[@]}" "${1}"/* || return 247
((appliedpatches++))
else