Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Apr 2013 05:31:08 GMT
From:      Garrett Cooper <yaneurabeya@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/178072: [PATCH] [ports] look for Makefile.local in ${PORTSDIR} as well as ${.CURDIR}
Message-ID:  <201304230531.r3N5V8nx000616@red.freebsd.org>
Resent-Message-ID: <201304230540.r3N5e0Vi020320@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         178072
>Category:       ports
>Synopsis:       [PATCH] [ports] look for Makefile.local in ${PORTSDIR} as well as ${.CURDIR}
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 23 05:40:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Garrett Cooper
>Release:        10-CURRENT
>Organization:
EMC Isilon
>Environment:
FreeBSD gran-tourismo.west.isilon.com 10.0-CURRENT FreeBSD 10.0-CURRENT #2 r+ba9afe9: Fri Apr 19 20:29:10 PDT 2013     gcooper@gran-tourismo.west.isilon.com:/usr/obj/usr/src/sys/GRAN-TOURISMO  amd64
>Description:
The attached patch looks for Makefile.local in PORTSDIR as well as .CURDIR, thus being a bit less braindead when it comes to looking for site-localizations when there are a large number of ports categories.

Thus one only needs to have one Makefile.local instead of n-categories worth when trying to apply non-invasive changes to a ports tree.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

Index: Mk/bsd.port.mk
===================================================================
--- Mk/bsd.port.mk	(revision 316288)
+++ Mk/bsd.port.mk	(working copy)
@@ -1260,10 +1260,12 @@
 USE_SUBMAKE=	yes
 .endif
 
-.if exists(${MASTERDIR}/Makefile.local)
-.include "${MASTERDIR}/Makefile.local"
+.for d in ${PORTSDIR} ${MASTERDIR}
+.if exists($d/Makefile.local)
+.include "$d/Makefile.local"
 USE_SUBMAKE=	yes
 .endif
+.endfor
 
 # where 'make config' records user configuration options
 PORT_DBDIR?=	/var/db/ports
Index: Mk/bsd.port.subdir.mk
===================================================================
--- Mk/bsd.port.subdir.mk	(revision 316288)
+++ Mk/bsd.port.subdir.mk	(working copy)
@@ -107,33 +107,33 @@
 .endif
 
 .if !defined(PYTHON_DEFAULT_VERSION)
-PYTHON_DEFAULT_VERSION!=	make -V PYTHON_DEFAULT_VERSION USE_PYTHON=1 -f ${PORTSDIR}/Mk/bsd.port.mk
+PYTHON_DEFAULT_VERSION!=	${MAKE} -V PYTHON_DEFAULT_VERSION USE_PYTHON=1 -f ${PORTSDIR}/Mk/bsd.port.mk
 .endif
 
 .if !defined(PYTHON_DEFAULT_PORTVERSION)
 # We are caching the PYTHON_PORTVERSION of the default python version so we can reuse it in the
 # common case.
-PYTHON_DEFAULT_PORTVERSION!=	make -V PYTHON_PORTVERSION USE_PYTHON=1 -f ${PORTSDIR}/Mk/bsd.port.mk
+PYTHON_DEFAULT_PORTVERSION!=	${MAKE} -V PYTHON_PORTVERSION USE_PYTHON=1 -f ${PORTSDIR}/Mk/bsd.port.mk
 .endif
 
 .if !defined(PYTHONBASE)
-PYTHONBASE!=			make -V PYTHONBASE USE_PYTHON=1 -f ${PORTSDIR}/Mk/bsd.port.mk
+PYTHONBASE!=			${MAKE} -V PYTHONBASE USE_PYTHON=1 -f ${PORTSDIR}/Mk/bsd.port.mk
 .endif
 
 .if !defined(_JAVA_VERSION_LIST_REGEXP)
-_JAVA_VERSION_LIST_REGEXP!=	make -V _JAVA_VERSION_LIST_REGEXP USE_JAVA=1 -f ${PORTSDIR}/Mk/bsd.port.mk
+_JAVA_VERSION_LIST_REGEXP!=	${MAKE} -V _JAVA_VERSION_LIST_REGEXP USE_JAVA=1 -f ${PORTSDIR}/Mk/bsd.port.mk
 .endif
 
 .if !defined(_JAVA_VENDOR_LIST_REGEXP)
-_JAVA_VENDOR_LIST_REGEXP!=	make -V _JAVA_VENDOR_LIST_REGEXP USE_JAVA=1 -f ${PORTSDIR}/Mk/bsd.port.mk
+_JAVA_VENDOR_LIST_REGEXP!=	${MAKE} -V _JAVA_VENDOR_LIST_REGEXP USE_JAVA=1 -f ${PORTSDIR}/Mk/bsd.port.mk
 .endif
 
 .if !defined(_JAVA_OS_LIST_REGEXP)
-_JAVA_OS_LIST_REGEXP!=		make -V _JAVA_OS_LIST_REGEXP USE_JAVA=1 -f ${PORTSDIR}/Mk/bsd.port.mk
+_JAVA_OS_LIST_REGEXP!=		${MAKE} -V _JAVA_OS_LIST_REGEXP USE_JAVA=1 -f ${PORTSDIR}/Mk/bsd.port.mk
 .endif
 
 .if !defined(_JAVA_PORTS_INSTALLED)
-_JAVA_PORTS_INSTALLED!=		make -V _JAVA_PORTS_INSTALLED USE_JAVA=1 -f ${PORTSDIR}/Mk/bsd.port.mk
+_JAVA_PORTS_INSTALLED!=		${MAKE} -V _JAVA_PORTS_INSTALLED USE_JAVA=1 -f ${PORTSDIR}/Mk/bsd.port.mk
 .endif
 
 .if !defined(UID)
@@ -155,9 +155,11 @@
 INDEXFILE?=	INDEX-${OSVERSION:C/([0-9]*)[0-9]{5}/\1/}
 
 # local customization of the ports tree
-.if exists(${.CURDIR}/Makefile.local)
-.include "${.CURDIR}/Makefile.local"
+.for d in ${PORTSDIR} ${.CURDIR}
+.if exists($d/Makefile.local)
+.include "$d/Makefile.local"
 .endif
+.endfor
 
 TARGETS+=	all
 TARGETS+=	build


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201304230531.r3N5V8nx000616>