Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/distrib/sets Clean up debug knobs.



details:   https://anonhg.NetBSD.org/src/rev/6960d04f0c00
branches:  trunk
changeset: 750075:6960d04f0c00
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Tue Dec 15 06:18:07 2009 +0000

description:
Clean up debug knobs.

diffstat:

 distrib/sets/Makefile  |  17 +++++++++++------
 distrib/sets/sets.subr |  38 ++++++++++++++++++++++++++++----------
 2 files changed, 39 insertions(+), 16 deletions(-)

diffs (117 lines):

diff -r 6d8d317951a8 -r 6960d04f0c00 distrib/sets/Makefile
--- a/distrib/sets/Makefile     Tue Dec 15 06:15:11 2009 +0000
+++ b/distrib/sets/Makefile     Tue Dec 15 06:18:07 2009 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.77 2009/12/11 15:25:05 uebayasi Exp $
+#      $NetBSD: Makefile,v 1.78 2009/12/15 06:18:07 uebayasi Exp $
 
 # The `all' target must appear before bsd.own.mk is pulled in.
 all:
@@ -8,8 +8,7 @@
 .include <bsd.own.mk>
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 
-SETSCMD=       cd ${.CURDIR} && \
-               DESTDIR=${DESTDIR:Q} \
+SETSENV=       DESTDIR=${DESTDIR:Q} \
                MACHINE=${MACHINE:Q} \
                MACHINE_ARCH=${MACHINE_ARCH:Q} \
                AWK=${TOOL_AWK:Q} \
@@ -22,7 +21,9 @@
                PAX=${TOOL_PAX:Q} \
                PKG_CREATE=${TOOL_PKG_CREATE:Q} \
                SED=${TOOL_SED:Q} \
-               TSORT=${TSORT:Q} \
+               TSORT=${TSORT:Q}
+SETSCMD=       cd ${.CURDIR} && \
+               ${SETSENV} \
                ${HOST_SH}
 
 MAKETARS_FLAGS=
@@ -68,8 +69,12 @@
 print_toolchain_missing: .PHONY
        @echo "${TOOLCHAIN_MISSING}"
 
-print_mkvars: .PHONY
-       @env SETS_SUBR_DEBUG=dumpmkvars rundir="${.CURDIR}" ${HOST_SH} sets.subr
+print_mkvars \
+print_set_lists_base print_set_lists_x print_set_lists_ext \
+list_set_lists_base list_set_lists_x list_set_lists_ext \
+list_set_files_base list_set_files_x list_set_files_ext \
+               : .PHONY
+       @${SETSENV}; rundir="${.CURDIR}"; . ./sets.subr; ${.TARGET}
 
 #
 # METALOG MANIPULATION TARGETS
diff -r 6d8d317951a8 -r 6960d04f0c00 distrib/sets/sets.subr
--- a/distrib/sets/sets.subr    Tue Dec 15 06:15:11 2009 +0000
+++ b/distrib/sets/sets.subr    Tue Dec 15 06:18:07 2009 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: sets.subr,v 1.116 2009/12/15 05:11:08 uebayasi Exp $
+#      $NetBSD: sets.subr,v 1.117 2009/12/15 06:18:07 uebayasi Exp $
 #
 
 #
@@ -126,16 +126,9 @@
 
 MKVARS="$( ${MAKE} -B -f ${rundir}/mkvars.mk mkvars | sed -e 's,=.*,,' | xargs )"
 
-if [ "$SETS_SUBR_DEBUG" = "dumpmkvars" ]; then
-       for v in $MKVARS; do
-               eval echo $v=\$$v
-       done
-       exit 0
-fi
-
 #####
 
-setsdir=${0%/*}
+setsdir=${rundir}
 obsolete=0
 module=yes
 if [ "${MKKMOD}" = "no" ]; then
@@ -173,7 +166,7 @@
 # In each file, a record consists of a path and a System Package name,
 # separated by whitespace. E.g.,
 #
-#      # $NetBSD: sets.subr,v 1.116 2009/12/15 05:11:08 uebayasi Exp $
+#      # $NetBSD: sets.subr,v 1.117 2009/12/15 06:18:07 uebayasi Exp $
 #      .                       base-sys-root   [keyword[,...]]
 #      ./altroot               base-sys-root
 #      ./bin                   base-sys-root
@@ -379,6 +372,7 @@
        list_set_lists_shl $setname
        list_set_lists_module $setname
        list_set_lists_rescue $setname
+       return 0
 }
 
 list_set_lists_mi()
@@ -507,3 +501,27 @@
        @echo \${TARGET_ENDIANNESS}
 EOMAKE
 }
+
+#####
+
+# print_mkvars
+print_mkvars()
+{
+       for v in $MKVARS; do
+               eval echo $v=\$$v
+       done
+}
+
+# print_set_lists_{base,x,ext}
+# list_set_lists_{base,x,ext}
+# list_set_files_{base,x,ext}
+for func in print_set_lists list_set_lists list_set_files; do
+       for x in base x ext; do
+               if [ $x = base ]; then
+                       list=nlists
+               else
+                       list=${x}lists
+               fi
+               eval ${func}_${x} \(\) \{ $func \$$list \; \}
+       done
+done



Home | Main Index | Thread Index | Old Index