bug-cvs
[Top][All Lists]
Advanced

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

Re: Bug in patch 2.5.4 or its documentation


From: Derek R. Price
Subject: Re: Bug in patch 2.5.4 or its documentation
Date: Thu, 08 Feb 2001 15:16:44 -0500

"Derek R. Price" wrote:

> As near as I can read the man page, files should be created by patch if the
> original is listed as /dev/null or is empty and has a creation time of the 
> Epoch
> (1970-01-01  00:00:00  UTC), regardless of whether --posix has been specified 
> (it
> claims --posix will cause patch to conform to the POSIX.2 specification).
>
> Depending on the POSIX.2 specification, which I don't have access to, this
> appears to be either a documentation or an implementation bug.

Okay, this doesn't quite solve our immediate problem though.

Who else implements patch?  From the documentation I can find so far, I suspect 
most
implementations should be able to handle the change I am proposing (namely,
inserting the correct relative path to files on the appropriate diff header 
lines
for context and unified diff).  In fact, as according to the patch man page I am
reading the POSIX standard is to ignore all lines but the Index: line and the
"traditional" standard is to read the path from the header, this fix should 
almost
certainly make a CVS diff more portable.

The patch that comes with my NetBSD system, calling itself "Patch version 2.0, 
patch
level 12u8", and blaming only Larry Wall and "other contributors" for its 
existance,
has no --posix option and still interprets a CVS diff incorrectly (expecting all
affected files in the cwd).  The man page, in fact specifies that it prefers 
header
file paths to Index: file paths and that if it has more than one path to choose 
from
it will choose the "shortest".

"Patch version 2.1" on my FreeBSD, with Larry Wall and contributors to blame 
also,
claims the same operation as Patch 2.0, above, on its man page, yet gets almost
everything right, except when two files have the same name in the current 
directory
and the subdirectory, in which case it attempts to make the modifications to the
file in the current directory.

The exact same CVS generated diff, but with subdir names inserted on the three
header lines as well as the Index: line, works with all three versions of 
patch, and
with no additional options passed to patch (not even -p0), to boot.  In --posix
mode, this patch breaks GNU patch 2.5.4 as before, and with '--posix -p0' 
specified,
works except for the new file creation - an error which seems to be either a 
bug in
the implementation or the POSIX specification anyhow (and it is looking for the 
new
file in the correct place - it just can't find it - duh!).

Comments?  Objections?  Ideas on where I can find another FM to R?

Derek

--
Derek Price                      CVS Solutions Architect ( http://CVSHome.org )
mailto:dprice@openavenue.com     OpenAvenue ( http://OpenAvenue.com )
--
Man [is] a rational animal, endowed by nature with rights and with an innate
sense of justice.
                        - Thomas Jefferson to W. Johnson, 1823






reply via email to

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