Skip to contentSkip to conversation

apply-patches: run patch in batch mode

PATCH New Arnout Vandecappelle (Essensium/Mind) 4 participants 7 messages Aug 22, 2013 – Aug 27, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 apply-patches: run patch in batch mode

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' (dry-run) option to patch fixes this: it will skip the missing file, and return a non-zero exit code. So the build cleanly fails.

---
I actually discovered this during my allyesconfig night build, where I use make -k.

---
 support/scripts/apply-patches.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
support/scripts/apply-patches.sh +1 -1
index 2995ea9..e9c6869 100755
@@ -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
Signature · 1 line
1.8.4.rc3
#1 lore raw

PATCH 1/1 apply-patches: run patch in batch mode

Quoted 5 lines · Arnout Vandecappelle (Essensium/Mind)

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' (dry-run) option to patch fixes this: it will skip the

"dry-run"? Of course not. :)
s/dry-run/batch mode/

Quoted 4 lines

missing file, and return a non-zero exit code. So the build cleanly fails.

With that fixed:

Luca

#2 lore raw

PATCH 1/1 apply-patches: run patch in batch mode

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.

---
I actually discovered this during my allyesconfig night build, where I use make -k.

---
 support/scripts/apply-patches.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
support/scripts/apply-patches.sh +1 -1
index 2995ea9..e9c6869 100755
@@ -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
Signature · 1 line
1.8.4.rc3
#3 lore raw

PATCH 1/1 apply-patches: run patch in batch mode

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Arnout" == Arnout Vandecappelle (Essensium/Mind) <[email protected]> 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) <[email protected]> Arnout> Acked-by: Luca Ceresoli <[email protected]>
Arnout> ---
Arnout> I actually discovered this during my allyesconfig night build, where I Arnout> use make -k.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#4 lore raw

PATCH 1/1 apply-patches: run patch in batch mode

In reply to Arnout Vandecappelle (Essensium/Mind)
Quoted 3 lines · Arnout Vandecappelle (Essensium/Mind)

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.

Hi Arnout,

I believe you are seeing the same issue I reported recently. My solution was to test for the patch existence explicitly:
http://patchwork.ozlabs.org/patch/266895/

-Ralph

#5 lore raw

PATCH 1/1 apply-patches: run patch in batch mode

Quoted 11 lines · Ralph Siemsen
Quoted 3 lines · Arnout Vandecappelle (Essensium/Mind)

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.

Hi Arnout,

I believe you are seeing the same issue I reported recently. My solution was to test for the patch existence explicitly:
http://patchwork.ozlabs.org/patch/266895/

It's not the patch file that doesn't exist, but the file that should be
patched.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#6 lore raw

PATCH 1/1 apply-patches: run patch in batch mode

Quoted 3 lines · Arnout Vandecappelle

It's not the patch file that doesn't exist, but the file that
should be patched.

Oh I see what you mean. Yes, that could be an issue too. So I guess both issues should get patched ;-)

-Ralph