From owner-svn-ports-head@freebsd.org Mon Dec 14 22:44:40 2015 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 910B4A44C2C; Mon, 14 Dec 2015 22:44:40 +0000 (UTC) (envelope-from marino@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 534FF1A3C; Mon, 14 Dec 2015 22:44:40 +0000 (UTC) (envelope-from marino@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBEMidhe067326; Mon, 14 Dec 2015 22:44:39 GMT (envelope-from marino@FreeBSD.org) Received: (from marino@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBEMid1u067325; Mon, 14 Dec 2015 22:44:39 GMT (envelope-from marino@FreeBSD.org) Message-Id: <201512142244.tBEMid1u067325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marino set sender to marino@FreeBSD.org using -f From: John Marino Date: Mon, 14 Dec 2015 22:44:39 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r403743 - head/Mk X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Dec 2015 22:44:40 -0000 Author: marino Date: Mon Dec 14 22:44:39 2015 New Revision: 403743 URL: https://svnweb.freebsd.org/changeset/ports/403743 Log: Mk/bsd.options.mk: Introduce SELECTED_OPTIONS, DESELECTED_OPTIONS Until now, the only way to obtain information on the valid port options and the current selection states is by using the pretty-print-config target. It would look something like this: > make -C /usr/ports/lang/gcc5-aux print-print-config Standard[ +FORT +OBJC +NLS -TESTSUITE -ALLSTAGES -STATIC ] \ Bootstrap[ -BOOTSTRAP ] To process the total options and the selection state of each option requires additional processing, e.g. with awk and/or sed. Moreover, if other information is needed about the port it question, it would require a second execution of "make" to reveal variable values. There simply is no other way to obtain the option selection information in a single pass (this limitation came when options framework was brought in). This enhancement allows the option selection information to revealed with make -V so that all port information can be acquired in a single pass. Moreover, they won't require piping through sed or awk. Two read-only variables are introduced: SELECTED_OPTIONS (list of all "on" options) DESELECTED_OPTIONS (liss of all "off" options) Here's an example of a single pass acquisition: > make -C /usr/dports/lang/gcc5-aux -V PKGNAME -V SELECTED_OPTIONS \ -V DESELECTED_OPTIONS gcc5-aux-20150716 NLS OBJC FORT BOOTSTRAP STATIC ALLSTAGES TESTSUITE Obviously the grouping information seen in pretty-print-config is lost, so these new variables will not help if option group information is required. Approved by: portmgr (bapt) Modified: head/Mk/bsd.options.mk Modified: head/Mk/bsd.options.mk ============================================================================== --- head/Mk/bsd.options.mk Mon Dec 14 22:24:07 2015 (r403742) +++ head/Mk/bsd.options.mk Mon Dec 14 22:44:39 2015 (r403743) @@ -68,6 +68,13 @@ # WITHOUT - Unset options from the command line # # +# These variables are strictly informational (read-only). They indicate the +# current state of the selected options; they are space-delimited lists. +# +# SELECTED_OPTIONS - list of options set "on" +# DESELECTED_OPTIONS - list of options set "off" +# +# # The following knobs are there to simplify the handling of OPTIONS in simple # cases : # @@ -573,4 +580,25 @@ _OPTIONS_${_target}:= ${_OPTIONS_${_targ . endif .endfor +.undef (SELECTED_OPTIONS) +.undef (DESELECTED_OPTIONS) +.for opt in ${ALL_OPTIONS} +. if ${PORT_OPTIONS:M${opt}} +SELECTED_OPTIONS:= ${opt} ${SELECTED_OPTIONS} +. else +DESELECTED_OPTIONS:= ${opt} ${DESELECTED_OPTIONS} +. endif +.endfor +.for otype in MULTI GROUP SINGLE RADIO +. for m in ${OPTIONS_${otype}} +. for opt in ${OPTIONS_${otype}_${m}} +. if ${PORT_OPTIONS:M${opt}} +SELECTED_OPTIONS:= ${opt} ${SELECTED_OPTIONS} +. else +DESELECTED_OPTIONS:= ${opt} ${DESELECTED_OPTIONS} +. endif +. endfor +. endfor +.endfor + .endif