ports/63683: [patch] add two advisory variables to bsd.port.mk

Mark Linimon linimon at FreeBSD.org
Wed Mar 3 11:10:20 UTC 2004


>Number:         63683
>Category:       ports
>Synopsis:       [patch] add two advisory variables to bsd.port.mk
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 03 03:10:19 PST 2004
>Closed-Date:
>Last-Modified:
>Originator:     Mark Linimon
>Release:        FreeBSD 4.9-STABLE i386
>Organization:
Lonesome Dove Computing Services
>Environment:
System: FreeBSD freefall.freebsd.org 4.9-STABLE FreeBSD 4.9-STABLE #11: Thu Feb 5 19:43:44 PST 2004 kensmith at freefall.freebsd.org:/c/src/sys/compile/FREEFALL i386
>Description:
	Both the ports monitoring code and FreshPorts need to have
	a unique way to determine if a port is a slave port, and
	in particular, the converse case of what slave ports belong
	to a particular master port.

	Unfortunately, MASTERDIR cannot be used for this purpose,
	as I had first hoped.  The problem is that MASTERDIR
	overrides the default location of the pkg-* files.  Some
	ports do not wish to do this, for completely legitimate
	reasons.  It would be possible to override the override,
	but this would itself be ugly and fragile.

	A related problem is that hundreds of ports do not use
	the MASTERDIR convention, even when they could.  Trying
	to work through each and every instance of this is not
	very appealing, either.

	This compromise will allow most of the slave ports to
	be fixed up as quickly as possible, with the least impact.
>How-To-Repeat:
	n/a
>Fix:
	The following code, while it functions, is completely ugly
	and should settle anyone's doubts about my incompetence at
	creating useful awk or sed scripts.  I will be happy to have
	someone comptent come up with a "correct" patch.

--- bsd.port.mk	4 Feb 2004 04:27:04 -0000
+++ bsd.port.mk	3 Mar 2004 10:34:11 -0000
@@ -1003,6 +1010,21 @@
 
 MASTERDIR?=	${.CURDIR}
 
+# Try to determine if we are a slave port.  These variables are used by
+# FreshPorts and portsmon, but not yet by the ports framework itself.
+.if ${MASTERDIR} != ${.CURDIR}
+IS_SLAVE_PORT?=	TRUE
+MASTERPORT!=	${ECHO_CMD} ${MASTERDIR} |\
+		${SED} -e "s@[0-9A-Za-z_+\-\.]*/\.\./@@"| \
+		${SED} -e "s@[0-9A-Za-z_+\-\.]*/\.\./@@"| \
+		${SED} -e "s@[0-9A-Za-z_+\-\.]*/@@"| \
+		${SED} -e "s@[0-9A-Za-z_+\-\.]*/@@"| \
+		${SED} -e "s@[0-9A-Za-z_+\-\.]*/@@"
+.else
+IS_SLAVE_PORT?=	FALSE
+MASTERPORT=
+.endif
+
 # If they exist, include Makefile.inc, then architecture/operating
 # system specific Makefiles, then local Makefile.local.
 
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list