diff --git a/debian/tools/patchinstall.sh.in b/debian/tools/patchinstall.sh.in index b7f09498..64a34926 100644 --- a/debian/tools/patchinstall.sh.in +++ b/debian/tools/patchinstall.sh.in @@ -30,15 +30,16 @@ usage() echo "using a Makefile." echo "" echo "Configuration:" - echo " DESTDIR=path Specify the path to the wine source tree" - echo " --all Select all patches" - echo " --help Display this help and exit" - echo " --no-autoupdate Do not apply patchlist and don't auto-update files" - echo " -W patchset Exclude a specific patchset" + echo " DESTDIR=path Specify the path to the wine source tree" + echo " --all Select all patches" + echo " --help Display this help and exit" + echo " --no-autoupdate Do not apply patchlist and don't auto-update files" + echo " -W patchset Exclude a specific patchset" echo "" echo "Backends:" - echo " --backend=patch Use regular 'patch' utility to apply patches (default)" - echo " --backend=git Use 'git am' to apply patches" + echo " --backend=patch Use regular 'patch' utility to apply patches (default)" + echo " --backend=git-am Use 'git am' to apply patches" + echo " --backend=git-apply Use 'git apply' to apply patches" echo "" }} @@ -126,7 +127,7 @@ if [ "$backend" == "patch" ]; then }} # GIT backend - apply patches using 'git am' -elif [ "$backend" == "git" ]; then +elif [ "$backend" == "git" -o "$backend" == "git-am" ]; then patch_apply () {{ @@ -136,6 +137,17 @@ elif [ "$backend" == "git" ]; then fi }} +# Git apply backend +elif [ "$backend" == "git-apply" ]; then + + patch_apply () + {{ + echo "Applying $1" + if ! cat "$1" | (cd "$DESTDIR" && git apply); then + abort "Failed to apply patch, aborting!" + fi + }} + # Stacked GIT backend - import the patches (mainly for developers) elif [ "$backend" == "stg" ]; then diff --git a/patches/Makefile b/patches/Makefile index d2eab00b..ac9c4228 100644 --- a/patches/Makefile +++ b/patches/Makefile @@ -13,7 +13,7 @@ install: .PHONY: install-git install-git: @echo "WARNING: Using this Makefile is deprecated!" >&2 - "$(CURDIR)/patchinstall.sh" DESTDIR="$(DESTDIR)" --all --backend=git + "$(CURDIR)/patchinstall.sh" DESTDIR="$(DESTDIR)" --all --backend=git-am .PHONY: series series: diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 649c0252..53c6fe41 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -30,15 +30,16 @@ usage() echo "using a Makefile." echo "" echo "Configuration:" - echo " DESTDIR=path Specify the path to the wine source tree" - echo " --all Select all patches" - echo " --help Display this help and exit" - echo " --no-autoupdate Do not apply patchlist and don't auto-update files" - echo " -W patchset Exclude a specific patchset" + echo " DESTDIR=path Specify the path to the wine source tree" + echo " --all Select all patches" + echo " --help Display this help and exit" + echo " --no-autoupdate Do not apply patchlist and don't auto-update files" + echo " -W patchset Exclude a specific patchset" echo "" echo "Backends:" - echo " --backend=patch Use regular 'patch' utility to apply patches (default)" - echo " --backend=git Use 'git am' to apply patches" + echo " --backend=patch Use regular 'patch' utility to apply patches (default)" + echo " --backend=git-am Use 'git am' to apply patches" + echo " --backend=git-apply Use 'git apply' to apply patches" echo "" } @@ -668,7 +669,7 @@ if [ "$backend" == "patch" ]; then } # GIT backend - apply patches using 'git am' -elif [ "$backend" == "git" ]; then +elif [ "$backend" == "git" -o "$backend" == "git-am" ]; then patch_apply () { @@ -678,6 +679,17 @@ elif [ "$backend" == "git" ]; then fi } +# Git apply backend +elif [ "$backend" == "git-apply" ]; then + + patch_apply () + { + echo "Applying $1" + if ! cat "$1" | (cd "$DESTDIR" && git apply); then + abort "Failed to apply patch, aborting!" + fi + } + # Stacked GIT backend - import the patches (mainly for developers) elif [ "$backend" == "stg" ]; then