diff mbox

apply-patches: run patch in batch mode

Message ID 1377194533-22501-1-git-send-email-arnout@mind.be
State Accepted
Headers show

Commit Message

Arnout Vandecappelle Aug. 22, 2013, 6:02 p.m. UTC
If the file to be patched is missing, then `patch' will interactively
ask for a file to be patched. This is annoying in e.g. the autobuilders
because they have to wait for a timeout instead of failing.

Giving the '-t' (batch mode) option to patch fixes this: it will skip the
missing file, and return a non-zero exit code. So the build cleanly
fails.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Acked-by: Luca Ceresoli <luca@lucaceresoli.net>
---
I actually discovered this during my allyesconfig night build, where I
use make -k.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 support/scripts/apply-patches.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Peter Korsgaard Aug. 27, 2013, 8:30 p.m. UTC | #1
>>>>> "Arnout" == Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> writes:

 Arnout> If the file to be patched is missing, then `patch' will interactively
 Arnout> ask for a file to be patched. This is annoying in e.g. the autobuilders
 Arnout> because they have to wait for a timeout instead of failing.

 Arnout> Giving the '-t' (batch mode) option to patch fixes this: it will skip the
 Arnout> missing file, and return a non-zero exit code. So the build cleanly
 Arnout> fails.

 Arnout> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
 Arnout> Acked-by: Luca Ceresoli <luca@lucaceresoli.net>
 Arnout> ---
 Arnout> I actually discovered this during my allyesconfig night build, where I
 Arnout> use make -k.

Committed, thanks.
diff mbox

Patch

diff --git a/support/scripts/apply-patches.sh b/support/scripts/apply-patches.sh
index 2995ea9..e9c6869 100755
--- a/support/scripts/apply-patches.sh
+++ b/support/scripts/apply-patches.sh
@@ -80,7 +80,7 @@  function apply_patch {
     echo ""
     echo "Applying $patch using ${type}: "
 	echo $patch >> ${builddir}/.applied_patches_list
-    ${uncomp} "${path}/$patch" | patch -g0 -p1 -E -d "${builddir}"
+    ${uncomp} "${path}/$patch" | patch -g0 -p1 -E -d "${builddir}" -t
     if [ $? != 0 ] ; then
         echo "Patch failed!  Please fix ${patch}!"
 	exit 1