randomconfig fixes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2011-08-10 00:51:29 +02:00
parent b347df9131
commit b47b3ce1bd
8 changed files with 32 additions and 8 deletions

View File

@ -924,7 +924,7 @@ int tar_main(int argc UNUSED_PARAM, char **argv)
/* Prepend '-' to the first argument if required */ /* Prepend '-' to the first argument if required */
opt_complementary = "--:" // first arg is options opt_complementary = "--:" // first arg is options
"tt:vv:" // count -t,-v "tt:vv:" // count -t,-v
"X::T::" // cumulative lists IF_FEATURE_TAR_FROM("X::T::") // cumulative lists
#if ENABLE_FEATURE_TAR_LONG_OPTIONS && ENABLE_FEATURE_TAR_FROM #if ENABLE_FEATURE_TAR_LONG_OPTIONS && ENABLE_FEATURE_TAR_FROM
"\xff::" // cumulative lists for --exclude "\xff::" // cumulative lists for --exclude
#endif #endif

View File

@ -1111,7 +1111,7 @@ int ls_main(int argc UNUSED_PARAM, char **argv)
IF_FEATURE_LS_COLOR(applet_long_options = ls_longopts;) IF_FEATURE_LS_COLOR(applet_long_options = ls_longopts;)
opt_complementary = opt_complementary =
/* -e implies -l */ /* -e implies -l */
"el" IF_FEATURE_LS_TIMESTAMPS("el")
/* http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ls.html: /* http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ls.html:
* in some pairs of opts, only last one takes effect: * in some pairs of opts, only last one takes effect:
*/ */
@ -1121,7 +1121,7 @@ int ls_main(int argc UNUSED_PARAM, char **argv)
":C-xl:x-Cl:l-xC" /* bycols/bylines/long */ ":C-xl:x-Cl:l-xC" /* bycols/bylines/long */
":C-1:1-C" /* bycols/oneline */ ":C-1:1-C" /* bycols/oneline */
":x-1:1-x" /* bylines/oneline (not in SuS, but in GNU coreutils 8.4) */ ":x-1:1-x" /* bylines/oneline (not in SuS, but in GNU coreutils 8.4) */
":c-u:u-c" /* mtime/atime */ IF_FEATURE_LS_TIMESTAMPS(":c-u:u-c") /* mtime/atime */
/* -w NUM: */ /* -w NUM: */
IF_FEATURE_AUTOWIDTH(":w+"); IF_FEATURE_AUTOWIDTH(":w+");
opt = getopt32(argv, ls_options opt = getopt32(argv, ls_options

View File

@ -467,13 +467,17 @@ getopt32(char **argv, const char *applet_opts, ...)
} }
for (on_off = complementary; on_off->opt_char; on_off++) for (on_off = complementary; on_off->opt_char; on_off++)
if (on_off->opt_char == *s) if (on_off->opt_char == *s)
break; goto found_opt;
/* Without this, diagnostic of such bugs is not easy */
bb_error_msg_and_die("NO OPT %c!", *s);
found_opt:
if (c == ':' && s[2] == ':') { if (c == ':' && s[2] == ':') {
on_off->param_type = PARAM_LIST; on_off->param_type = PARAM_LIST;
continue; continue;
} }
if (c == '+' && (s[2] == ':' || s[2] == '\0')) { if (c == '+' && (s[2] == ':' || s[2] == '\0')) {
on_off->param_type = PARAM_INT; on_off->param_type = PARAM_INT;
s++;
continue; continue;
} }
if (c == ':' || c == '\0') { if (c == ':' || c == '\0') {

View File

@ -5,4 +5,17 @@ while test x"$dt" = x"$dt1"; do
dt="`date -R`" dt="`date -R`"
done done
test x"$dt" = x"`busybox date -R`" bdt=`busybox date -R`
bdt=`busybox date -R`
bdt=`busybox date -R`
bdt=`busybox date -R`
bdt=`busybox date -R`
# Wtih !FEATURE_DATE_NANO, that is, with time()
# instead of clock_gettime(), seconds transition
# may not happen at _exactly_ the same moment,
# but can be delayed. Several busybox date -R
# invocations above are meant to deal with this.
# (two were enough for me, but I added more just in case).
test x"$dt" = x"$bdt"

View File

@ -256,7 +256,8 @@ mkdir ls.testdir || exit 1
# testing "test name" "command" "expected result" "file input" "stdin" # testing "test name" "command" "expected result" "file input" "stdin"
testing "ls symlink_to_dir" \ test x"$CONFIG_FEATURE_LS_SORTFILES" = x"y" \
&& testing "ls symlink_to_dir" \
"touch ls.testdir/A ls.testdir/B; ln -s ls.testdir ls.link; ls ls.link; ls -1 ls.link/; ls -1 ls.link; rm -f ls.link" \ "touch ls.testdir/A ls.testdir/B; ln -s ls.testdir ls.link; ls ls.link; ls -1 ls.link/; ls -1 ls.link; rm -f ls.link" \
"A\nB\nA\nB\nA\nB\n" \ "A\nB\nA\nB\nA\nB\n" \
"" "" "" ""

View File

@ -46,6 +46,7 @@ rm mount.image1m
# Bug: mount.shared1 directory shows no files (has to show files a and b) # Bug: mount.shared1 directory shows no files (has to show files a and b)
optional FEATURE_LS_RECURSIVE
testing "mount bind+rshared" "\ testing "mount bind+rshared" "\
mkdir -p mount.dir mount.shared1 mount.shared2 mkdir -p mount.dir mount.shared1 mount.shared2
touch mount.dir/a mount.dir/b touch mount.dir/a mount.dir/b
@ -80,5 +81,6 @@ a
b b
" \ " \
"" "" "" ""
SKIP=
exit $FAILCOUNT exit $FAILCOUNT

View File

@ -16,7 +16,7 @@ testing "od -b" \
"" "HELLO" "" "HELLO"
SKIP= SKIP=
optional DESKTOP optional DESKTOP LONG_OPTS
testing "od -b --traditional" \ testing "od -b --traditional" \
"od -b --traditional" \ "od -b --traditional" \
"\ "\
@ -26,7 +26,7 @@ testing "od -b --traditional" \
"" "HELLO" "" "HELLO"
SKIP= SKIP=
optional DESKTOP optional DESKTOP LONG_OPTS
testing "od -b --traditional FILE" \ testing "od -b --traditional FILE" \
"od -b --traditional input" \ "od -b --traditional input" \
"\ "\

View File

@ -156,6 +156,7 @@ SKIP=
# Had a bug where on extract autodetect first "switched off" -z # Had a bug where on extract autodetect first "switched off" -z
# and then failed to recognize .tgz extension # and then failed to recognize .tgz extension
optional FEATURE_TAR_CREATE FEATURE_SEAMLESS_GZ
testing "tar extract tgz" "\ testing "tar extract tgz" "\
dd count=1 bs=1M if=/dev/zero of=F0 2>/dev/null dd count=1 bs=1M if=/dev/zero of=F0 2>/dev/null
tar -czf F0.tgz F0 tar -czf F0.tgz F0
@ -167,8 +168,10 @@ F0
Ok Ok
" \ " \
"" "" "" ""
SKIP=
# On extract, everything up to and including last ".." component is stripped # On extract, everything up to and including last ".." component is stripped
optional FEATURE_TAR_CREATE
testing "tar strips /../ on extract" "\ testing "tar strips /../ on extract" "\
rm -rf input_* test.tar 2>/dev/null rm -rf input_* test.tar 2>/dev/null
mkdir input_dir mkdir input_dir
@ -184,6 +187,7 @@ input_dir/file
Ok Ok
" \ " \
"" "" "" ""
SKIP=
cd .. && rm -rf tar.tempdir || exit 1 cd .. && rm -rf tar.tempdir || exit 1