Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Jul 2000 13:44:11 -0400 (EDT)
From:      Trevor Johnson <trevor@jpj.net>
To:        Will Andrews <andrews@technologist.com>
Cc:        Satoshi Asami <asami@FreeBSD.ORG>, ports@FreeBSD.ORG
Subject:   Re: proposal:  update-patches
Message-ID:  <Pine.BSI.4.21.0007111207520.4848-100000@blues.jpj.net>
In-Reply-To: <20000630134435.B45643@argon.gryphonsoft.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 30 Jun 2000, Will Andrews wrote:

> I'm pretty sure that NetBSD's recently-imported pkgdiff does pretty much
> the same thing, with perhaps a slightly different approach:
> 
>         http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/pkgtools/pkgdiff/

I didn't find any mention of pkgdiff in

Searching the FreeBSD Gnats system (including closed PRs), my copy of the
FreeBSD sources, and my old ports@freebsd.org e-mail, I didn't find any
mention of pkgdiff, so I'm guessing you mean it was recently imported into
NetBSD (especially since you directed me to the NetBSD CVS Web site), not
into FreeBSD.  On my NetBSD box (which dates from March except that
/usr/src/pkgsrc/ is from 1 July), I installed the pkgdiff package and gave
the "mkpatches" and "patchdiff" commands--which seem to be the analogues
to my proposal--a quick try.

Suppose you need to patch foo.c.  OpenBSD's update-patches will check in
patches/ for a patch to that file.  If it finds one, it will rename the
old patch, adding the .orig extension, and save the new patch in place of
the old one (that is, with the same name).  If it does not find an
existing patch, it will generate patches/patch-foo_c.  NetBSD's mkpatches
will generate patches in work/.newpatches/ named patch-aa and so on.  The
names of the patches are unrelated to the names of any existing patches.  
If there were existing patches, the porter can then run patchdiff, which
will identify which patches in work/.newpatches/ match ones in patches/
and display the differences (and names of the changed files).  The porter
then is likely to want to move any patches which have changed out of
work/.newpatches/ into patches/, changing their names if they replace an
existing patch.  With the OpenBSD system, the porter can compare the old
and new patches by keeping a copy of the old patches/ (which I ordinarily
do as a matter of course), removing the *.orig files from the updated
patches/, and doing a recursive diff.  Admittedly, the patchdiff output is
easier to interpret because it mentions the names of the changed files.  
Unless something goes wrong, no moving/renaming is necessary with
update-patches.

Suppose that foo.c used to need a patch, then no longer did, and now needs
one once again.  With OpenBSD's update-patches, the new patch is
automatically named patch-foo_c.  If update-patches was used from the
beginning, the old patch would have had the same name.  IMO when peeking
at the CVS repository this looks better than seeing a patch-aa,v which
modified bar.c, then was retired, and now modifies foo.c.  The patch-aa
naming convention is completely uninformative and I see no advantage to it
(the ports collection already has many filenames which are illegal on
Minix or DOS, or a CD-ROM with DOS-compatible names).

In summary, update-patches seems more thoroughly automated, so more
convenient.  It is an (IMO welcome) step away from the patch-aa
convention, while remaining compatible with it.  It works in favor of
patches having a sensible history in the CVS repository.  NetBSD's
patchdiff looks handy, but the need for it is much less when using
update-patches.
--
Trevor Johnson
http://jpj.net/~trevor/gpgkey.txt



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




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