svn commit: trunk/busybox: testsuite util-linux

vda at busybox.net vda at busybox.net
Fri Apr 25 08:43:01 UTC 2008


Author: vda
Date: 2008-04-25 01:43:01 -0700 (Fri, 25 Apr 2008)
New Revision: 21856

Log:
testsuite/runtest: remove (last) bashism
mkswap: fix selinux build



Modified:
   trunk/busybox/testsuite/runtest
   trunk/busybox/util-linux/mkswap.c


Changeset:
Modified: trunk/busybox/testsuite/runtest
===================================================================
--- trunk/busybox/testsuite/runtest	2008-04-25 08:13:36 UTC (rev 21855)
+++ trunk/busybox/testsuite/runtest	2008-04-25 08:43:01 UTC (rev 21856)
@@ -9,12 +9,12 @@
 # Option -e will make testcase stop on the first failed command.
 run_applet_testcase()
 {
-	local applet=$1
+	local applet="$1"
 	local testcase="$2"
 
 	local status
 	local uc_applet=$(echo $applet | tr a-z A-Z)
-	local testname=`basename "$testcase"`
+	local testname=$(basename "$testcase")
 
 	if grep -q "^# CONFIG_${uc_applet} is not set$" $bindir/.config; then
 		echo "UNTESTED: $testname"
@@ -22,7 +22,7 @@
 	fi
 
 	if grep -q "^# FEATURE: " "$testcase"; then
-		local feature=`sed -ne 's/^# FEATURE: //p' "$testcase"`
+		local feature=$(sed -ne 's/^# FEATURE: //p' "$testcase")
 
 		if grep -q "^# ${feature} is not set$" $bindir/.config; then
 			echo "UNTESTED: $testname"
@@ -58,7 +58,7 @@
 	local applet=$1
 	local status=0
 	for testcase in $tsdir/$applet/*; do
-		case `basename "$testcase"` in
+		case $(basename "$testcase") in
 			\#*)
 				continue
 				;;
@@ -130,9 +130,12 @@
 
 	# Is this a new-style test?
 	if [ -f "${applet}.tests" ]; then
-		if [ ! -h "$LINKSDIR/$applet" ] && [ "${applet:0:4}" != "all_" ]; then
-			echo "SKIPPED: $applet (not built)"
-			continue
+		if [ ! -h "$LINKSDIR/$applet" ]; then
+			# (avoiding bash'ism "${applet:0:4}")
+			if ! echo "$applet" | grep "^all_" >/dev/null; then
+				echo "SKIPPED: $applet (not built)"
+				continue
+			fi
 		fi
 #		echo "Running test ${tsdir:-.}/${applet}.tests"
 		PATH="$LINKSDIR:$tsdir:$bindir:$PATH" "${tsdir:-.}/${applet}.tests"

Modified: trunk/busybox/util-linux/mkswap.c
===================================================================
--- trunk/busybox/util-linux/mkswap.c	2008-04-25 08:13:36 UTC (rev 21855)
+++ trunk/busybox/util-linux/mkswap.c	2008-04-25 08:43:01 UTC (rev 21856)
@@ -23,7 +23,7 @@
 		security_context_t oldcon = NULL;
 		context_t context;
 
-		if (fgetfilecon_raw(fd, &oldcon) < 0) {
+		if (fgetfilecon(fd, &oldcon) < 0) {
 			if (errno != ENODATA)
 				goto error;
 			if (matchpathcon(path, stbuf.st_mode, &oldcon) < 0)




More information about the busybox-cvs mailing list