Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Jan 1998 21:01:52 +0300 (MSK)
From:      Dmitrij Tejblum <tejblum@arc.hq.cti.ru>
To:        =?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?= <ache@nagual.pp.ru>
Cc:        freebsd-ports@FreeBSD.ORG, committers@FreeBSD.ORG, dima@tejblum.dnttm.rssi.ru
Subject:   Re: amanda port, empty PATCH_STRIP= lines causes trouble
Message-ID:  <Pine.BSF.3.95.980119201003.18773A-100000@yandex.hq.cti.ru>
In-Reply-To: <Pine.BSF.3.96.980119150828.18158A-100000@lsd.relcom.eu.net>

next in thread | previous in thread | raw e-mail | index | archive | help

On 19 Jan 1998, Андрей Чернов wrote:

> On Mon, 19 Jan 1998, Dmitrij Tejblum wrote:
> 
> > [CC list trimmed]
> > 
> > Андрей Чернов wrote:
> > >                                                I repeat (already many
> > > times) that both new and old patch handle Index:  equally. 
> > 
> > I don't believe it. From src/contrib/patch/NEWS:
> > 
> > Changes in version 2.4:
> > [...]
> > * The method used to intuit names of files to be patched is changed again:
> >   `Index:' lines are normally ignored for context diffs,
> > [...]
> 
> Better check than spread rumors, don't be lazy and run some tests at
> least.  To be precise I mean "the stuff related to Index: lines" handled
> equally in 2.1 and 2.5 patch versions. I mean _original_ GNU versions,
> not modified in FreeBSD.

I assume latest -stable version is already OK? 

Well, I sit now at -stable with especially updated patch, and run some
test. I use standard CVS from 2.2 here, with broken cvs diff. See:

Script started on Mon Jan 19 20:15:59 1998
tejblum@arc|/mnt/arc/usr/room/arcadia/ysite$ cvs diff -u yandex/index.cpp > index.ccp.diff
tejblum@arc|/mnt/arc/usr/room/arcadia/ysite$ rm yandex/index.cpp
tejblum@arc|/mnt/arc/usr/room/arcadia/ysite$ cvs upd yandex
cvs update: Updating yandex
M yandex/Makefile
cvs update: warning: yandex/index.cpp was lost
U yandex/index.cpp
cvs update: Updating yandex/request
tejblum@arc|/mnt/arc/usr/room/arcadia/ysite$ patch < index.cpp.diff
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: yandex/index.cpp
|===================================================================
|RCS file: /usr/room/arcadia/CVSROOT/arcadia/ysite/yandex/index.cpp,v
|retrieving revision 1.39
|diff -u -r1.39 index.cpp
|--- index.cpp	1997/12/05 19:47:05	1.39
|+++ index.cpp	1998/01/19 17:07:11
--------------------------
Patching file yandex/index.cpp using Plan A...
Hunk #1 succeeded at 168.
Hunk #2 succeeded at 193.
Hunk #3 succeeded at 204.
Hunk #4 succeeded at 229.
Hunk #5 succeeded at 250.
Hunk #6 succeeded at 261.
Hunk #7 succeeded at 277.
Hunk #8 succeeded at 335.
Hunk #9 succeeded at 367.
Hunk #10 succeeded at 446.
Hunk #11 succeeded at 485.
Hunk #12 succeeded at 1088.
Hunk #13 succeeded at 1103.
Hunk #14 succeeded at 1180.
done
tejblum@arc|/mnt/arc/usr/room/arcadia/ysite$ exit

Script done on Mon Jan 19 20:17:02 1998

Note that there is no index.cpp in current directory, and patch was
applied to the right file yandex/index.cpp.

Indeed, in old patch context diff header (i.e. "***" and "---" lines)
takes precedence over an Index: line. But new patch simple *ignore*
Index: line, unless POSIXLY_CORRECT environment variable is set. 
Here is a test that "proves" it:

tejblum@ywsearch|~$ patch -p0 < index.cpp.diff 
can't find file to patch at input line 8
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: yandex/index.cpp
|===================================================================
|RCS file: /usr/room/arcadia/CVSROOT/arcadia/ysite/yandex/index.cpp,v
|retrieving revision 1.39
|diff -u -r1.39 index.cpp
|--- index.cpp  1997/12/05 19:47:05     1.39
|+++ index.cpp  1998/01/19 17:07:11
--------------------------
File to patch: ^C
tejblum@ywsearch|~$ POSIXLY_CORRECT=yes patch -p0 < index.cpp.diff 
patching file `yandex/index.cpp'
tejblum@ywsearch|~$ 

I think, make patch more POSIX compliant in this case would be not so bad
idea.

Dima





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.980119201003.18773A-100000>