diff mbox series

[04/20] patch: always backup files

Message ID f76141af430d49f702cd4d021c199ffa034fc458.1700010290.git.ehem+openwrt@m5p.com
State Not Applicable
Delegated to: Petr Štetiar
Headers show
Series Kernel build fixups, split object directory off (partial WIP) | expand

Commit Message

Elliott Mitchell Nov. 15, 2023, 1:04 a.m. UTC
Date: Thu, 26 Oct 2023 18:44:33 -0700

Avoiding modification of the original files allows their reuse.
This is a first step towards being able to reuse unpacked kernel
(or other) source.

Signed-off-by: Elliott Mitchell <ehem+openwrt@m5p.com>
---
 include/autotools.mk    | 2 +-
 scripts/patch-kernel.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/include/autotools.mk b/include/autotools.mk
index d0e4b3642f..53e8a0d6e6 100644
--- a/include/autotools.mk
+++ b/include/autotools.mk
@@ -61,7 +61,7 @@  define patch_libtool
 			lt_version="$$$$($$(STAGING_DIR_HOST)/bin/sed -ne 's,^[[:space:]]*VERSION="\?\([0-9]\.[0-9]\+\).*,\1,p' $$$$lt)"; \
 			case "$$$$lt_version" in \
 				1.5|2.2|2.4) echo "autotools.mk: Found libtool v$$$$lt_version - applying patch to $$$$lt"; \
-					(cd $$$$(dirname $$$$lt) && $$(PATCH) -N -s -p1 < $$(TOPDIR)/tools/libtool/files/libtool-v$$$$lt_version.patch || true) ;; \
+					(cd $$$$(dirname $$$$lt) && $$(PATCH) -b -N -s -p1 < $$(TOPDIR)/tools/libtool/files/libtool-v$$$$lt_version.patch || true) ;; \
 				*) echo "autotools.mk: error: Unsupported libtool version v$$$$lt_version - cannot patch $$$$lt"; exit 1 ;; \
 			esac; \
 		done; \
diff --git a/scripts/patch-kernel.sh b/scripts/patch-kernel.sh
index c2b7e72049..d3f1042343 100755
--- a/scripts/patch-kernel.sh
+++ b/scripts/patch-kernel.sh
@@ -37,7 +37,7 @@  for i in ${patchdir}/${patchpattern} ; do
     [ -d "${i}" ] && echo "Ignoring subdirectory ${i}" && continue	
     echo ""
     echo "Applying ${i} using ${type}: " 
-    ${uncomp} ${i} | ${PATCH:-patch} -f -p1 -d ${targetdir}
+    ${uncomp} ${i} | ${PATCH:-patch} -b -f -p1 -d ${targetdir}
     if [ $? != 0 ] ; then
         echo "Patch failed!  Please fix $i!"
 	exit 1