Skip to content

Commit

Permalink
do_patch(): use git apply ... as alternative to patch
Browse files Browse the repository at this point in the history
Since patch does not support binary patches, we try to use
git apply ... instead
  • Loading branch information
mkreisl committed Aug 4, 2018
1 parent 8d292a5 commit 1448149
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions build.package
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,15 @@ do_patch()
(
cd ../build/$dir/working
[ $use_silent = yes ] || echo "checking $p"
if ! patch -p1 --dry-run -F $config_patch_fuzzy < ../../../patches/$p >/dev/null; then
if patch -p1 --dry-run -F $config_patch_fuzzy < ../../../patches/$p >/dev/null; then
[ $use_silent = yes ] || echo "Patching with $p"
do_run patch -p1 -F $config_patch_fuzzy < ../../../patches/$p
elif git apply --check < ../../../patches/$p >/dev/null; then
[ $use_silent = yes ] || echo "Patching (git apply) with $p"
do_run git apply --whitespace=nowarn < ../../../patches/$p >/dev/null
else
echo "! won't patch with $p" >/dev/stderr
continue
fi
[ $use_silent = yes ] || echo "Patching with $p"
do_run patch -p1 -F $config_patch_fuzzy < ../../../patches/$p
echo "-----------------"
)
done
Expand Down

0 comments on commit 1448149

Please sign in to comment.