aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Bo ├śrsted Andresen <bo.andresen@zlin.dk> 2008-02-21 14:50:04 +0000
committerAvatar Bo ├śrsted Andresen <bo.andresen@zlin.dk> 2008-02-21 14:50:04 +0000
commit3caf2b3e340e7e866464ca95290579c73d5b3069 (patch)
treebcb32b8df6278aad58baff18934b226b6134f7a7
parent981dd553a590eff046d49bccd06f2cb61963edee (diff)
downloadpaludis-3caf2b3e340e7e866464ca95290579c73d5b3069.tar.gz
paludis-3caf2b3e340e7e866464ca95290579c73d5b3069.tar.xz
Implement expatch wrapper and DEFAULT_SRC_PREPARE_PATCHES for exheres-0.
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/build_functions.bash51
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/src_prepare.bash4
2 files changed, 54 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 ad41a5c..082eb43 100644
--- a/paludis/repositories/e/ebuild/exheres-0/build_functions.bash
+++ b/paludis/repositories/e/ebuild/exheres-0/build_functions.bash
@@ -20,6 +20,57 @@
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place, Suite 330, Boston, MA 02111-1307 USA
+expatch()
+{
+ if [[ "${EBUILD_PHASE}" != "prepare" ]] ; then
+ die "epatch called in EBUILD_PHASE ${EBUILD_PHASE}"
+ fi
+
+ local recognise= patchlevel= options=() cmd=
+
+ if [[ ${1} == "--recognised-suffixes" ]]; then
+ recognise=true
+ shift
+ fi
+
+ while [[ $# -gt 0 ]]; do
+ if [[ ${1} == -p[0-9]* ]]; then
+ patchlevel="${1}"
+ elif [[ ${1} == -* ]]; then
+ options+=("${1}")
+ elif [[ -d ${1} ]]; then
+ expatch --recognised-suffixes ${patchlevel} "${options[@]}" "${1}"/*
+ else
+ case "${1}" in
+ *.bz2)
+ cmd="bzip2 -dc"
+ ;;
+ *.gz|*.Z|*.z)
+ cmd="gzip -dc"
+ ;;
+ *.zip|*.ZIP|*.jar)
+ cmd="unzip -p"
+ ;;
+ *.diff|*.patch)
+ cmd="cat"
+ ;;
+ *)
+ if [[ -n ${recognise} ]]; then
+ continue
+ else
+ cmd="cat"
+ fi
+ ;;
+ esac
+
+ echo "${cmd} ${1} | patch -s ${patchlevel:--p1} ${options[@]}" 1>&2
+ ${cmd} "${1}" | patch -s ${patchlevel:--p1} "${options[@]}" || \
+ die "patch -s ${patchlevel:--p1} ${options[@]} ${1} failed"
+ fi
+ shift
+ done
+}
+
econf()
{
if [[ "${EBUILD_PHASE}" != "configure" ]] ; then
diff --git a/paludis/repositories/e/ebuild/exheres-0/src_prepare.bash b/paludis/repositories/e/ebuild/exheres-0/src_prepare.bash
index be050b7..5b1eaa8 100644
--- a/paludis/repositories/e/ebuild/exheres-0/src_prepare.bash
+++ b/paludis/repositories/e/ebuild/exheres-0/src_prepare.bash
@@ -22,7 +22,9 @@
default_src_prepare()
{
- :
+ if [[ -n "${DEFAULT_SRC_PREPARE_PATCHES[@]}" ]]; then
+ expatch "${DEFAULT_SRC_PREPARE_PATCHES[@]}"
+ fi
}
src_prepare()