Bug 102300

Summary: DESTDIR silently breaks CONFLICTS
Product: Ports & Packages Reporter: Matthias Andree <matthias.andree>
Component: Individual Port(s)Assignee: Port Management Team <portmgr>
Status: Closed FIXED    
Severity: Affects Only Me CC: portmgr
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Matthias Andree 2006-08-20 01:40:14 UTC
The new DESTDIR scheme in ports/Mk/bsd.port.mk *silently* breaks CONFLICTS,
ports built with default (empty) DESTDIR have no CONFLICTS recorded.

Cause: DESTDIR isn't defined by default, hence this part in ports/Mk/bsd.port.mk
lines 2304 ff.:

# Does the pkg_create tool support conflict checking?
# XXX Slow?
.if !defined(PKGINSTALLVER)
PKGINSTALLVER!= ${CHROOT} ${DESTDIR} ${PKG_INFO} -P 2>/dev/null | ${SED} -e 's/.*: //'
.endif

expands to:

PKGINSTALLVER!= chroot  /usr/sbin/pkg_info -P | sed -e 's/.*: //'

which causes chroot to complain "chroot: /usr/sbin/pkg_info: Not a directory"
- however this message is usually discarded.

You can check this (DESTDIR must not be set) easily with:

$ cd /usr/ports/security/openvpn # this isn't specific to OpenVPN
                                 # but must happen in some port directory
$ pkg_info -P
Package tools revision: 20040629
$ make -V DESTDIR

$ make -V PKGINSTALLVER

$ make -V DISABLE_CONFLICTS
YES

Fix: 

Either set a reasonable default for DESTDIR, or omit the CHROOT if DESTDIR is
an empty string.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2006-08-20 01:48:51 UTC
Responsible Changed
From-To: freebsd-ports-bugs->portmgr

assign to portmgr for investigation
Comment 2 Matthias Andree 2006-08-20 01:51:25 UTC
Suggested fix (tested on FreeBSD 6.1-RELEASE-p3 i386) for consistency
with other stuff in the Makefile -- note it would be better to get rid
of this special casing everywhere and define a new variable,
MAYBE_CHROOT, to either ${CHROOT} ${DESTDIR} or empty in a
central place, so there needs to be only one .if defined(DESTDIR).

Perhaps there should also be a safety net that causes the Makefile to
abort if PKGINSTALLVER is empty or 0.

--- /usr/ports/Mk/bsd.port.mk.orig	Sun Aug 20 02:28:56 2006
+++ /usr/ports/Mk/bsd.port.mk	Sun Aug 20 02:44:58 2006
@@ -2304,7 +2304,11 @@
 # Does the pkg_create tool support conflict checking?
 # XXX Slow?
 .if !defined(PKGINSTALLVER)
+.if !defined(DESTDIR)
+PKGINSTALLVER!= ${PKG_INFO} -P 2>/dev/null | ${SED} -e 's/.*: //'
+.else
 PKGINSTALLVER!= ${CHROOT} ${DESTDIR} ${PKG_INFO} -P 2>/dev/null | ${SED} -e 's/.*: //'
+.endif
 .endif
 .if ${PKGINSTALLVER} < 20030417
 DISABLE_CONFLICTS=	YES

-- 
Matthias Andree
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2006-09-15 08:42:39 UTC
State Changed
From-To: open->analyzed

kris is running a test build on the cluster with this one.
Comment 4 dfilter service freebsd_committer freebsd_triage 2006-09-20 05:02:16 UTC
kris        2006-09-20 04:02:09 UTC

  FreeBSD ports repository

  Modified files:
    Mk                   bsd.port.mk 
  Log:
  * Add missing '|| true' to silence an @unexec rmdir [1]
  
  * Repair CONFLICTS, which was broken by previous DESTDIR changes [2]
  
  * Use "set --" instead of "set" for better robustness [3]
  
  * Avoid :L modifier in ${USE_LDCONFIG} which broke e.g. /usr/X11R6
    ports [4]
  
  * Correct a comment typo [4]
  
  * Force passive FTP mode by default (this is already the default with
    the standard login class, so this is a NOP for most users) [5].
  
  PR:             ports/101809 [1], ports/102300 [2], ports/102514 [3],
                  ports/102750 [4], ports/96088 [5]
  Submitted by:   bsam [1], Matthias Andree <matthias.andree@gmx.de> [2],
                  infofarmer [3], flz [4],
                  Darren Pilgrim <darren.pilgrim@bitfreak.org> [5]
  
  Revision  Changes    Path
  1.542     +14 -10    ports/Mk/bsd.port.mk
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 5 Kris Kennaway freebsd_committer freebsd_triage 2006-09-20 05:04:46 UTC
State Changed
From-To: open->closed

Committed, thanks!
Comment 6 Kris Kennaway freebsd_committer freebsd_triage 2006-09-20 05:04:46 UTC
State Changed
From-To: analyzed->closed

Committed, thanks!
Comment 7 Kris Kennaway freebsd_committer freebsd_triage 2006-09-20 05:04:46 UTC
State Changed
From-To: analyzed->closed

Committed, thanks!
Comment 8 Kris Kennaway freebsd_committer freebsd_triage 2006-09-20 05:04:46 UTC
State Changed
From-To: analyzed->closed

Committed, thanks!