Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Jul 2012 22:36:45 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r300983 - head/Mk
Message-ID:  <201207162236.q6GMajsC089660@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Mon Jul 16 22:36:44 2012
New Revision: 300983
URL: http://svn.freebsd.org/changeset/ports/300983

Log:
  compare options loading from /var/db/port/options and make.conf against the
  complete list of options.
  COMPLETE_OPTIONS_LIST being OPTIONS_DEFINE + all the OPTIONS_SINGLE_* + all the
  OPTIONS_MULTI_*

Modified:
  head/Mk/bsd.options.mk
  head/Mk/bsd.port.mk

Modified: head/Mk/bsd.options.mk
==============================================================================
--- head/Mk/bsd.options.mk	Mon Jul 16 20:42:38 2012	(r300982)
+++ head/Mk/bsd.options.mk	Mon Jul 16 22:36:44 2012	(r300983)
@@ -117,6 +117,15 @@ PORT_OPTIONS:=	 ${PORT_OPTIONS:N${O}}
 
 ALL_OPTIONS:=	${ALL_OPTIONS:O:u}
 
+# complete list
+COMPLETE_OPTIONS_LIST=	${ALL_OPTIONS}
+.for single in ${OPTIONS_SINGLE}
+COMPLETE_OPTIONS_LIST+=	${OPTIONS_SINGLE_${single}}
+.endfor
+.for multi in ${OPTIONS_MULTI}
+COMPLETE_OPTIONS_LIST+=	${OPTIONS_MULTI_${multi}}
+.endfor
+
 ## Now create the list of activated options
 .if defined(OPTIONS_OVERRIDE)
 # Special case $OPTIONS_OVERRIDE; if it is defined forget about anything done
@@ -132,7 +141,7 @@ PORT_OPTIONS:=	${PORT_OPTIONS:O:u}
 
 ## Set system-wide defined options (set by user in make.conf)
 .  for opt in ${OPTIONS_SET}
-.    if !empty(OPTIONS_DEFINE:M${opt})
+.    if !empty(COMPLETE_OPTIONS_LIST:M${opt})
 PORT_OPTIONS+=	${opt}
 .    endif
 .  endfor
@@ -145,7 +154,7 @@ PORT_OPTIONS:=	${PORT_OPTIONS:N${opt}}
 
 ## Set the options specified per-port (set by user in make.conf)
 .  for opt in ${${UNIQUENAME}_SET}
-.    if !empty(OPTIONS_DEFINE:M${opt})
+.    if !empty(COMPLETE_OPTIONS_LIST:M${opt})
 PORT_OPTIONS+=	${opt}
 .    endif
 .  endfor
@@ -177,7 +186,7 @@ PORT_OPTIONS:=	${PORT_OPTIONS:N${opt}}
 
 ## Finish by using the options set by the port config dialog, if any
 .  for opt in ${OPTIONS_FILE_SET}
-.    if !empty(OPTIONS_DEFINE:M${opt})
+.    if !empty(COMPLETE_OPTIONS_LIST:M${opt})
 PORT_OPTIONS+=	${opt}
 .    endif
 .  endfor

Modified: head/Mk/bsd.port.mk
==============================================================================
--- head/Mk/bsd.port.mk	Mon Jul 16 20:42:38 2012	(r300982)
+++ head/Mk/bsd.port.mk	Mon Jul 16 22:36:44 2012	(r300983)
@@ -6004,7 +6004,6 @@ sanity-config: _check-config
 
 .if !target(pre-config)
 pre-config:
-_COMPLETE_OPTIONS_LIST:=	${ALL_OPTIONS}
 .for opt in ${ALL_OPTIONS}
 .  if empty(PORT_OPTIONS:M${opt})
 DEFOPTIONS+=	${opt} ""${${opt}_DESC:Q} off
@@ -6014,7 +6013,6 @@ DEFOPTIONS+=	${opt} ""${${opt}_DESC:Q} o
 .endfor
 .for multi in ${OPTIONS_MULTI}
 .  for opt in ${OPTIONS_MULTI_${multi}}
-_COMPLETE_OPTIONS_LIST+=	${opt}
 .    if empty(PORT_OPTIONS:M${opt})
 DEFOPTIONS+=	${opt} "M(${multi}): "${${opt}_DESC:Q} off
 .    else
@@ -6024,7 +6022,6 @@ DEFOPTIONS+=    ${opt} "M(${multi}): "${
 .endfor
 .for single in ${OPTIONS_SINGLE}
 .  for opt in ${OPTIONS_SINGLE_${single}}
-_COMPLETE_OPTIONS_LIST+=	${opt}
 .    if empty(PORT_OPTIONS:M${opt})
 DEFOPTIONS+=	${opt} "S(${single}): "${${opt}_DESC:Q} off
 .    else
@@ -6032,8 +6029,6 @@ DEFOPTIONS+=	${opt} "S(${single}): "${${
 .    endif
 .  endfor
 .endfor
-
-_COMPLETE_OPTIONS_LIST:=	${_COMPLETE_OPTIONS_LIST:u}
 .undef multi
 .undef single
 .undef opt
@@ -6073,8 +6068,8 @@ config: pre-config
 	${ECHO_CMD} "# This file is auto-generated by 'make config'." > $${TMPOPTIONSFILE}; \
 	${ECHO_CMD} "# Options for ${PKGNAME}" >> $${TMPOPTIONSFILE}; \
 	${ECHO_CMD} "_OPTIONS_READ=${PKGNAME}" >> $${TMPOPTIONSFILE}; \
-	${ECHO_CMD} "_FILE_COMPLETE_OPTIONS_LIST=${_COMPLETE_OPTIONS_LIST}" >> $${TMPOPTIONSFILE}; \
-	for i in ${_COMPLETE_OPTIONS_LIST}; do \
+	${ECHO_CMD} "_FILE_COMPLETE_OPTIONS_LIST=${COMPLETE_OPTIONS_LIST}" >> $${TMPOPTIONSFILE}; \
+	for i in ${COMPLETE_OPTIONS_LIST}; do \
 		if ${ECHO_CMD} $${SELOPTIONS} | ${GREP} -qw $${i}; then \
 			${ECHO_CMD} "OPTIONS_FILE_SET+=$${i}" >> $${TMPOPTIONSFILE}; \
 		else \



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