Subject: Re: pkgdiff -- tools for easier pkgsrc patch creation and maintenance
To: None <tech-pkg@netbsd.org, packages@netbsd.org>
From: Greg A. Woods <woods@weird.com>
List: tech-pkg
Date: 07/03/2000 21:44:23
[ On Saturday, July 1, 2000 at 04:43:04 (+0200), Thomas Klausner wrote: ]
> Subject: Re: pkgdiff -- tools for easier pkgsrc patch creation and maintenance
>
> pkgdiff in special is a shell script ;-)

Well, I'm glad to hear it's not a perl script, but I'm still wondering
why it's a separate script at all:

I've had the following in my version of mk/bsd.pkg.mk for some time
now.  It could be converted to the "patch-aa" style of naming, but since
I hate that style you won't convince me to do the conversion!  ;-)

makepatch:
	@${ECHO_MSG} "${_PKGSRC_IN}> Creating distribution patches for ${PKGNAME}"
	${_PKG_SILENT}${_PKG_DEBUG}PATCH_PREFIX="patches/patch-";		\
	PATCH_COUNTER=001;			\
	cd ${WRKSRC};				\
	find . -name '*.orig' -print |		\
		while read ORIG_FILE ; do	\
			set +e;			\
			${DIFF} -u $${ORIG_FILE} $$(dirname $${ORIG_FILE})/$$(basename $${ORIG_FILE} .orig) > ${.CURDIR}/$${PATCH_PREFIX}$$(printf "%03d\n" $${PATCH_COUNTER});	\
			PATCH_COUNTER=$$(expr $${PATCH_COUNTER} + 1);	\
		done

I did think of doing the RCS (and SCCS!) handling, but then I realised
that the WRKSRC directory gets trashed far more often than I'd want to
trash any RCS or SCCS history (even though that could be "hidden" by
putting the RCS or SCCS files in some other place) so I didn't bother.

Personally I'm still not even really that happy with having separate
patch files.  I'm now convinced they should be mushed all into one and
that separate files should only be used if an optional feature is added
by patching (eg. instead of just turning on a config option) or of
course if a patch is fetched from somewhere else.  This has the added
advantage that one can easily manage original package sources by simply
using the vendor-branch feature of CVS and then trivially create the
patch file with one "cvs patch" command.

-- 
							Greg A. Woods

+1 416 218-0098      VE3TCP      <gwoods@acm.org>      <robohack!woods>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>