Subject: show-options, supported-options-message and describe-options
To: NetBSD Packages Technical Discussion List <tech-pkg@NetBSD.org>
From: Roland Illig <rillig@NetBSD.org>
List: tech-pkg
Date: 09/29/2005 16:14:16
This is a multi-part message in MIME format.
--------------070809020700070407040106
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Hi,
I find the `show-options' target a little (but only a little) useless.
It tells you which options you can select, but it doesn't tell you
_where_ to select them. I prefer the `supported-options-message' over it.
I have written a patch that maps `show-options' to
`supported-options-message' and extends the output of that target by
explaining where to find more information. This way the user is a little
more guided through the pkgsrc forest.
The change is that `show-options' gives you a quite complete overview of
the available options, nicely formatted, and a pointer where to find the
rest.
Roland
--------------070809020700070407040106
Content-Type: text/plain;
name="bsd.options.mk.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="bsd.options.mk.patch"
Index: bsd.options.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.options.mk,v
retrieving revision 1.49
diff -u -p -r1.49 bsd.options.mk
--- bsd.options.mk 5 Sep 2005 15:24:08 -0000 1.49
+++ bsd.options.mk 29 Sep 2005 14:04:53 -0000
@@ -341,8 +341,8 @@ _PKG_OPTIONS_WORDWRAP_FILTER= \
END { if (length(line) > 0) print " "line } \
'
-.PHONY: show-options
-show-options:
+.PHONY: describe-options
+describe-options:
@${ECHO} Any of the following general options may be selected:
.for _opt_ in ${PKG_SUPPORTED_OPTIONS:O}
. if !defined(_PKG_OPTIONS_GROUP_MAP.${_opt_}) && empty(_PKG_OPTIONS_ALL_SETS:M${_opt_})
@@ -367,9 +367,6 @@ show-options:
@${ECHO} " "${_opt_:Q}" "`${SED} -n "s/^"${_opt_:Q}" //p" ../../mk/defaults/options.description`
. endfor
.endfor
- @${ECHO}
- @${ECHO} "These options are enabled by default: "${PKG_SUGGESTED_OPTIONS:O:Q}
- @${ECHO} "These options are currently enabled: "${PKG_OPTIONS:O:Q}
. if defined(PKG_OPTIONS_DEPRECATED_WARNINGS)
@${ECHO}
@for l in ${PKG_OPTIONS_DEPRECATED_WARNINGS}; \
@@ -378,6 +375,9 @@ show-options:
done
. endif
+.PHONY: show-options
+show-options: supported-options-message
+
.if defined(PKG_SUPPORTED_OPTIONS)
.PHONY: supported-options-message
pre-install-depends: supported-options-message
@@ -410,6 +410,10 @@ supported-options-message:
done
. endif
@${ECHO} ""
+ @${ECHO} "To see a short description of the options, run"
+ @${ECHO} ""
+ @${ECHO} " ${MAKE} describe-options"
+ @${ECHO} ""
@${ECHO} "=========================================================================="
. endif
.endif
--------------070809020700070407040106--