Subject: Re: CVS commit: pkgsrc/pkgtools/pkg_rolling-replace
To: None <tech-pkg@netbsd.org>
From: Greg Troxel <gdt@ir.bbn.com>
List: tech-pkg
Date: 08/06/2007 16:22:25
The following makes 'make replace' clear the unsafe_depends and rebuild
tags.  This is slightly icky as it's in the replace-fixup-required-by
target, and maybe there should be a replace-fixup-installed-info target
that just does this.  But, somehow it seems appropriate in a
I-wish-we-had-transactions sense to remove the tags from this package
just after setting them on dependencies.

I've tested that tag 'foo' is preserved and rebuild is removed.  I'm
running a pkg_rr with the new 'remove tags' lines removed and it is
working (rather than infinite looping because the tags aren't going
away).

Is this ok to commit?  Should I make a new target instead?  Are there
conceptual objections?

--- replace.mk	04 Aug 2007 09:49:49 -0400	1.9
+++ replace.mk	06 Aug 2007 16:21:16 -0400	
@@ -137,14 +137,17 @@ replace-preserve-required-by: .PHONY
 ### replace-fixup-required-by (PRIVATE)
 ######################################################################
 ### replace-fixup-required-by fixes the +CONTENTS files of dependent
-### packages to refer to the replacement package.
-###
+### packages to refer to the replacement package.  It also removes
+### unsafe_depends* and rebuild tags from this package.
 replace-fixup-required-by: .PHONY
 	@${STEP_MSG} "Fixing @pkgdep entries in dependent packages."
 	${_PKG_SILENT}${_PKG_DEBUG}					\
 	set -e;								\
 	${TEST} -f ${_REPLACE_OLDNAME_FILE} || exit 0;			\
 	${TEST} -f ${_REPLACE_NEWNAME_FILE} || exit 0;			\
+	for var in unsafe_depends rebuild; do				\
+		${PKG_ADMIN} unset $$var ${PKGBASE};			\
+	done;								\
 	${TEST} -f ${_REQUIRED_BY_FILE} || exit 0;			\
 	oldname=`${CAT} ${_REPLACE_OLDNAME_FILE}`;			\
 	newname=`${CAT} ${_REPLACE_NEWNAME_FILE}`;			\