Minor changes to bsd.port.mk and bsd.pkgng.mk
Cejka Rudolf
cejkar at fit.vutbr.cz
Fri Feb 24 19:38:23 UTC 2012
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
More information about the freebsd-ports
mailing list