Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Oct 2012 13:43: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: r305300 - head/Mk
Message-ID:  <201210051343.q95DhkFp080266@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Fri Oct  5 13:43:45 2012
New Revision: 305300
URL: http://svn.freebsd.org/changeset/ports/305300

Log:
  Options can now be overridden from command line using
  WITH/WITHOUT.
  
  Name has been proprosed by gahr during brainstorming on ports@
  
  PR:		ports/170180
  Submitted by:	ohauer

Modified:
  head/Mk/bsd.options.mk

Modified: head/Mk/bsd.options.mk
==============================================================================
--- head/Mk/bsd.options.mk	Fri Oct  5 12:45:19 2012	(r305299)
+++ head/Mk/bsd.options.mk	Fri Oct  5 13:43:45 2012	(r305300)
@@ -21,6 +21,8 @@
 # OTPIONS_MULTI_${NAME}		- List of OPTIONS grouped as multiple-choice
 #				(for the multi named as ${NAME} as defined in 
 #				OPTIONS_MULTI)
+# WITH				Set options from the command line
+# WITHOUT			Unset options from the command line
 
 ##
 # Set all the options available for the ports, beginning with the
@@ -199,6 +201,19 @@ PORT_OPTIONS:=	${PORT_OPTIONS:N${opt}}
 
 .endif
 
+## Cmdline always win over the rest
+.for opt in ${WITH}
+.  if !empty(COMPLETE_OPTIONS_LIST:M${opt})
+PORT_OPTIONS+=	${opt}
+.  endif
+.endfor
+PORT_OPTIONS:=	${PORT_OPTIONS:O:u}
+
+.for opt in ${WITHOUT}
+PORT_OPTIONS:=	${PORT_OPTIONS:N${opt}}
+.endfor
+.undef opt
+
 ## Now some compatibility
 .if empty(PORT_OPTIONS:MDOCS)
 NOPORTDOCS=	yes



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