aboutsummaryrefslogtreecommitdiff
path: root/Mk/bsd.options.mk
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2013-06-26 07:22:06 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2013-06-26 07:22:06 +0000
commit35982b23be2e931bc21706bcf7b5f6d881fb52de (patch)
treea586641a8f1a5511cf76f0101cb17a2bd337165d /Mk/bsd.options.mk
parentbdcdc9cc0d1d4c5b04f99c0f3e8b1ccc75f9d2eb (diff)
downloadports-35982b23be2e931bc21706bcf7b5f6d881fb52de.tar.gz
ports-35982b23be2e931bc21706bcf7b5f6d881fb52de.zip
Replace OPTIONSFILE by OPTIONS_FILE which is a more robust variable with unicity
insurance in its path to avoid collision. A compatibility layer is available to automatically load and migration from OPTIONSFILE to OPTIONS_FILE (this is all transparent for users.) It is recommanded that ports that used to overwrite OPTIONSFILE to prevent the known bugs should keep the OPTIONSFILE overwrite for a while (6 month) to allow the migration to happen automatically and users to not lose their old save options. New options file is now based on the PKGORIGIN therefor the definition of the PKGORIGIN has been moved ealier in bsd.port.mk to allow it's usage from withing bsd.options.mk PR: ports/148637 Reviewed by: bdrewery
Notes
Notes: svn path=/head/; revision=321785
Diffstat (limited to 'Mk/bsd.options.mk')
-rw-r--r--Mk/bsd.options.mk27
1 files changed, 27 insertions, 0 deletions
diff --git a/Mk/bsd.options.mk b/Mk/bsd.options.mk
index 562e0fe9392e..d6df7c960811 100644
--- a/Mk/bsd.options.mk
+++ b/Mk/bsd.options.mk
@@ -75,7 +75,9 @@
.if !defined(OPTIONSMKINCLUDED)
OPTIONSMKINCLUDED= bsd.options.mk
+OPTIONS_NAME?= ${PKGORIGIN:S/\//_/}
OPTIONSFILE?= ${PORT_DBDIR}/${UNIQUENAME}/options
+OPTIONS_FILE?= ${PORT_DBDIR}/${OPTIONS_NAME}/options
# Set the default values for the global options, as defined by portmgr
.if !defined(NOPORTDOCS)
@@ -162,6 +164,7 @@ PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
. endfor
+# XXX To remove once UNIQUENAME will be removed
## Set the options specified per-port (set by user in make.conf)
. for opt in ${${UNIQUENAME}_SET}
. if !empty(COMPLETE_OPTIONS_LIST:M${opt})
@@ -175,7 +178,22 @@ NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
. endfor
+# XXX To remove once UNIQUENAME will be removed
+## Set the options specified per-port (set by user in make.conf)
+. for opt in ${${OPTIONS_NAME}_SET}
+. if !empty(COMPLETE_OPTIONS_LIST:M${opt})
+PORT_OPTIONS+= ${opt}
+. endif
+. endfor
+PORT_OPTIONS:= ${PORT_OPTIONS:O:u}
+
+## Unset the options excluded per-port (set by user in make.conf)
+. for opt in ${${OPTIONS_NAME}_UNSET}
+PORT_OPTIONS:= ${PORT_OPTIONS:N${opt}}
+. endfor
+
+# XXX to remove once UNIQUENAME is removed
## options files (from dialog)
. if exists(${OPTIONSFILE}) && !make(rmconfig)
. include "${OPTIONSFILE}"
@@ -183,6 +201,15 @@ NEW_OPTIONS:= ${NEW_OPTIONS:N${opt}}
. if exists(${OPTIONSFILE}.local)
. include "${OPTIONSFILE}.local"
. endif
+# XXX to remove once UNIQUENAME is removed
+
+## options files (from dialog)
+. if exists(${OPTIONS_FILE}) && !make(rmconfig)
+. include "${OPTIONS_FILE}"
+. endif
+. if exists(${OPTIONS_FILE}.local)
+. include "${OPTIONS_FILE}.local"
+. endif
### convert WITH and WITHOUT found in make.conf or reloaded from old optionsfile
.for opt in ${ALL_OPTIONS}