Re: What to do when new version available upstream...
On Sat, Mar 06, 1999 at 09:41:35AM +0000, Jules Bean wrote:
> > > > I usually extract the new one (or apply a patch if that is the method),
> > > > gunzip -dc old_version.diff.gz > somefile, then edit that 'somefile' and
> > > > replace all instances of progdirectory-1.2.0 with progdirectory-1.2.1.
> > > > Then apply that new diff with patch -p0 < somefile. And then clean up the
> > > > .rej and .orig files and apply the missing stuff manually.
> > >
> > > The editing isn't necessary.
> > >
> > > Simply patch -p1 < somefile and it will ignore the first directory
> > > component (the versioned directory).
> > >
> > I never had the guts to do that. What happens if the upstream author heavily modifed
> > a file that is modified in your diff? I guess patch is supposed
> > to be smart, but is this failsafe?
> If patch gets confused, it won't apply that patch.
> Sometime's you'll have to work out what's going on by hand. It's fairly
> subjective whether it's more hassle to evaluate the patches one-by-one,
> and apply those still relevant, or to apply them all and then evaluate
To be more precise, patch will apply hunks that he can - and those
that it doesn't manage, will save in <patchedfilename>.rej file.
Also, if it has any problems with patching (that includes the 'fuzz',
offset of lines), it'll save the original file in <patchedfilename>.orig.
I see no way you can lose data. Except if the patch is not malformed,
but simply wrong :)
BTW Jules, I've tried the -p1 method, it works very well. Thanks for
enJoy -*/\*- http://jagor.srce.hr/~jrodin/