tech-pkg archive

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

Re: CVS commit: pkgsrc/mk/flavor/pkg



Joerg Sonnenberger <joerg%britannica.bec.de@localhost> writes:

> On Wed, Jun 16, 2010 at 03:15:05PM +0000, Greg Troxel wrote:
>> Log Message:
>> Adjust workaround for make replace in destdir case.  Use of -f is of
>> course a too-large hammer, but in addition to overriding checks it
>> appears to change behavior in some cases when no overrides are
>> necessary.  Therefore, use pkg_add -U as before first, and only try -f
>> if that fails.  (This is temporary and should be replaced by -D to
>> omit only the exact depends check as soon as that's in tree.)
>
> Ignoring everything else, this still breaks in the not-so-rare case of
> the a file moving up the dependency change. Can we please just restore
> the original behavior, which does the correct thing? I don't care much
> about the osabi depency, though it should arguable honour ABI_DEPENDS.

The original behavior was not right, because make replace of a package
with exact dependencies failed, when it should succeed.

I've sent a patch to add -D to pkg_add, which simply acts like 2% of -f,
overriding only the exact dependency check.  I have received a number of
small comments about the patch (missing break, avoiding changing the
version in the man page), which I've addressed.  One person also
questioned depending on the new version, but the dependency is only in
the case of doing make replace with destdir, which is exactly when it's
needed.  Trying to put myself in the shoes of a normal user who uses
pkg_rolling-replace, I'm quite sure they'd want this.

I believe that the patch is very safe, in that there should be no
different behavior for any invocation which does not include -D.

(This is the combined patch which adds -D, increases the required
version for replace/destdir, and uses -D in make replace in the destdir
case, separated by spaces.  I would commmit it in two chunks.  This
follows that I proposed a few days ago on tech-pkg.)

Other than that you would prefer that people not have packages installed
with unsatisified dependencies, do you see any problems with the
"pkg_add -D" patch?


Index: pkgtools/pkg_install/files/add/add.h
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/pkg_install/files/add/add.h,v
retrieving revision 1.18
diff -u -p -r1.18 add.h
--- pkgtools/pkg_install/files/add/add.h        30 Jan 2010 20:09:34 -0000      
1.18
+++ pkgtools/pkg_install/files/add/add.h        16 Jun 2010 17:42:29 -0000
@@ -40,6 +40,7 @@ extern int Replace;
 extern int ReplaceSame;
 
 extern Boolean ForceDepends;
+extern Boolean ForceDepending;
 
 int     make_hierarchy(char *);
 void    apply_perms(char *, char **, int);
Index: pkgtools/pkg_install/files/add/main.c
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/pkg_install/files/add/main.c,v
retrieving revision 1.25
diff -u -p -r1.25 main.c
--- pkgtools/pkg_install/files/add/main.c       18 Feb 2010 13:43:11 -0000      
1.25
+++ pkgtools/pkg_install/files/add/main.c       16 Jun 2010 17:42:29 -0000
@@ -39,7 +39,7 @@ __RCSID("$NetBSD: main.c,v 1.25 2010/02/
 #include "lib.h"
 #include "add.h"
 
-static char Options[] = "AIK:LP:RVW:fhm:np:t:Uuvw:";
+static char Options[] = "ADIK:LP:RVW:fhm:np:t:Uuvw:";
 
 char   *Destdir = NULL;
 char   *OverrideMachine = NULL;
@@ -51,6 +51,12 @@ Boolean NoInstall = FALSE;
 Boolean NoRecord = FALSE;
 Boolean Automatic = FALSE;
 Boolean ForceDepends = FALSE;
+/*
+ * Normally, updating fails if the dependencies of a depending package
+ * are not satisfied by the package to be updated.  ForceDepending
+ * turns that failure into a warning.
+ */
+Boolean ForceDepending = FALSE;
 
 int    LicenseCheck = 0;
 int     Replace = 0;
@@ -82,7 +88,12 @@ main(int argc, char **argv)
 
                case 'C':
                        config_file = optarg;
+                       break;
 
+               case 'D':
+                       ForceDepending = TRUE;
+                       break;
+                       
                case 'P':
                        Destdir = optarg;
                        break;
@@ -90,6 +101,7 @@ main(int argc, char **argv)
                case 'f':
                        Force = TRUE;
                        ForceDepends = TRUE;
+                       ForceDepending = TRUE;
                        break;
 
                case 'I':
Index: pkgtools/pkg_install/files/add/perform.c
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/pkg_install/files/add/perform.c,v
retrieving revision 1.96
diff -u -p -r1.96 perform.c
--- pkgtools/pkg_install/files/add/perform.c    14 Apr 2010 18:24:58 -0000      
1.96
+++ pkgtools/pkg_install/files/add/perform.c    16 Jun 2010 17:42:29 -0000
@@ -458,7 +458,7 @@ check_other_installed(struct pkg_task *p
                                continue; /* Both match, ok. */
                        warnx("Dependency of %s fulfilled by %s, but not by %s",
                            iter, pkg->other_version, pkg->pkgname);
-                       if (!Force)
+                       if (!ForceDepending)
                                status = -1;
                        break;
                }
Index: pkgtools/pkg_install/files/add/pkg_add.1
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/pkg_install/files/add/pkg_add.1,v
retrieving revision 1.43
diff -u -p -r1.43 pkg_add.1
--- pkgtools/pkg_install/files/add/pkg_add.1    18 Feb 2010 13:43:11 -0000      
1.43
+++ pkgtools/pkg_install/files/add/pkg_add.1    16 Jun 2010 17:42:29 -0000
@@ -125,6 +125,11 @@ will still try to find and auto-install 
 a failure to find one will not be fatal.
 This flag also overrides the fatal error when the operating system or
 architecture the package was built on differ from that of the host.
+.It Fl D
+Force updating even if the dependencies of depending packages are not
+satisfied by the new package.
+This is used by "make replace", after which one would typically
+replace the depending packages.
 .It Fl I
 If an installation script exists for a given package, do not execute it.
 .It Fl K Ar pkg_dbdir
Index: pkgtools/pkg_install/files/add/pkg_add.cat
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/pkg_install/files/add/pkg_add.cat,v
retrieving revision 1.3
diff -u -p -r1.3 pkg_add.cat
--- pkgtools/pkg_install/files/add/pkg_add.cat  18 Feb 2010 13:43:47 -0000      
1.3
+++ pkgtools/pkg_install/files/add/pkg_add.cat  16 Jun 2010 17:42:29 -0000
@@ -60,6 +60,11 @@ OOPPTTIIOONNSS
              rides the fatal error when the operating system or architecture
              the package was built on differ from that of the host.
 
+     --DD      Force updating even if the dependencies of depending packages 
are
+             not satisfied by the new package.  This is used by "make
+             replace", after which one would typically replace the depending
+             packages.
+
      --II      If an installation script exists for a given package, do not 
exe-
              cute it.
 
Index: pkgtools/pkg_install/files/lib/version.h
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/pkg_install/files/lib/version.h,v
retrieving revision 1.155
diff -u -p -r1.155 version.h
--- pkgtools/pkg_install/files/lib/version.h    20 Apr 2010 21:22:38 -0000      
1.155
+++ pkgtools/pkg_install/files/lib/version.h    16 Jun 2010 17:42:29 -0000
@@ -27,6 +27,6 @@
 #ifndef _INST_LIB_VERSION_H_
 #define _INST_LIB_VERSION_H_
 
-#define PKGTOOLS_VERSION 20100421
+#define PKGTOOLS_VERSION 20100615
 
 #endif /* _INST_LIB_VERSION_H_ */


Index: mk/flavor/pkg/flavor-vars.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/flavor/pkg/flavor-vars.mk,v
retrieving revision 1.15
diff -u -p -r1.15 flavor-vars.mk
--- mk/flavor/pkg/flavor-vars.mk        19 Feb 2010 14:27:36 -0000      1.15
+++ mk/flavor/pkg/flavor-vars.mk        16 Jun 2010 17:42:29 -0000
@@ -37,7 +37,7 @@ LINKFARM_CMD?=                ${PKG_TOOLS_BIN}/linkfar
 
 # Latest versions of tools required for correct pkgsrc operation.
 .if make(replace) && ${_USE_DESTDIR} != "no"
-PKGTOOLS_REQD=         20100130
+PKGTOOLS_REQD=         20100615
 .else
 PKGTOOLS_REQD=         20090528
 .endif

Index: mk/flavor/pkg/replace.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/flavor/pkg/replace.mk,v
retrieving revision 1.30
diff -u -p -r1.30 replace.mk
--- mk/flavor/pkg/replace.mk    16 Jun 2010 15:15:05 -0000      1.30
+++ mk/flavor/pkg/replace.mk    16 Jun 2010 17:42:29 -0000
@@ -183,23 +183,23 @@ replace-clean: .PHONY
 
 # 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.
+# being replaced, so we override that check with -D.  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}
+       ${PKG_ADD} -U -D -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}
+       ${PKG_ADD} -U -D ${PKGFILE}
 .endif
        ${RUN}${_REPLACE_OLDNAME_CMD}; \
        ${PKG_INFO} -qR ${PKGNAME:Q} | while read pkg; do \

Attachment: pgpHTCDHLpHXg.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index