Sorry, but I disagree and think this is a bug in Debian 11, GNU patch 2.7.6. -b forces a backup file, and the manual says of "-V existing":

Make numbered backups of files that already have them, otherwise simple backups. This is the default.

This example shows that the first patch application creates a backup file, and the second patch application overwrites it and does not instead create a numbered file:

    $ echo 1 > a
    $ cp a b
    $ echo 2 >> b
    $ diff a b > diff1
    $ patch -b -V existing a < diff1
    patching file a
    $ ls -C
    a  a.orig  b  diff1  diff2
    $ echo 3 >> b
    $ diff a b > diff2
    $ patch -b -V existing a < diff2
    patching file a
    $ ls -C
    a  a.orig  b  diff1  diff2
    $ cat a.orig
    1
    2

--
Bruce Momjian  <br...@momjian.us>        http://momjian.us
EDB                                      http://enterprisedb.com

Reply via email to