Add support for Gentoo epatch backend to patchinstall.sh.

This commit is contained in:
Sebastian Lackner
2015-01-12 13:10:19 +01:00
parent 17c1053de4
commit 7d9c7855c2
3 changed files with 50 additions and 4 deletions

View File

@@ -126,6 +126,23 @@ if test "$backend" = "patch"; then
fi
}}
# 'epatch' backend - used on Gentoo
elif test "$backend" = "epatch"; then
patch_apply ()
{{
if grep -q "^GIT binary patch" "$1"; then
if ! ../debian/tools/gitapply.sh -d "$DESTDIR" < "$1"; then
abort "Failed to apply patch, aborting!"
fi
else
local patch="$(readlink -f "$1")"
if ! (cd "$DESTDIR" && epatch "$patch"); then
abort "Failed to apply patch, aborting!"
fi
fi
}}
# GIT backend - apply patches using 'git am'
elif test "$backend" = "git" -o "$backend" = "git-am"; then
@@ -181,8 +198,12 @@ fi
# To make sure we find all the patches and tools switch to the patches directory now
script="$(readlink -f "$0")"
curdir="$(dirname "$script")"
if ! cd "$curdir"; then
abort "Failed to change working directory to $curdir."
if test -f "$curdir/patchinstall.sh"; then
if ! cd "$curdir"; then
abort "Failed to change working directory to $curdir."
fi
elif test ! -f ./patchinstall.sh; then
abort "Failed to find patch directory."
fi
# If autoupdate is enabled then create a tempfile to keep track of all patches