diff options
| author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-04-25 08:43:01 +0000 |
|---|---|---|
| committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-04-25 08:43:01 +0000 |
| commit | 95842fbc163d935cc5f7dc67dd49bbe906c2eae4 (patch) | |
| tree | c65356f33af8e6df766bf95d55983ca87b97151f | |
| parent | a6b3a1f0bfc394a18b4cb4181a4827bf054206b4 (diff) | |
| download | busybox-w32-95842fbc163d935cc5f7dc67dd49bbe906c2eae4.tar.gz busybox-w32-95842fbc163d935cc5f7dc67dd49bbe906c2eae4.tar.bz2 busybox-w32-95842fbc163d935cc5f7dc67dd49bbe906c2eae4.zip | |
testsuite/runtest: remove (last) bashism
mkswap: fix selinux build
| -rwxr-xr-x | testsuite/runtest | 17 | ||||
| -rw-r--r-- | util-linux/mkswap.c | 2 |
2 files changed, 11 insertions, 8 deletions
diff --git a/testsuite/runtest b/testsuite/runtest index c668240eb..478764801 100755 --- a/testsuite/runtest +++ b/testsuite/runtest | |||
| @@ -9,12 +9,12 @@ | |||
| 9 | # Option -e will make testcase stop on the first failed command. | 9 | # Option -e will make testcase stop on the first failed command. |
| 10 | run_applet_testcase() | 10 | run_applet_testcase() |
| 11 | { | 11 | { |
| 12 | local applet=$1 | 12 | local applet="$1" |
| 13 | local testcase="$2" | 13 | local testcase="$2" |
| 14 | 14 | ||
| 15 | local status | 15 | local status |
| 16 | local uc_applet=$(echo $applet | tr a-z A-Z) | 16 | local uc_applet=$(echo $applet | tr a-z A-Z) |
| 17 | local testname=`basename "$testcase"` | 17 | local testname=$(basename "$testcase") |
| 18 | 18 | ||
| 19 | if grep -q "^# CONFIG_${uc_applet} is not set$" $bindir/.config; then | 19 | if grep -q "^# CONFIG_${uc_applet} is not set$" $bindir/.config; then |
| 20 | echo "UNTESTED: $testname" | 20 | echo "UNTESTED: $testname" |
| @@ -22,7 +22,7 @@ run_applet_testcase() | |||
| 22 | fi | 22 | fi |
| 23 | 23 | ||
| 24 | if grep -q "^# FEATURE: " "$testcase"; then | 24 | if grep -q "^# FEATURE: " "$testcase"; then |
| 25 | local feature=`sed -ne 's/^# FEATURE: //p' "$testcase"` | 25 | local feature=$(sed -ne 's/^# FEATURE: //p' "$testcase") |
| 26 | 26 | ||
| 27 | if grep -q "^# ${feature} is not set$" $bindir/.config; then | 27 | if grep -q "^# ${feature} is not set$" $bindir/.config; then |
| 28 | echo "UNTESTED: $testname" | 28 | echo "UNTESTED: $testname" |
| @@ -58,7 +58,7 @@ run_applet_tests() | |||
| 58 | local applet=$1 | 58 | local applet=$1 |
| 59 | local status=0 | 59 | local status=0 |
| 60 | for testcase in $tsdir/$applet/*; do | 60 | for testcase in $tsdir/$applet/*; do |
| 61 | case `basename "$testcase"` in | 61 | case $(basename "$testcase") in |
| 62 | \#*) | 62 | \#*) |
| 63 | continue | 63 | continue |
| 64 | ;; | 64 | ;; |
| @@ -130,9 +130,12 @@ for applet in $applets; do | |||
| 130 | 130 | ||
| 131 | # Is this a new-style test? | 131 | # Is this a new-style test? |
| 132 | if [ -f "${applet}.tests" ]; then | 132 | if [ -f "${applet}.tests" ]; then |
| 133 | if [ ! -h "$LINKSDIR/$applet" ] && [ "${applet:0:4}" != "all_" ]; then | 133 | if [ ! -h "$LINKSDIR/$applet" ]; then |
| 134 | echo "SKIPPED: $applet (not built)" | 134 | # (avoiding bash'ism "${applet:0:4}") |
| 135 | continue | 135 | if ! echo "$applet" | grep "^all_" >/dev/null; then |
| 136 | echo "SKIPPED: $applet (not built)" | ||
| 137 | continue | ||
| 138 | fi | ||
| 136 | fi | 139 | fi |
| 137 | # echo "Running test ${tsdir:-.}/${applet}.tests" | 140 | # echo "Running test ${tsdir:-.}/${applet}.tests" |
| 138 | PATH="$LINKSDIR:$tsdir:$bindir:$PATH" "${tsdir:-.}/${applet}.tests" | 141 | PATH="$LINKSDIR:$tsdir:$bindir:$PATH" "${tsdir:-.}/${applet}.tests" |
diff --git a/util-linux/mkswap.c b/util-linux/mkswap.c index 1c364efe9..11c411b6a 100644 --- a/util-linux/mkswap.c +++ b/util-linux/mkswap.c | |||
| @@ -23,7 +23,7 @@ static void mkswap_selinux_setcontext(int fd, const char *path) | |||
| 23 | security_context_t oldcon = NULL; | 23 | security_context_t oldcon = NULL; |
| 24 | context_t context; | 24 | context_t context; |
| 25 | 25 | ||
| 26 | if (fgetfilecon_raw(fd, &oldcon) < 0) { | 26 | if (fgetfilecon(fd, &oldcon) < 0) { |
| 27 | if (errno != ENODATA) | 27 | if (errno != ENODATA) |
| 28 | goto error; | 28 | goto error; |
| 29 | if (matchpathcon(path, stbuf.st_mode, &oldcon) < 0) | 29 | if (matchpathcon(path, stbuf.st_mode, &oldcon) < 0) |
