From owner-freebsd-ports@FreeBSD.ORG Fri Feb 24 19:38:23 2012 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92FA6106564A for ; Fri, 24 Feb 2012 19:38:23 +0000 (UTC) (envelope-from cejkar@fit.vutbr.cz) Received: from kazi.fit.vutbr.cz (kazi6.fit.vutbr.cz [IPv6:2001:67c:1220:808::93e5:80c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E32D8FC14 for ; Fri, 24 Feb 2012 19:38:22 +0000 (UTC) Received: from kazi.fit.vutbr.cz (localhost [127.0.0.1]) by kazi.fit.vutbr.cz (envelope-from cejkar@fit.vutbr.cz) (8.14.5/8.14.4) with ESMTP id q1OJcL0d065205 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 24 Feb 2012 20:38:21 +0100 (CET) Received: (from cejkar@localhost) by kazi.fit.vutbr.cz (8.14.5/8.13.1/Submit) id q1OJcLBg065204 for freebsd-ports@freebsd.org; Fri, 24 Feb 2012 20:38:21 +0100 (CET) (envelope-from cejkar@fit.vutbr.cz) X-Authentication-Warning: kazi.fit.vutbr.cz: cejkar set sender to cejkar@fit.vutbr.cz using -f Date: Fri, 24 Feb 2012 20:38:21 +0100 From: Cejka Rudolf To: freebsd-ports@freebsd.org Message-ID: <20120224193821.GA64014@fit.vutbr.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.71 on 147.229.8.12 Subject: Minor changes to bsd.port.mk and bsd.pkgng.mk X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Feb 2012 19:38:23 -0000 Hello, what do you think about the following minor changes to bsd.port.mk and bsd.pkgng.mk? The motivation is that it is currently relatively hard to detect, which options of a port are locally changed by user, or by gradual port upgrades with OPTIONS changed by port maintainer. (With consequence that when upgrading ports using packages and there is some non-default options value in a port, direct port compilation should be forced instead of use of a package.) Some port maintainers do not use on/off, but they use values ON/On/OFF/Off. I think that curent default value detection in make showconfig is useless and confusing, and it should be better to detect real value difference among OPTIONS in Makefile and options is /var/db/ports. Furthermore, it is possible to define WITH_* and WITHOUT_* variables in environment, so maybe there could be even bigger checks for on/off. --- bsd.port.mk.orig 2012-02-24 20:03:39.000000000 +0100 +++ bsd.port.mk 2012-02-24 20:17:01.000000000 +0100 @@ -5981,7 +5981,7 @@ set -- ${OPTIONS} XXX; \ while [ $$# -gt 3 ]; do \ OPTIONSLIST="$${OPTIONSLIST} $$1"; \ - defaultval=$$3; \ + defaultval=$$(${ECHO_CMD} $$3 | ${TR} [A-Z] [a-z]); \ withvar=WITH_$$1; \ withoutvar=WITHOUT_$$1; \ withval=$$(eval ${ECHO_CMD} $$\{$${withvar}\}); \ @@ -6086,7 +6086,7 @@ fi; \ set -- ${OPTIONS} XXX; \ while [ $$# -gt 3 ]; do \ - defaultval=$$3; \ + defaultval=$$(${ECHO_CMD} $$3 | ${TR} [A-Z] [a-z]); \ withvar=WITH_$$1; \ withoutvar=WITHOUT_$$1; \ withval=$$(eval ${ECHO_CMD} $$\{$${withvar}\}); \ @@ -6096,7 +6096,10 @@ elif [ ! -z "$${withoutval}" ]; then \ val=off; \ else \ - val="$${defaultval} (default)"; \ + val="$${defaultval}"; \ + fi; \ + if [ "$${val}" = "$${defaultval}" ]; then \ + val="$$val (default)"; \ fi; \ ${ECHO_MSG} " $$1=$${val} \"$$2\""; \ shift 3; \ --- bsd.pkgng.mk.orig 2012-02-24 20:08:33.000000000 +0100 +++ bsd.pkgng.mk 2012-02-24 20:14:50.000000000 +0100 @@ -85,7 +85,7 @@ fi; \ set -- ${OPTIONS} XXX; \ while [ $$# -gt 3 ]; do \ - defaultval=$$3 \ + defaultval=$$(${ECHO_CMD} $$3 | ${TR} [A-Z] [a-z]); \ withvar=WITH_$$1; \ withoutvar=WITHOUT_$$1; \ withval=$$(eval ${ECHO_CMD} $$\{$${withvar}\}); \ -- Rudolf Cejka http://www.fit.vutbr.cz/~cejkar Brno University of Technology, Faculty of Information Technology Bozetechova 2, 612 66 Brno, Czech Republic