summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorgdt <gdt@pkgsrc.org>2010-06-12 00:53:43 +0000
committergdt <gdt@pkgsrc.org>2010-06-12 00:53:43 +0000
commit4ee13608fd0d9110a36081896095868e864e1db7 (patch)
tree5b9ae9e8ff9c01719177cbf13faac39384dd571f /mk
parent0d871ed32ac5a3039a3d7c8415c5e6d1a3f6c913 (diff)
downloadpkgsrc-4ee13608fd0d9110a36081896095868e864e1db7.tar.gz
Repair regression in "make replace" in DESTDIR case.
"make replace" is defined to replace a package with a newer version, and update depdending packages to depend on the new version. It has long been understood that this is not always safe, with the responses being "tell people to be careful" and the unsafe_depends variable scheme and pkg_rolling-replace. In the DESTDIR case, make replace is implemented by pkg_add -U. Usually, this is fine - even if the ABI/shlib majors have changed, the package is replaced, and then a later make replace of unsafe_depends=YES packages, either manually or via pkg_rolling-replace, will bring the system to where it should be. However, there are pinned dependencies on osabi where the depending package will not accept the new version, and that causes pkg_add -U to fail. This is incorrect, as a) those packages don't depend on the osabi exact version any more than packages depending on jpeg depeend on the particular shlib major, yet jpeg dependencies aren't pinned. And, osabi changing version is not necessarily an ABI change - consider 5.0_STABLE just before 5.1RC1 and just after, where only the version string changed. Therefore, add -f to pkg_add -U so that the update will succeed.
Diffstat (limited to 'mk')
-rw-r--r--mk/flavor/pkg/replace.mk15
1 files changed, 12 insertions, 3 deletions
diff --git a/mk/flavor/pkg/replace.mk b/mk/flavor/pkg/replace.mk
index aa6b33d6395..7045d4162be 100644
--- a/mk/flavor/pkg/replace.mk
+++ b/mk/flavor/pkg/replace.mk
@@ -1,4 +1,4 @@
-# $NetBSD: replace.mk,v 1.28 2010/01/30 21:07:29 joerg Exp $
+# $NetBSD: replace.mk,v 1.29 2010/06/12 00:53:43 gdt Exp $
#
# _flavor-replace:
@@ -181,16 +181,25 @@ replace-clean: .PHONY
${RM} -f ${_REPLACE_OLDNAME_FILE} ${_REPLACE_NEWNAME_FILE} \
${_COOKIE.replace}
+# Logically we would like to do a "pkg_add -U". However, that fails
+# if there is a depending package that exactly depends on the package
+# being replaced. Historically, 'make replace' would replace a
+# package regardless of whether that broke depending packages
+# (typically due to shlib ABI changes, especially major version
+# bumps). Therefore, make replace in DESTDIR mode should behave the
+# same way. unsafe_depends will be set on depending packages, and
+# then those may be rebuilt via a manual process or by
+# pkg_rolling-replace.
replace-destdir: .PHONY
@${PHASE_MSG} "Updating using binary package of "${PKGNAME:Q}
.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
@${MKDIR} ${_CROSS_DESTDIR}${PREFIX}
- ${PKG_ADD} -U -m ${MACHINE_ARCH} -I -p ${_CROSS_DESTDIR}${PREFIX} ${PKGFILE}
+ ${PKG_ADD} -U -f -m ${MACHINE_ARCH} -I -p ${_CROSS_DESTDIR}${PREFIX} ${PKGFILE}
@${ECHO} "Fixing recorded cwd..."
@${SED} -e 's|@cwd ${_CROSS_DESTDIR}|@cwd |' ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS > ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS.tmp
@${MV} ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS.tmp ${_PKG_DBDIR}/${PKGNAME:Q}/+CONTENTS
.else
- ${PKG_ADD} -U ${PKGFILE}
+ ${PKG_ADD} -U -f ${PKGFILE}
.endif
${RUN}${_REPLACE_OLDNAME_CMD}; \
${PKG_INFO} -qR ${PKGNAME:Q} | while read pkg; do \