diff --git a/support/dependencies/dependencies.sh b/support/dependencies/dependencies.sh index 98469bd70c..891e234045 100755 --- a/support/dependencies/dependencies.sh +++ b/support/dependencies/dependencies.sh @@ -180,6 +180,12 @@ if test "${missing_progs}" = "yes" ; then exit 1 fi +# apply-patches.sh needs patch with --no-backup-if-mismatch support (GNU, busybox w/DESKTOP) +if ! patch --no-backup-if-mismatch </dev/null 2>/dev/null; then + echo "Your patch program does not support the --no-backup-if-mismatch option. Install GNU patch" + exit 1 +fi + if grep ^BR2_NEEDS_HOST_UTF8_LOCALE=y $BR2_CONFIG > /dev/null; then if ! which locale > /dev/null ; then echo diff --git a/support/scripts/apply-patches.sh b/support/scripts/apply-patches.sh index 66fef262ee..2d39d63da1 100755 --- a/support/scripts/apply-patches.sh +++ b/support/scripts/apply-patches.sh @@ -119,7 +119,7 @@ function apply_patch { exit 1 fi echo "${path}/${patch}" >> ${builddir}/.applied_patches_list - ${uncomp} "${path}/$patch" | patch -g0 -p1 -E -d "${builddir}" -t -N $silent + ${uncomp} "${path}/$patch" | patch -g0 -p1 -E --no-backup-if-mismatch -d "${builddir}" -t -N $silent if [ $? != 0 ] ; then echo "Patch failed! Please fix ${patch}!" exit 1 @@ -168,6 +168,3 @@ if [ "`find $builddir/ '(' -name '*.rej' -o -name '.*.rej' ')' -print`" ] ; then echo "Aborting. Reject files found." exit 1 fi - -# Remove backup files -find $builddir/ '(' -name '*.orig' -o -name '.*.orig' ')' -exec rm -f {} \;