Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Feb 2012 20:38:21 +0100
From:      Cejka Rudolf <cejkar@fit.vutbr.cz>
To:        freebsd-ports@freebsd.org
Subject:   Minor changes to bsd.port.mk and bsd.pkgng.mk
Message-ID:  <20120224193821.GA64014@fit.vutbr.cz>

next in thread | raw e-mail | index | archive | help
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 <cejkar at fit.vutbr.cz> http://www.fit.vutbr.cz/~cejkar
Brno University of Technology, Faculty of Information Technology
Bozetechova 2, 612 66  Brno, Czech Republic



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