Wed Dec 2 15:05:55 2009 UTC ()
Pass the correct ${MKVARS} equivalent value to list_set_files().

XXX list_set_files() needs to be rewritten.


(uebayasi)
diff -r1.96 -r1.97 src/distrib/sets/sets.subr

cvs diff -r1.96 -r1.97 src/distrib/sets/sets.subr (expand / switch to unified diff)

--- src/distrib/sets/sets.subr 2009/12/02 14:32:15 1.96
+++ src/distrib/sets/sets.subr 2009/12/02 15:05:55 1.97
@@ -1,16 +1,18 @@ @@ -1,16 +1,18 @@
1# $NetBSD: sets.subr,v 1.96 2009/12/02 14:32:15 uebayasi Exp $ 1# $NetBSD: sets.subr,v 1.97 2009/12/02 15:05:55 uebayasi Exp $
2# 2#
3 3
 4set -vx
 5
4# 6#
5# The following variables contain defaults for sets.subr functions and callers: 7# The following variables contain defaults for sets.subr functions and callers:
6# setsdir path to src/distrib/sets 8# setsdir path to src/distrib/sets
7# nlists list of base sets 9# nlists list of base sets
8# xlists list of x11 sets 10# xlists list of x11 sets
9# extlists list of extsrc sets 11# extlists list of extsrc sets
10# obsolete controls if obsolete files are selected instead 12# obsolete controls if obsolete files are selected instead
11# module if != "no", enable MODULE sets 13# module if != "no", enable MODULE sets
12# shlib shared library format (a.out, elf, or "") 14# shlib shared library format (a.out, elf, or "")
13# stlib static library format (a.out, elf) 15# stlib static library format (a.out, elf)
14# 16#
15# The following <bsd.own.mk> variables are exported to the environment: 17# The following <bsd.own.mk> variables are exported to the environment:
16# MACHINE  18# MACHINE
@@ -114,26 +116,35 @@ case "$(type printf)" in @@ -114,26 +116,35 @@ case "$(type printf)" in
114 case "$1" in 116 case "$1" in
115 ?*/*) dn="${1%/*}" ;; 117 ?*/*) dn="${1%/*}" ;;
116 /*) dn=/ ;; 118 /*) dn=/ ;;
117 *) dn=. ;; 119 *) dn=. ;;
118 esac 120 esac
119 echo "$dn" 121 echo "$dn"
120 } 122 }
121 ;; 123 ;;
122esac 124esac
123 125
124oIFS=$IFS 126oIFS=$IFS
125IFS=" 127IFS="
126" 128"
 129for i in _MKVARS.yes _MKVARS.no; do
 130 eval $(
 131${MAKE} -B -f- all <<EOMAKE
 132.include <bsd.own.mk>
 133all:
 134 @echo "export _MKVARS_${i#*.}=\"\${$i}\""
 135EOMAKE
 136)
 137done
127for x in $( 138for x in $(
128${MAKE} -B -f- all <<EOMAKE 139${MAKE} -B -f- all <<EOMAKE
129.include <bsd.own.mk> 140.include <bsd.own.mk>
130.if (\${MKMAN} == "no" || empty(MANINSTALL:Mmaninstall)) 141.if (\${MKMAN} == "no" || empty(MANINSTALL:Mmaninstall))
131MKMANPAGES=no 142MKMANPAGES=no
132.else 143.else
133MKMANPAGES=yes 144MKMANPAGES=yes
134.endif 145.endif
135.if \${MKX11} != "no" 146.if \${MKX11} != "no"
136. if \${X11FLAVOUR} == "Xorg" 147. if \${X11FLAVOUR} == "Xorg"
137MKXORG:=yes 148MKXORG:=yes
138MKX11:=no 149MKX11:=no
139. else 150. else
@@ -187,27 +198,27 @@ extlists="extbase extcomp extetc" @@ -187,27 +198,27 @@ extlists="extbase extcomp extetc"
187OSRELEASE=`${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh` 198OSRELEASE=`${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh`
188MODULEDIR="stand/${MACHINE}/${OSRELEASE}/modules" 199MODULEDIR="stand/${MACHINE}/${OSRELEASE}/modules"
189SUBST="s#@MODULEDIR@#${MODULEDIR}#g" 200SUBST="s#@MODULEDIR@#${MODULEDIR}#g"
190SUBST="${SUBST};s#@OSRELEASE@#${OSRELEASE}#g" 201SUBST="${SUBST};s#@OSRELEASE@#${OSRELEASE}#g"
191SUBST="${SUBST};s#@MACHINE@#${MACHINE}#g" 202SUBST="${SUBST};s#@MACHINE@#${MACHINE}#g"
192 203
193# 204#
194# list_set_files setfile [...] 205# list_set_files setfile [...]
195#  206#
196# Produce a packing list for setfile(s). 207# Produce a packing list for setfile(s).
197# In each file, a record consists of a path and a System Package name, 208# In each file, a record consists of a path and a System Package name,
198# separated by whitespace. E.g., 209# separated by whitespace. E.g.,
199# 210#
200# # $NetBSD: sets.subr,v 1.96 2009/12/02 14:32:15 uebayasi Exp $ 211# # $NetBSD: sets.subr,v 1.97 2009/12/02 15:05:55 uebayasi Exp $
201# . base-sys-root [keyword[,...]] 212# . base-sys-root [keyword[,...]]
202# ./altroot base-sys-root 213# ./altroot base-sys-root
203# ./bin base-sys-root 214# ./bin base-sys-root
204# ./bin/[ base-util-root 215# ./bin/[ base-util-root
205# ./bin/cat base-util-root 216# ./bin/cat base-util-root
206# [...] 217# [...]
207# 218#
208# A # in the first column marks a comment. 219# A # in the first column marks a comment.
209# 220#
210# If ${obsolete} != 0, only entries with an "obsolete" keyword will 221# If ${obsolete} != 0, only entries with an "obsolete" keyword will
211# be printed. All other keywords must be present. 222# be printed. All other keywords must be present.
212# 223#
213# The third field is an optional comma separated list of keywords to 224# The third field is an optional comma separated list of keywords to
@@ -288,27 +299,27 @@ list_set_files() @@ -288,27 +299,27 @@ list_set_files()
288 list=`list_set_lists $setname` 299 list=`list_set_lists $setname`
289 for l in $list; do 300 for l in $list; do
290 echo $l 301 echo $l
291 if $verbose; then 302 if $verbose; then
292 echo >&2 "DEBUG: list_set_files: $l" 303 echo >&2 "DEBUG: list_set_files: $l"
293 fi 304 fi
294 done 305 done
295 done | xargs cat | ${SED} ${SUBST} | \ 306 done | xargs cat | ${SED} ${SUBST} | \
296 ${AWK} -v obsolete=${obsolete} ' 307 ${AWK} -v obsolete=${obsolete} '
297 BEGIN { 308 BEGIN {
298 if (obsolete) 309 if (obsolete)
299 wanted["obsolete"] = 1 310 wanted["obsolete"] = 1
300  311
301 split("'"${MKVARS}"'", needvars) 312 split("'"${MKEXTRAVARS} ${_MKVARS_yes} ${_MKVARS_no}"'", needvars)
302 for (vi in needvars) { 313 for (vi in needvars) {
303 nv = needvars[vi] 314 nv = needvars[vi]
304 kw = tolower(nv) 315 kw = tolower(nv)
305 sub(/^mk/, "", kw) 316 sub(/^mk/, "", kw)
306 if (ENVIRON[nv] != "no") 317 if (ENVIRON[nv] != "no")
307 wanted[kw] = 1  318 wanted[kw] = 1
308 } 319 }
309 320
310 if ("'"${TOOLCHAIN_MISSING}"'" != "yes") { 321 if ("'"${TOOLCHAIN_MISSING}"'" != "yes") {
311 if ("binutils" in wanted) 322 if ("binutils" in wanted)
312 wanted["binutils=" "'"${HAVE_BINUTILS}"'"] = 1 323 wanted["binutils=" "'"${HAVE_BINUTILS}"'"] = 1
313 if ("gcc" in wanted) 324 if ("gcc" in wanted)
314 wanted["gcc=" "'"${HAVE_GCC}"'"] = 1 325 wanted["gcc=" "'"${HAVE_GCC}"'"] = 1