pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/mk Pretty-print the PKG_SUPPORTED_OPTIONS so that we d...
details: https://anonhg.NetBSD.org/pkgsrc/rev/6bf4deb07d28
branches: trunk
changeset: 479096:6bf4deb07d28
user: jlam <jlam%pkgsrc.org@localhost>
date: Wed Aug 04 23:25:14 2004 +0000
description:
Pretty-print the PKG_SUPPORTED_OPTIONS so that we don't overflow a line
of the display. We now batch them up and print a few per line. Also,
display the supported options at pre-install-depends time.
diffstat:
mk/bsd.options.mk | 24 ++++++++++++++++++++----
1 files changed, 20 insertions(+), 4 deletions(-)
diffs (45 lines):
diff -r 2ecc300abdba -r 6bf4deb07d28 mk/bsd.options.mk
--- a/mk/bsd.options.mk Wed Aug 04 23:22:38 2004 +0000
+++ b/mk/bsd.options.mk Wed Aug 04 23:25:14 2004 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.options.mk,v 1.2 2004/08/04 09:36:16 jlam Exp $
+# $NetBSD: bsd.options.mk,v 1.3 2004/08/04 23:25:14 jlam Exp $
#
# This Makefile fragment provides boilerplate code for standard naming
# conventions for handling per-package build options.
@@ -163,8 +163,8 @@
#
BUILD_DEFS+= PKG_OPTIONS
-.PHONY: pre-extract supported-options-message
-pre-extract: supported-options-message
+.PHONY: pre-install-depends supported-options-message
+pre-install-depends: supported-options-message
.if !defined(PKG_SUPPORTED_OPTIONS)
supported-options-message: # do nothing
.else
@@ -174,7 +174,23 @@
@${ECHO} "=========================================================================="
@${ECHO} "The supported build options for this package are:"
@${ECHO} ""
- @${ECHO} " ${PKG_SUPPORTED_OPTIONS}"
+ @set -- ${PKG_SUPPORTED_OPTIONS}; \
+ printwidth=40; \
+ while ${TEST} $$# -gt 0; do \
+ if ${TEST} -z "$$line"; then \
+ line=$$1; \
+ else \
+ line="$$line $$1"; \
+ fi; \
+ if ${TEST} $${#line} -gt $$printwidth; then \
+ ${ECHO} " $$line"; \
+ line=; \
+ fi; \
+ shift; \
+ done; \
+ if ${TEST} $${#line} -le $$printwidth; then \
+ ${ECHO} " $$line"; \
+ fi
@${ECHO} ""
@${ECHO} "You can select which build options to use by setting the following"
@${ECHO} "variables. Their curent value is shown:"
Home |
Main Index |
Thread Index |
Old Index