diff --git a/debian/changelog b/debian/changelog index 398a74ef..cae1b095 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,7 @@ +wine-staging (1.7.35) UNRELEASED; urgency=low + * Add support for Gentoo epatch backend to patchinstall.sh. + -- Sebastian Lackner Mon, 12 Jan 2015 13:06:22 +0100 + wine-staging (1.7.34-1) unstable; urgency=low * Debian/Ubuntu specific package dependency fix (no changes for other distros). -- Sebastian Lackner Sun, 11 Jan 2015 19:14:09 +0100 diff --git a/debian/tools/patchinstall.sh.in b/debian/tools/patchinstall.sh.in index c141f547..16566252 100644 --- a/debian/tools/patchinstall.sh.in +++ b/debian/tools/patchinstall.sh.in @@ -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 diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 6ebe543c..9930820a 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -668,6 +668,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 @@ -824,8 +841,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