Patchwork apply-patches: run patch in batch mode

login
register
mail settings
Submitter Arnout Vandecappelle
Date Aug. 22, 2013, 5:44 a.m.
Message ID <1377150255-4940-1-git-send-email-arnout@mind.be>
Download mbox | patch
Permalink /patch/268960/
State Accepted
Commit 5871b791995ebe295db7dca608afe3f293ce8953
Headers show

Comments

Arnout Vandecappelle - Aug. 22, 2013, 5:44 a.m.
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.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
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(-)
Luca Ceresoli - Aug. 22, 2013, 8:09 a.m.
Arnout Vandecappelle (Essensium/Mind) wrote:
> 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/

> missing file, and return a non-zero exit code. So the build cleanly
> fails.
>
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

With that fixed:
Acked-by: Luca Ceresoli <luca@lucaceresoli.net>

Luca
Ralph Siemsen - Aug. 22, 2013, 7:13 p.m.
On Thu, Aug 22, 2013 at 07:44:15AM +0200, Arnout Vandecappelle (Essensium/Mind) wrote:

> 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
Arnout Vandecappelle - Aug. 22, 2013, 7:38 p.m.
On 22/08/13 21:13, Ralph Siemsen wrote:
> On Thu, Aug 22, 2013 at 07:44:15AM +0200, Arnout Vandecappelle (Essensium/Mind) wrote:
>
>> 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
Ralph Siemsen - Aug. 22, 2013, 7:43 p.m.
On Thu, Aug 22, 2013 at 09:38:58PM +0200, Arnout Vandecappelle wrote:
> 
>  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

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