Module Name:    src
Committed By:   uebayasi
Date:           Fri Dec 11 13:10:07 UTC 2009

Modified Files:
        src/distrib/sets: sets.subr

Log Message:
Refactor list_set_lists using more functions.


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/distrib/sets/sets.subr

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/sets.subr
diff -u src/distrib/sets/sets.subr:1.110 src/distrib/sets/sets.subr:1.111
--- src/distrib/sets/sets.subr:1.110	Fri Dec 11 12:57:39 2009
+++ src/distrib/sets/sets.subr	Fri Dec 11 13:10:06 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: sets.subr,v 1.110 2009/12/11 12:57:39 uebayasi Exp $
+#	$NetBSD: sets.subr,v 1.111 2009/12/11 13:10:06 uebayasi Exp $
 #
 
 #
@@ -178,7 +178,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.110 2009/12/11 12:57:39 uebayasi Exp $
+# 	# $NetBSD: sets.subr,v 1.111 2009/12/11 13:10:06 uebayasi Exp $
 # 	.			base-sys-root	[keyword[,...]]
 # 	./altroot		base-sys-root
 # 	./bin			base-sys-root
@@ -385,11 +385,33 @@
 {
 	setname=$1
 
-	setdir=$setsdir/lists/$setname
+	list_set_lists_mi $setname
+	if [ "${MACHINE}" != "${MACHINE_ARCH}" ]; then
+		list_set_lists_ad $setname
+	fi
+	list_set_lists_md $setname
+	list_set_lists_stl $setname
+	if [ "$shlib" != "no" ]; then
+		list_set_lists_shl $setname
+	fi
+	if [ "$module" != "no" ]; then
+		list_set_lists_module $setname
+	fi
+	list_set_lists_rescue $setname
+	if [ "${MACHINE}" != "${MACHINE_ARCH}" ]; then
+		list_set_lists_rescue_ad $setname
+	fi
+}
 
+list_set_lists_mi()
+{
+	setdir=$setsdir/lists/$1
 	echo $setdir/mi
+}
 
-	if [ "${MACHINE}" != "${MACHINE_ARCH}" ]; then
+list_set_lists_ad()
+{
+	setdir=$setsdir/lists/$1
 		# Prefer an ad.${MACHINE_ARCH} over an ad.${MACHINE_CPU},
 		# since the arch-specific one will be more specific than
 		# the cpu-specific one.
@@ -398,20 +420,32 @@
 		if [ "$shlib" != "no" ]; then
 			echo_if_exist $setdir/ad.${MACHINE_CPU}.shl
 		fi
-	fi
+}
 
+list_set_lists_md()
+{
+	setdir=$setsdir/lists/$1
 	echo_if_exist $setdir/md.${MACHINE}.${MACHINE_ARCH} || \
 	echo_if_exist $setdir/md.${MACHINE}
+}
 
+list_set_lists_stl()
+{
+	setdir=$setsdir/lists/$1
 	echo_if_exist $setdir/stl.mi
 	echo_if_exist $setdir/stl.${stlib}
+}
 
-	if [ "$shlib" != "no" ]; then
+list_set_lists_shl()
+{
+	setdir=$setsdir/lists/$1
 		echo_if_exist $setdir/shl.mi
 		echo_if_exist $setdir/shl.${shlib}
-	fi
+}
 
-	if [ "$module" != "no" ]; then
+list_set_lists_module()
+{
+	setdir=$setsdir/lists/$1
 		echo_if_exist $setdir/module.mi
 		echo_if_exist $setdir/module.${MACHINE}
 		if [ "${MACHINE}" != "${MACHINE_ARCH}" ]; then
@@ -422,11 +456,18 @@
 			echo_if_exist $setdir/module.ad.${MACHINE_ARCH} || \
 			echo_if_exist $setdir/module.ad.${MACHINE_CPU}
 		fi
-	fi
+}
 
+list_set_lists_rescue()
+{
+	setdir=$setsdir/lists/$1
 	echo_if_exist $setdir/rescue.mi
 	echo_if_exist $setdir/rescue.${MACHINE}
-	if [ "${MACHINE}" != "${MACHINE_ARCH}" ]; then
+}
+
+list_set_lists_rescue_ad()
+{
+	setdir=$setsdir/lists/$1
 		# Prefer a rescue.ad.${MACHINE_ARCH} over a
 		# rescue.ad.${MACHINE_CPU}, since the arch-
 		# specific one will be more specific than the
@@ -436,7 +477,6 @@
 		if [ "$shlib" != "no" ]; then
 			echo_if_exist $setdir/rescue.ad.${MACHINE_CPU}.shl
 		fi
-	fi
 }
 
 echo_if_exist()

Reply via email to