ports/104551: Portmanager creates spurious malformed dependencies in the package database

Robert Woolley freebsd at rwoolley.com
Wed Oct 18 21:30:34 UTC 2006

>Number:         104551
>Category:       ports
>Synopsis:       Portmanager creates spurious malformed dependencies in the package database
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 18 21:30:24 GMT 2006
>Originator:     Robert Woolley
>Release:        6.1
FreeBSD gumby.localdomain 6.1-RELEASE-p10 FreeBSD 6.1-RELEASE-p10 #7: Sat Oct 14 22:35:50 BST 2006     root at gumby.localdomain:/usr/obj/data/FreeBSD-src/sys/MUSTARD  i386
After running portmanager, pkgdb will sometimes find numerous stale dependencies on strings that aren't package names. These don't seem to do any harm to portmanager, but they have to be deleted before portupgrade can be used. It may create more severe problems for portmaster, I haven't tried it.

Portmanager performs a runtime patch on bsd.port.mk, which causes the makefile to call back into portmanger with the undocumented command  "package-depends". This enables portmanager to set PKG_ARGS, which in turn sets the package dependencies.

Unfortunately, portmanager doesn't suppress all of it's debug messages when invoked with "package-depends" and the resulting unwanted strings end-up in PKG_ARGS.
Find a port that depends on a forbidden port and run 
portmanager /<origin> package-depends 

e.g multimedia/win32-codecs is forbidden when built  WITH_QUICKTIME  

# setenv WITH_QUICKTIME yes && portmanager /multimedia/mplayer package-depends

This shows the unwanted debug messages. Upgrading the same port (mplayer) will reproduce the package database corruption.
All of the portmanager debug message lines start with "MGPMr", so a simple solution is just to filter them out.   The following patch patches the patchfile that is used to patch bsd.port.mk. I've been using it for several weeks without a problem, but the PR webpage say it's the wrong content type when I try to attach it. 

$ cat /usr/ports/sysutils/portmanager/files/patch-patch-bsd.port.mk-0.3.6
--- portmanager/patch-bsd.port.mk-0.3.6.orig    Mon Dec 12 20:32:34 2005
+++ portmanager/patch-bsd.port.mk-0.3.6 Wed Sep 20 15:00:17 2006
@@ -5,7 +5,7 @@
  .if !defined(PKG_ARGS)
 -PKG_ARGS=             -v -c -${COMMENT:Q} -d ${DESCR} -f ${TMPPLIST} -p ${PREFIX} -P "`cd ${.CURDIR} && ${MAKE} package-depends | ${GREP} -v -E ${PKG_IGNORE_DEPENDS} | ${SORT} -u`" ${EXTRA_PKG_ARGS} $${_LATE_PKG_ARGS}
-+PORTMANAGER=  ${LOCALBASE}/bin/portmanager /${PKGORIGIN} package-depends
++PORTMANAGER=  ${LOCALBASE}/bin/portmanager /${PKGORIGIN} package-depends | ${GREP} -v -E "^MGPMr"
 +PKG_ARGS=             -v -c -${COMMENT:Q} -d ${DESCR} -f ${TMPPLIST} -p ${PREFIX} -P "`cd ${.CURDIR} && ${PORTMANAGER} | ${GREP} -v -E ${PKG_IGNORE_DEPENDS} | ${SORT} -u`" ${EXTRA_PKG_ARGS} $${_LATE_PKG_ARGS}
 +###PKG_ARGS=          -v -c -${COMMENT:Q} -d ${DESCR} -f ${TMPPLIST} -p ${PREFIX} -P "`cd ${.CURDIR} && ${MAKE} package-depends | ${GREP} -v -E ${PKG_IGNORE_DEPENDS} | ${SORT} -u`" ${EXTRA_PKG_ARGS} $${_LATE_PKG_ARGS}
  .if !defined(NO_MTREE)

More information about the freebsd-ports-bugs mailing list