Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Apr 1997 12:04:58 +0200
From:      Ollivier Robert <roberto@keltia.freenix.fr>
To:        freebsd-bugs@freefall.freebsd.org
Subject:   Re: gnu/3176: `patch' creates files in wrong places (following Index)
Message-ID:  <19970403120458.33651@keltia.freenix.fr>
In-Reply-To: <19970403075144.ZT46473@uriah.heep.sax.de>; from J Wunsch on Thu, Apr 03, 1997 at 07:51:44AM %2B0200
References:  <199704022200.OAA27937@freefall.freebsd.org> <19970403015947.46958@keltia.freenix.fr> <19970403075144.ZT46473@uriah.heep.sax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
According to J Wunsch:
> > Why does our patch(1) apply the -p1 only for *new* files ? There is an
> > inconsistency in that.
> 
> It doesn't apply -p1 only to new files.

Our patch succeeds in patching existing files (i.e. it respects Index:
without applying -p1 to the file name) but fails in creating new files.

If you're in the directory base/ (important) and the diff contains

Index dir/foo/bar
--- base/dir/foo/bar.orig <date>
+++ base/dir/foo/bar <date>

It will succeed in patching dir/foo/bar.

*Now*, if you have

Index foo/bar
--- /dev/null <date>
+++ base/dir/foo/bar <date>

it will create foo/bar in the current directory, not in dir/foo/ !

I got this every time I tried to patch dev. versions of Perl with our
patch(1). It works as expected with GNU patch(1).

> This would surprise me mucho.  If you can show an inconsistency
> between new and existing files, go ahead.  As the PR stands, it only
> proved that Index: lines get precedence over other file names, and
> _this_ is a feature.

I know that and I agree. But the Index: treatment with respect to -p1 is
still a bug.

- take Perl5.003_90.tar.gz,
- extract it,
- cd perl5.003_90,
- get perl5.003_91.pat.gz, 
- do zcat perl5.003_91.pat.gz | sh,
- do zcat perl5.003_91.pat.gz | /usr/bin/patch -p1 -N (as recommended in .pat).
- ./Configure

and watch it telling you that you're missing some files...
-- 
Ollivier ROBERT -=- FreeBSD: There are no limits -=- roberto@keltia.freenix.fr
FreeBSD keltia.freenix.fr 3.0-CURRENT #41: Sun Mar 23 23:01:22 CET 1997



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19970403120458.33651>