apply-patches.sh: remove any rejects before applying patches
authorLudovic Desroches <ludovic.desroches@atmel.com>
Wed, 14 Mar 2012 15:33:52 +0000 (16:33 +0100)
committerPeter Korsgaard <jacmet@sunsite.dk>
Wed, 14 Mar 2012 22:28:57 +0000 (23:28 +0100)
[Peter: .rej files might be in subdirs, so just do find .. | xargs rm]
Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Tested-by: Ludovic Desroches <ludovic.desroches@atmel.com>
with an armadeus_apf9328_defconfig build
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
support/scripts/apply-patches.sh

index 1aef47ebf78b725294a50c02c51c4b1bbfa8e358..e418cb6ec0bfff810097bcd9f4f2a21e1428e041 100755 (executable)
@@ -19,7 +19,13 @@ if [ ! -d "${patchdir}" ] ; then
     echo "Aborting.  '${patchdir}' is not a directory."
     exit 1
 fi
-    
+
+# Remove any rejects present BEFORE patching - Because if there are
+# any, even if patches are well applied, at the end it will complain
+# about rejects in targetdir.
+find ${targetdir}/ '(' -name '*.rej' -o -name '.*.rej' ')' -print0 | \
+    xargs -0 -r rm -f
+
 for i in `cd ${patchdir}; ls -d ${patchpattern} 2> /dev/null` ; do 
     apply="patch -g0 -p1 -E -d"
     uncomp_parm=""