Module Name:    src
Committed By:   cegger
Date:           Sat Dec  5 15:56:25 UTC 2009

Modified Files:
        src/distrib/sets: makeflist makeobsolete maketars

Log Message:
Fix syntax error on OSX 10.5.
While here, simplify handling with OPTARG using IFS.

developped with and 'go for it' dsl@


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/distrib/sets/makeflist
cvs rdiff -u -r1.30 -r1.31 src/distrib/sets/makeobsolete
cvs rdiff -u -r1.71 -r1.72 src/distrib/sets/maketars

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/makeflist
diff -u src/distrib/sets/makeflist:1.75 src/distrib/sets/makeflist:1.76
--- src/distrib/sets/makeflist:1.75	Mon Nov 30 16:13:23 2009
+++ src/distrib/sets/makeflist	Sat Dec  5 15:56:25 2009
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: makeflist,v 1.75 2009/11/30 16:13:23 uebayasi Exp $
+# $NetBSD: makeflist,v 1.76 2009/12/05 15:56:25 cegger Exp $
 #
 # Print out the files in some or all lists.
 # Usage: makeflist [-bxlo] [-a arch] [-m machine] [-s setsdir] [setname ...]
@@ -8,7 +8,7 @@
 
 rundir="$(dirname "$0")" # ${0%/*} isn't good enough when there's no "/"
 . "${rundir}/sets.subr"
-lists="${nlists}"
+lists=
 
 usage()
 {
@@ -32,15 +32,16 @@
 while getopts L:bxXloa:m:s: ch; do
 	case ${ch} in
 	L)
-		lists=$(
-			for _list in $( echo ${OPTARG} | tr , ' ' ); do
-				case $_list in
-				base)	echo "${nlists}" ;;
-				x)	echo "${xlists}" ;;
-				ext)	echo "${extlists}" ;;
-				esac
-			done
-		)
+		save_IFS="${IFS}"
+		IFS=,
+		for _list in ${OPTARG}; do
+			case $_list in
+			base)	lists="${lists} ${nlists}" ;;
+			x)	lists="${lists} ${xlists}" ;;
+			ext)	lists="${lists} ${extlists}" ;;
+			esac
+		done
+		IFS="${save_IFS}"
 		;;
 	# backward compat
 	b)
@@ -83,4 +84,4 @@
 	exit 0
 fi
 
-list_set_files ${lists} | ${AWK} '{print $1}' | ${SORT} -u
+list_set_files ${lists:-${nlists}} | ${AWK} '{print $1}' | ${SORT} -u

Index: src/distrib/sets/makeobsolete
diff -u src/distrib/sets/makeobsolete:1.30 src/distrib/sets/makeobsolete:1.31
--- src/distrib/sets/makeobsolete:1.30	Mon Nov 30 16:13:23 2009
+++ src/distrib/sets/makeobsolete	Sat Dec  5 15:56:25 2009
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: makeobsolete,v 1.30 2009/11/30 16:13:23 uebayasi Exp $
+# $NetBSD: makeobsolete,v 1.31 2009/12/05 15:56:25 cegger Exp $
 #
 # Print out the obsolete files for a set
 # Usage: makeobsolete [-b] [-x] [-a arch] [-m machine] [-s setsdir] \
@@ -9,7 +9,7 @@
 
 rundir="$(dirname "$0")" # ${0%/*} isn't good enough when there's no "/"
 . "${rundir}/sets.subr"
-lists="${nlists}"
+lists=
 target=./dist
 obsolete=1
 
@@ -33,15 +33,16 @@
 while getopts L:bxya:m:s:t: ch; do
 	case ${ch} in
 	L)
-		lists=$(
-			for _list in $( echo ${OPTARG} | tr , ' ' ); do
-				case $_list in
-				base)	echo "${nlists}" ;;
-				x)	echo "${xlists}" ;;
-				ext)	echo "${extlists}" ;;
-				esac
-			done
-		)
+		save_IFS="${IFS}"
+		IFS=,
+		for _list in ${OPTARG}; do
+			case $_list in
+			base)	lists="${lists} ${nlists}" ;;
+			x)	lists="${lists} ${xlists}" ;;
+			ext)	lists="${lists} ${extlists}" ;;
+			esac
+		done
+		IFS="${save_IFS}"
 		;;
 	# backward compat
 	b)
@@ -81,7 +82,7 @@
 	exit 1
 fi
 
-for setname in ${lists}; do
+for setname in ${lists:-${nlists}}; do
 	file="${target}/${setname}"
 	list_set_files "${setname}" | ${AWK} '{print $1}' | \
 		${SORT} -ru > "${file}"

Index: src/distrib/sets/maketars
diff -u src/distrib/sets/maketars:1.71 src/distrib/sets/maketars:1.72
--- src/distrib/sets/maketars:1.71	Thu Dec  3 12:44:57 2009
+++ src/distrib/sets/maketars	Sat Dec  5 15:56:25 2009
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: maketars,v 1.71 2009/12/03 12:44:57 apb Exp $
+# $NetBSD: maketars,v 1.72 2009/12/05 15:56:25 cegger Exp $
 #
 # Make release tar files for some or all lists.  Usage:
 # maketars [-b] [-x] [-i installdir] [-a arch] [-m machine] [-s setsdir]
@@ -20,7 +20,7 @@
 . "${rundir}/sets.subr"
 
 # set defaults
-lists="${nlists}"
+lists=
 tars="${RELEASEDIR}"
 dest="${DESTDIR}"
 metalog=
@@ -64,15 +64,16 @@
 while getopts L:bxyi:a:m:qs:SM:N:d:t: ch; do
 	case ${ch} in
 	L)
-		lists=$(
-			for _list in $( echo ${OPTARG} | tr , ' ' ); do
-				case $_list in
-				base)	echo "${nlists}" ;;
-				x)	echo "${xlists}" ;;
-				ext)	echo "${extlists}" ;;
-				esac
-			done
-		)
+		save_IFS="${IFS}"
+		IFS=,
+		for _list in ${OPTARG}; do
+			case $_list in
+			base)	lists="${lists} ${nlists}" ;;
+			x)	lists="${lists} ${xlists}" ;;
+			ext)	lists="${lists} ${extlists}" ;;
+			esac
+		done
+		IFS="${save_IFS}"
 		;;
 	# backward compat
 	b)
@@ -198,7 +199,7 @@
 GZIP=-9n		# for pax -z
 export GZIP
 es=0
-for setname in ${lists}; do
+for setname in ${lists:-${nlists}}; do
 	out="${setname}.tgz"
 	if [ -n "${installdir}" ]; then
 		msg "Copying set ${setname}"

Reply via email to