scripts/unpack: use git apply whenever patch includes a renamed file

This commit is contained in:
MilhouseVH 2017-08-30 07:26:21 +01:00
parent c6213ec05d
commit 096310f125

View File

@ -173,7 +173,7 @@ if [ -d "$SOURCES/$1" -o -d "$PKG_DIR/sources" ]; then
if [ -f "$i" ]; then
printf "%${BUILD_INDENT}c $(print_color CLR_APPLY_PATCH "APPLY PATCH") $(print_color CLR_PATCH_DESC "${PATCH_DESC}") ${i#$ROOT/}\n" ' '>&$SILENT_OUT
if [ -n "$(grep -E '^GIT binary patch$' $i)" ]; then
if grep -qE '^GIT binary patch$|^rename from|^rename to' $i; then
cat $i | git apply --directory=`echo "$PKG_BUILD" | cut -f1 -d\ ` -p1 --verbose --whitespace=nowarn --unsafe-paths >&$VERBOSE_OUT
else
cat $i | patch -d `echo "$PKG_BUILD" | cut -f1 -d\ ` -p1 >&$VERBOSE_OUT