pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/flavor/pkg Repair regression in "make replace" in D...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/7d7751848e8e
branches:  trunk
changeset: 576472:7d7751848e8e
user:      gdt <gdt%pkgsrc.org@localhost>
date:      Sat Jun 12 00:53:43 2010 +0000

description:
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:

 mk/flavor/pkg/replace.mk |  15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diffs (37 lines):

diff -r 3147ca35e64d -r 7d7751848e8e mk/flavor/pkg/replace.mk
--- a/mk/flavor/pkg/replace.mk  Sat Jun 12 00:08:54 2010 +0000
+++ b/mk/flavor/pkg/replace.mk  Sat Jun 12 00:53:43 2010 +0000
@@ -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 @@
        ${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 \



Home | Main Index | Thread Index | Old Index