bug-patch
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-patch] patch-2.7 forgets to rename backup to original, upon failure


From: Jim Meyering
Subject: [bug-patch] patch-2.7 forgets to rename backup to original, upon failure?
Date: Wed, 12 Sep 2012 22:11:11 +0200

This takes place on automake's "maint" branch:
commit 9c4ad6973eedb074a9381e14a6c1eeeb285c2465

It looks like when patch application fails, patch renames the
target to the backup name, FILE.~1~, but doesn't move it back,
appearing to remove the target:

    $ wc t/gettext-macros*
        105     567    3802 t/gettext-macros.sh
    ...
    $ patch -p1 < k
    patching file t/gettext-macros.sh
    Hunk #1 FAILED at 80.
    1 out of 1 hunk FAILED -- saving rejects to file t/gettext-macros.sh.rej
    [Exit 1]

Notice how now, the patched file is missing and the backup
file has the same size:

    $ wc t/gettext-macros*
         11      42     370 t/gettext-macros.sh.rej
        105     567    3802 t/gettext-macros.sh.~1~
    ...


Here is the contents of the file, "k":
--------------------
>From 73cc55ac3a3102ec02df88823ebb0ff650b25de7 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Wed, 12 Sep 2012 17:31:24 +0200
Subject: [PATCH] fix typos in mk-dirp.m4: s/AM_MKDIR_P/AM_PROG_MKDIR_P/

* t/gettext-macros.sh: Fix typo in name of macro emitted into
mk-dirp.m4: s/AM_MKDIR_P/AM_PROG_MKDIR_P/,
and as Stefano Lattarini noted, also fix this typo:
s/AC_MKDIR_P/AC_PROG_MKDIR_P/.
---
 t/gettext-macros.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/gettext-macros.sh b/t/gettext-macros.sh
index 1d94dad..cbc5565 100755
--- a/t/gettext-macros.sh
+++ b/t/gettext-macros.sh
@@ -80,7 +80,7 @@ echo "export ACLOCAL_PATH" >> get.sh

 # Even recent versions of gettext used the now-obsolete 'AM_PROG_MKDIR_P'
 # m4 macro.  So we need the following to avoid spurious errors.
-echo 'AC_DEFUN([AM_MKDIR_P], [AC_MKDIR_P(address@hidden)])' >> m4/mk-dirp.m4
+echo 'AC_DEFUN([AM_PROG_MKDIR_P], [AC_PROG_MKDIR_P(address@hidden)])' >> 
m4/mk-dirp.m4

 . ./get.sh

--
1.7.12.363.g53284de

--------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]