aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2013-06-14 14:56:16 +0800
committerbapt <bapt@FreeBSD.org>2013-06-14 14:56:16 +0800
commit0b60e77ebe6f25258b28849ffbc0ff893416b9ea (patch)
treee6fd1e6ddbe79be0135ac2279ccf5e38a45350fc /Mk
parent730e875c6cfa8ea7c9b5cb590cd94e076f5fb2ad (diff)
downloadfreebsd-ports-gnome-0b60e77ebe6f25258b28849ffbc0ff893416b9ea.tar.gz
freebsd-ports-gnome-0b60e77ebe6f25258b28849ffbc0ff893416b9ea.tar.zst
freebsd-ports-gnome-0b60e77ebe6f25258b28849ffbc0ff893416b9ea.zip
Yes more simplification in showconfig, pretty-print-config and pkgng manifest generation
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.pkgng.mk6
-rw-r--r--Mk/bsd.port.mk26
2 files changed, 6 insertions, 26 deletions
diff --git a/Mk/bsd.pkgng.mk b/Mk/bsd.pkgng.mk
index 6f68ae37eda6..f4e209615d72 100644
--- a/Mk/bsd.pkgng.mk
+++ b/Mk/bsd.pkgng.mk
@@ -83,11 +83,7 @@ fake-pkg:
@${ECHO_CMD} "]" >> ${MANIFESTF}
@${ECHO_CMD} -n "options: {" >> ${MANIFESTF}
.for opt in ${COMPLETE_OPTIONS_LIST}
-.if empty(PORT_OPTIONS:M${opt})
- @${ECHO_CMD} -n "${opt}: off," >> ${MANIFESTF}
-.else
- @${ECHO_CMD} -n "${opt}: on," >> ${MANIFESTF}
-.endif
+ @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="on" ; ${ECHO_MSG} -n " ${opt}: $${match:-off}," >> ${MANIFESTF}
.endfor
.undef opt
@${ECHO_CMD} "}" >> ${MANIFESTF}
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 14344c8a0914..934d8c6440eb 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -6185,11 +6185,7 @@ showconfig:
.if !empty(COMPLETE_OPTIONS_LIST)
@${ECHO_MSG} "===> The following configuration options are available for ${PKGNAME}":
.for opt in ${ALL_OPTIONS}
-. if empty(PORT_OPTIONS:M${opt})
- @${ECHO_MSG} -n " ${opt}=off"
-. else
- @${ECHO_MSG} -n " ${opt}=on"
-. endif
+ @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="on" ; ${ECHO_MSG} -n " ${opt}=$${match:-off}"
. if !empty(${opt}_DESC)
@${ECHO_MSG} -n ": "${${opt}_DESC:Q}
. endif
@@ -6205,11 +6201,7 @@ showconfig:
@${ECHO_MSG} "====> ${${m}_DESC}${${otype}_EOL}"
. endif
. for opt in ${OPTIONS_${otype}_${m}}
-. if ${PORT_OPTIONS:M${opt}}
- @${ECHO_MSG} -n " ${opt}=on"
-. else
- @${ECHO_MSG} -n " ${opt}=off"
-. endif
+ @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="on" ; ${ECHO_MSG} -n " ${opt}=$${match:-off}"
. if !empty(${opt}_DESC)
@${ECHO_MSG} -n ": "${${opt}_DESC:Q}
. endif
@@ -6271,22 +6263,14 @@ RADIO_START= (
RADIO_END= )
pretty-print-config:
.for opt in ${ALL_OPTIONS}
-. if empty(PORT_OPTIONS:M${opt})
- @${ECHO_MSG} -n "-${opt} "
-. else
- @${ECHO_MSG} -n "+${opt} "
-. endif
+ @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="+" ; ${ECHO_MSG} -n "$${match:--}${opt} "
.endfor
.for otype in MULTI GROUP SINGLE RADIO
. for m in ${OPTIONS_${otype}}
@${ECHO_MSG} -n "${m}${${otype}_START} "
. for opt in ${OPTIONS_${otype}_${m}}
-. if ${PORT_OPTIONS:M${opt}}
- @${ECHO_MSG} -n "+${opt} "
-. else
- @${ECHO_MSG} -n "-${opt} "
-. endif
-. endfor
+ @[ -z "${PORT_OPTIONS:M${opt}}" ] || match="+" ; ${ECHO_MSG} -n "$${match:--}${opt} "
+. endfor
@${ECHO_MSG} -n "${${otype}_END} "
. endfor
.endfor