aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Bo ├śrsted Andresen <bo.andresen@zlin.dk> 2008-05-06 09:55:20 +0000
committerAvatar Bo ├śrsted Andresen <bo.andresen@zlin.dk> 2008-05-06 09:55:20 +0000
commitb3246cd7bc88503de34742ebc73f4df35e3ed4bd (patch)
tree3096f70a7ebe0a849ca04aa23e5bbcb337a4852e
parentc7218cf044f1573e3b849a022749be320d9cf462 (diff)
downloadpaludis-b3246cd7bc88503de34742ebc73f4df35e3ed4bd.tar.gz
paludis-b3246cd7bc88503de34742ebc73f4df35e3ed4bd.tar.xz
Make expatch stricter. Quoting.
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/build_functions.bash18
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/src_unpack.bash2
2 files changed, 13 insertions, 7 deletions
diff --git a/paludis/repositories/e/ebuild/exheres-0/build_functions.bash b/paludis/repositories/e/ebuild/exheres-0/build_functions.bash
index e3d566b..cf2a545 100644
--- a/paludis/repositories/e/ebuild/exheres-0/build_functions.bash
+++ b/paludis/repositories/e/ebuild/exheres-0/build_functions.bash
@@ -26,7 +26,7 @@ expatch()
die "expatch called in EBUILD_PHASE ${EBUILD_PHASE}"
fi
- local recognise= patchlevel= options=() cmd=
+ local recognise= patchlevel= options=() cmd= appliedpatches=0
if [[ ${1} == "--recognised-suffixes" ]]; then
recognise=true
@@ -34,12 +34,13 @@ expatch()
fi
while [[ $# -gt 0 ]]; do
- if [[ ${1} == -p[0-9]* ]]; then
+ if [[ ${1} == -p*([:digit:]]) ]]; then
patchlevel="${1}"
- elif [[ ${1} == -* ]]; then
+ elif [[ ${1} == -+([^[:space:]]) ]]; then
options+=("${1}")
elif [[ -d ${1} ]]; then
expatch --recognised-suffixes ${patchlevel} "${options[@]}" "${1}"/*
+ ((appliedpatches++))
else
case "${1}" in
*.bz2)
@@ -63,12 +64,17 @@ expatch()
;;
esac
- echo "${cmd} ${1} | patch -s -f ${patchlevel:--p1} ${options[@]}" 1>&2
- ${cmd} "${1}" | patch -s -f ${patchlevel:--p1} "${options[@]}"
- assert "patch -s -f ${patchlevel:--p1} ${options[@]} ${1} failed"
+ echo "${cmd} -- '${1}' | patch -s -f ${patchlevel:--p1} ${options[@]}" 1>&2
+ ${cmd} -- "${1}" | patch -s -f ${patchlevel:--p1} "${options[@]}"
+ assert "applying '${1}' failed"
+ ((appliedpatches++))
fi
shift
done
+ # Die if no patches were applied and no directories were supplied. Since
+ # directories get handled recursively by separate instances of expatch we cannot
+ # reliably count applied patches when directories were supplied.
+ [[ ${appliedpatches} -le 0 && -z ${recognise} ]] && die "No patches applied."
}
econf()
diff --git a/paludis/repositories/e/ebuild/exheres-0/src_unpack.bash b/paludis/repositories/e/ebuild/exheres-0/src_unpack.bash
index ad8f07d..15e01d6 100644
--- a/paludis/repositories/e/ebuild/exheres-0/src_unpack.bash
+++ b/paludis/repositories/e/ebuild/exheres-0/src_unpack.bash
@@ -32,7 +32,7 @@ src_unpack()
exheres_internal_unpack()
{
- cd ${WORKDIR} || die "cd to \${WORKDIR} (\"${WORKDIR}\") failed"
+ cd "${WORKDIR}" || die "cd to \${WORKDIR} (\"${WORKDIR}\") failed"
if hasq "unpack" ${SKIP_FUNCTIONS} ; then
ebuild_section "Skipping src_unpack (SKIP_FUNCTIONS)"