diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-01-10 15:13:30 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-01-10 15:13:30 +0100 |
commit | 265062d59dd46065ad34519f04615fb2cecefe8a (patch) | |
tree | 6f5d8a3f87a9718b06dca325554410a3337f5b0f | |
parent | f560422fa079b07a761a572ca4f9cf287c2cc47e (diff) | |
download | busybox-w32-265062d59dd46065ad34519f04615fb2cecefe8a.tar.gz busybox-w32-265062d59dd46065ad34519f04615fb2cecefe8a.tar.bz2 busybox-w32-265062d59dd46065ad34519f04615fb2cecefe8a.zip |
shells: make hush test optional, rename ASH_BUILTIN_foo -> ASH_foo
This makes hash and ash more symmetrical wrt config menu and config
options.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | configs/TEST_nommu_defconfig | 6 | ||||
-rw-r--r-- | configs/TEST_noprintf_defconfig | 6 | ||||
-rw-r--r-- | configs/TEST_rh9_defconfig | 6 | ||||
-rw-r--r-- | configs/android2_defconfig | 6 | ||||
-rw-r--r-- | configs/android_502_defconfig | 6 | ||||
-rw-r--r-- | configs/android_defconfig | 6 | ||||
-rw-r--r-- | configs/android_ndk_defconfig | 6 | ||||
-rw-r--r-- | configs/cygwin_defconfig | 6 | ||||
-rw-r--r-- | configs/freebsd_defconfig | 6 | ||||
-rw-r--r-- | coreutils/Kbuild.src | 6 | ||||
-rw-r--r-- | coreutils/echo.c | 5 | ||||
-rw-r--r-- | coreutils/printf.c | 5 | ||||
-rw-r--r-- | coreutils/test.c | 17 | ||||
-rw-r--r-- | shell/ash.c | 26 | ||||
-rw-r--r-- | shell/hush.c | 16 | ||||
-rwxr-xr-x | testsuite/mdev.tests | 2 |
16 files changed, 72 insertions, 59 deletions
diff --git a/configs/TEST_nommu_defconfig b/configs/TEST_nommu_defconfig index 08351a294..d9ec41cd0 100644 --- a/configs/TEST_nommu_defconfig +++ b/configs/TEST_nommu_defconfig | |||
@@ -879,9 +879,9 @@ CONFIG_FEATURE_SH_IS_HUSH=y | |||
879 | # CONFIG_ASH_JOB_CONTROL is not set | 879 | # CONFIG_ASH_JOB_CONTROL is not set |
880 | # CONFIG_ASH_ALIAS is not set | 880 | # CONFIG_ASH_ALIAS is not set |
881 | # CONFIG_ASH_GETOPTS is not set | 881 | # CONFIG_ASH_GETOPTS is not set |
882 | # CONFIG_ASH_BUILTIN_ECHO is not set | 882 | # CONFIG_ASH_ECHO is not set |
883 | # CONFIG_ASH_BUILTIN_PRINTF is not set | 883 | # CONFIG_ASH_PRINTF is not set |
884 | # CONFIG_ASH_BUILTIN_TEST is not set | 884 | # CONFIG_ASH_TEST is not set |
885 | # CONFIG_ASH_CMDCMD is not set | 885 | # CONFIG_ASH_CMDCMD is not set |
886 | # CONFIG_ASH_MAIL is not set | 886 | # CONFIG_ASH_MAIL is not set |
887 | # CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set | 887 | # CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set |
diff --git a/configs/TEST_noprintf_defconfig b/configs/TEST_noprintf_defconfig index 70dacece0..c7330ed5d 100644 --- a/configs/TEST_noprintf_defconfig +++ b/configs/TEST_noprintf_defconfig | |||
@@ -873,9 +873,9 @@ CONFIG_SV_DEFAULT_SERVICE_DIR="" | |||
873 | # CONFIG_ASH_JOB_CONTROL is not set | 873 | # CONFIG_ASH_JOB_CONTROL is not set |
874 | # CONFIG_ASH_ALIAS is not set | 874 | # CONFIG_ASH_ALIAS is not set |
875 | # CONFIG_ASH_GETOPTS is not set | 875 | # CONFIG_ASH_GETOPTS is not set |
876 | # CONFIG_ASH_BUILTIN_ECHO is not set | 876 | # CONFIG_ASH_ECHO is not set |
877 | # CONFIG_ASH_BUILTIN_PRINTF is not set | 877 | # CONFIG_ASH_PRINTF is not set |
878 | # CONFIG_ASH_BUILTIN_TEST is not set | 878 | # CONFIG_ASH_TEST is not set |
879 | # CONFIG_ASH_CMDCMD is not set | 879 | # CONFIG_ASH_CMDCMD is not set |
880 | # CONFIG_ASH_MAIL is not set | 880 | # CONFIG_ASH_MAIL is not set |
881 | # CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set | 881 | # CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set |
diff --git a/configs/TEST_rh9_defconfig b/configs/TEST_rh9_defconfig index 4a5fad324..86e13cd53 100644 --- a/configs/TEST_rh9_defconfig +++ b/configs/TEST_rh9_defconfig | |||
@@ -893,9 +893,9 @@ CONFIG_ASH_BASH_COMPAT=y | |||
893 | CONFIG_ASH_JOB_CONTROL=y | 893 | CONFIG_ASH_JOB_CONTROL=y |
894 | CONFIG_ASH_ALIAS=y | 894 | CONFIG_ASH_ALIAS=y |
895 | CONFIG_ASH_GETOPTS=y | 895 | CONFIG_ASH_GETOPTS=y |
896 | CONFIG_ASH_BUILTIN_ECHO=y | 896 | CONFIG_ASH_ECHO=y |
897 | CONFIG_ASH_BUILTIN_PRINTF=y | 897 | CONFIG_ASH_PRINTF=y |
898 | CONFIG_ASH_BUILTIN_TEST=y | 898 | CONFIG_ASH_TEST=y |
899 | CONFIG_ASH_CMDCMD=y | 899 | CONFIG_ASH_CMDCMD=y |
900 | # CONFIG_ASH_MAIL is not set | 900 | # CONFIG_ASH_MAIL is not set |
901 | CONFIG_ASH_OPTIMIZE_FOR_SIZE=y | 901 | CONFIG_ASH_OPTIMIZE_FOR_SIZE=y |
diff --git a/configs/android2_defconfig b/configs/android2_defconfig index 754f612c6..9338f66ac 100644 --- a/configs/android2_defconfig +++ b/configs/android2_defconfig | |||
@@ -936,9 +936,9 @@ CONFIG_SOFTLIMIT=y | |||
936 | # CONFIG_ASH_JOB_CONTROL is not set | 936 | # CONFIG_ASH_JOB_CONTROL is not set |
937 | # CONFIG_ASH_ALIAS is not set | 937 | # CONFIG_ASH_ALIAS is not set |
938 | # CONFIG_ASH_GETOPTS is not set | 938 | # CONFIG_ASH_GETOPTS is not set |
939 | # CONFIG_ASH_BUILTIN_ECHO is not set | 939 | # CONFIG_ASH_ECHO is not set |
940 | # CONFIG_ASH_BUILTIN_PRINTF is not set | 940 | # CONFIG_ASH_PRINTF is not set |
941 | # CONFIG_ASH_BUILTIN_TEST is not set | 941 | # CONFIG_ASH_TEST is not set |
942 | # CONFIG_ASH_CMDCMD is not set | 942 | # CONFIG_ASH_CMDCMD is not set |
943 | # CONFIG_ASH_MAIL is not set | 943 | # CONFIG_ASH_MAIL is not set |
944 | # CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set | 944 | # CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set |
diff --git a/configs/android_502_defconfig b/configs/android_502_defconfig index 8ea6c295d..316063440 100644 --- a/configs/android_502_defconfig +++ b/configs/android_502_defconfig | |||
@@ -1081,9 +1081,9 @@ CONFIG_ASH_BASH_COMPAT=y | |||
1081 | CONFIG_ASH_JOB_CONTROL=y | 1081 | CONFIG_ASH_JOB_CONTROL=y |
1082 | CONFIG_ASH_ALIAS=y | 1082 | CONFIG_ASH_ALIAS=y |
1083 | CONFIG_ASH_GETOPTS=y | 1083 | CONFIG_ASH_GETOPTS=y |
1084 | CONFIG_ASH_BUILTIN_ECHO=y | 1084 | CONFIG_ASH_ECHO=y |
1085 | CONFIG_ASH_BUILTIN_PRINTF=y | 1085 | CONFIG_ASH_PRINTF=y |
1086 | CONFIG_ASH_BUILTIN_TEST=y | 1086 | CONFIG_ASH_TEST=y |
1087 | CONFIG_ASH_HELP=y | 1087 | CONFIG_ASH_HELP=y |
1088 | CONFIG_ASH_CMDCMD=y | 1088 | CONFIG_ASH_CMDCMD=y |
1089 | # CONFIG_ASH_MAIL is not set | 1089 | # CONFIG_ASH_MAIL is not set |
diff --git a/configs/android_defconfig b/configs/android_defconfig index 30e888ac7..cd3490c4e 100644 --- a/configs/android_defconfig +++ b/configs/android_defconfig | |||
@@ -968,9 +968,9 @@ CONFIG_SOFTLIMIT=y | |||
968 | # CONFIG_ASH_JOB_CONTROL is not set | 968 | # CONFIG_ASH_JOB_CONTROL is not set |
969 | # CONFIG_ASH_ALIAS is not set | 969 | # CONFIG_ASH_ALIAS is not set |
970 | # CONFIG_ASH_GETOPTS is not set | 970 | # CONFIG_ASH_GETOPTS is not set |
971 | # CONFIG_ASH_BUILTIN_ECHO is not set | 971 | # CONFIG_ASH_ECHO is not set |
972 | # CONFIG_ASH_BUILTIN_PRINTF is not set | 972 | # CONFIG_ASH_PRINTF is not set |
973 | # CONFIG_ASH_BUILTIN_TEST is not set | 973 | # CONFIG_ASH_TEST is not set |
974 | # CONFIG_ASH_CMDCMD is not set | 974 | # CONFIG_ASH_CMDCMD is not set |
975 | # CONFIG_ASH_MAIL is not set | 975 | # CONFIG_ASH_MAIL is not set |
976 | # CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set | 976 | # CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set |
diff --git a/configs/android_ndk_defconfig b/configs/android_ndk_defconfig index 716ec9a5d..f2773be46 100644 --- a/configs/android_ndk_defconfig +++ b/configs/android_ndk_defconfig | |||
@@ -996,9 +996,9 @@ CONFIG_SOFTLIMIT=y | |||
996 | # CONFIG_ASH_JOB_CONTROL is not set | 996 | # CONFIG_ASH_JOB_CONTROL is not set |
997 | # CONFIG_ASH_ALIAS is not set | 997 | # CONFIG_ASH_ALIAS is not set |
998 | # CONFIG_ASH_GETOPTS is not set | 998 | # CONFIG_ASH_GETOPTS is not set |
999 | # CONFIG_ASH_BUILTIN_ECHO is not set | 999 | # CONFIG_ASH_ECHO is not set |
1000 | # CONFIG_ASH_BUILTIN_PRINTF is not set | 1000 | # CONFIG_ASH_PRINTF is not set |
1001 | # CONFIG_ASH_BUILTIN_TEST is not set | 1001 | # CONFIG_ASH_TEST is not set |
1002 | # CONFIG_ASH_HELP is not set | 1002 | # CONFIG_ASH_HELP is not set |
1003 | # CONFIG_ASH_CMDCMD is not set | 1003 | # CONFIG_ASH_CMDCMD is not set |
1004 | # CONFIG_ASH_MAIL is not set | 1004 | # CONFIG_ASH_MAIL is not set |
diff --git a/configs/cygwin_defconfig b/configs/cygwin_defconfig index b856482f6..816f76e65 100644 --- a/configs/cygwin_defconfig +++ b/configs/cygwin_defconfig | |||
@@ -936,9 +936,9 @@ CONFIG_ASH_BASH_COMPAT=y | |||
936 | CONFIG_ASH_JOB_CONTROL=y | 936 | CONFIG_ASH_JOB_CONTROL=y |
937 | CONFIG_ASH_ALIAS=y | 937 | CONFIG_ASH_ALIAS=y |
938 | CONFIG_ASH_GETOPTS=y | 938 | CONFIG_ASH_GETOPTS=y |
939 | CONFIG_ASH_BUILTIN_ECHO=y | 939 | CONFIG_ASH_ECHO=y |
940 | CONFIG_ASH_BUILTIN_PRINTF=y | 940 | CONFIG_ASH_PRINTF=y |
941 | CONFIG_ASH_BUILTIN_TEST=y | 941 | CONFIG_ASH_TEST=y |
942 | CONFIG_ASH_CMDCMD=y | 942 | CONFIG_ASH_CMDCMD=y |
943 | # CONFIG_ASH_MAIL is not set | 943 | # CONFIG_ASH_MAIL is not set |
944 | CONFIG_ASH_OPTIMIZE_FOR_SIZE=y | 944 | CONFIG_ASH_OPTIMIZE_FOR_SIZE=y |
diff --git a/configs/freebsd_defconfig b/configs/freebsd_defconfig index 4f14d3be9..d223b7230 100644 --- a/configs/freebsd_defconfig +++ b/configs/freebsd_defconfig | |||
@@ -912,9 +912,9 @@ CONFIG_ASH=y | |||
912 | # CONFIG_ASH_JOB_CONTROL is not set | 912 | # CONFIG_ASH_JOB_CONTROL is not set |
913 | # CONFIG_ASH_ALIAS is not set | 913 | # CONFIG_ASH_ALIAS is not set |
914 | # CONFIG_ASH_GETOPTS is not set | 914 | # CONFIG_ASH_GETOPTS is not set |
915 | # CONFIG_ASH_BUILTIN_ECHO is not set | 915 | # CONFIG_ASH_ECHO is not set |
916 | # CONFIG_ASH_BUILTIN_PRINTF is not set | 916 | # CONFIG_ASH_PRINTF is not set |
917 | # CONFIG_ASH_BUILTIN_TEST is not set | 917 | # CONFIG_ASH_TEST is not set |
918 | # CONFIG_ASH_CMDCMD is not set | 918 | # CONFIG_ASH_CMDCMD is not set |
919 | # CONFIG_ASH_MAIL is not set | 919 | # CONFIG_ASH_MAIL is not set |
920 | # CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set | 920 | # CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set |
diff --git a/coreutils/Kbuild.src b/coreutils/Kbuild.src index d0b3f629b..a805b64fe 100644 --- a/coreutils/Kbuild.src +++ b/coreutils/Kbuild.src | |||
@@ -16,9 +16,3 @@ lib-$(CONFIG_CRONTAB) += cat.o # crontab -l | |||
16 | lib-$(CONFIG_ADDUSER) += chown.o # used by adduser | 16 | lib-$(CONFIG_ADDUSER) += chown.o # used by adduser |
17 | lib-$(CONFIG_ADDGROUP) += chown.o # used by addgroup | 17 | lib-$(CONFIG_ADDGROUP) += chown.o # used by addgroup |
18 | lib-$(CONFIG_FTPD) += ls.o # used by ftpd | 18 | lib-$(CONFIG_FTPD) += ls.o # used by ftpd |
19 | |||
20 | lib-$(CONFIG_ASH_BUILTIN_ECHO) += echo.o | ||
21 | lib-$(CONFIG_HUSH_ECHO) += echo.o | ||
22 | |||
23 | lib-$(CONFIG_ASH_BUILTIN_PRINTF) += printf.o | ||
24 | lib-$(CONFIG_HUSH_PRINTF) += printf.o | ||
diff --git a/coreutils/echo.c b/coreutils/echo.c index d0dba650d..a7e4ca9ac 100644 --- a/coreutils/echo.c +++ b/coreutils/echo.c | |||
@@ -28,12 +28,15 @@ | |||
28 | //config:config FEATURE_FANCY_ECHO | 28 | //config:config FEATURE_FANCY_ECHO |
29 | //config: bool "Enable -n and -e options" | 29 | //config: bool "Enable -n and -e options" |
30 | //config: default y | 30 | //config: default y |
31 | //config: depends on ECHO || ASH_BUILTIN_ECHO || HUSH_ECHO | 31 | //config: depends on ECHO || ASH_ECHO || HUSH_ECHO |
32 | 32 | ||
33 | //applet:IF_ECHO(APPLET_NOFORK(echo, echo, BB_DIR_BIN, BB_SUID_DROP, echo)) | 33 | //applet:IF_ECHO(APPLET_NOFORK(echo, echo, BB_DIR_BIN, BB_SUID_DROP, echo)) |
34 | 34 | ||
35 | //kbuild:lib-$(CONFIG_ECHO) += echo.o | 35 | //kbuild:lib-$(CONFIG_ECHO) += echo.o |
36 | 36 | ||
37 | //kbuild:lib-$(CONFIG_ASH_ECHO) += echo.o | ||
38 | //kbuild:lib-$(CONFIG_HUSH_ECHO) += echo.o | ||
39 | |||
37 | /* BB_AUDIT SUSv3 compliant -- unless configured as fancy echo. */ | 40 | /* BB_AUDIT SUSv3 compliant -- unless configured as fancy echo. */ |
38 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/echo.html */ | 41 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/echo.html */ |
39 | 42 | ||
diff --git a/coreutils/printf.c b/coreutils/printf.c index 6c8e115d8..bc22e0ee7 100644 --- a/coreutils/printf.c +++ b/coreutils/printf.c | |||
@@ -49,6 +49,9 @@ | |||
49 | 49 | ||
50 | //kbuild:lib-$(CONFIG_PRINTF) += printf.o | 50 | //kbuild:lib-$(CONFIG_PRINTF) += printf.o |
51 | 51 | ||
52 | //kbuild:lib-$(CONFIG_ASH_PRINTF) += printf.o | ||
53 | //kbuild:lib-$(CONFIG_HUSH_PRINTF) += printf.o | ||
54 | |||
52 | //usage:#define printf_trivial_usage | 55 | //usage:#define printf_trivial_usage |
53 | //usage: "FORMAT [ARG]..." | 56 | //usage: "FORMAT [ARG]..." |
54 | //usage:#define printf_full_usage "\n\n" | 57 | //usage:#define printf_full_usage "\n\n" |
@@ -417,7 +420,7 @@ int printf_main(int argc UNUSED_PARAM, char **argv) | |||
417 | if (argv[1] && argv[1][0] == '-' && argv[1][1] == '-' && !argv[1][2]) | 420 | if (argv[1] && argv[1][0] == '-' && argv[1][1] == '-' && !argv[1][2]) |
418 | argv++; | 421 | argv++; |
419 | if (!argv[1]) { | 422 | if (!argv[1]) { |
420 | if (ENABLE_ASH_BUILTIN_PRINTF | 423 | if (ENABLE_ASH_PRINTF |
421 | && applet_name[0] != 'p' | 424 | && applet_name[0] != 'p' |
422 | ) { | 425 | ) { |
423 | bb_error_msg("usage: printf FORMAT [ARGUMENT...]"); | 426 | bb_error_msg("usage: printf FORMAT [ARGUMENT...]"); |
diff --git a/coreutils/test.c b/coreutils/test.c index 288f66508..edc625f57 100644 --- a/coreutils/test.c +++ b/coreutils/test.c | |||
@@ -42,21 +42,20 @@ | |||
42 | //config:config FEATURE_TEST_64 | 42 | //config:config FEATURE_TEST_64 |
43 | //config: bool "Extend test to 64 bit" | 43 | //config: bool "Extend test to 64 bit" |
44 | //config: default y | 44 | //config: default y |
45 | //config: depends on TEST || TEST1 || TEST2 || ASH_BUILTIN_TEST || HUSH | 45 | //config: depends on TEST || TEST1 || TEST2 || ASH_TEST || HUSH_TEST |
46 | //config: help | 46 | //config: help |
47 | //config: Enable 64-bit support in test. | 47 | //config: Enable 64-bit support in test. |
48 | 48 | ||
49 | //applet:IF_TEST(APPLET_NOFORK(test, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) | 49 | //applet:IF_TEST(APPLET_NOFORK(test, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) |
50 | //applet:IF_TEST1(APPLET_NOFORK([, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) | 50 | //applet:IF_TEST1(APPLET_NOFORK([, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) |
51 | //applet:IF_TEST2(APPLET_NOFORK([[, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) | 51 | //applet:IF_TEST2(APPLET_NOFORK([[, test, BB_DIR_USR_BIN, BB_SUID_DROP, test)) |
52 | 52 | ||
53 | //kbuild:lib-$(CONFIG_TEST) += test.o test_ptr_hack.o | 53 | //kbuild:lib-$(CONFIG_TEST) += test.o test_ptr_hack.o |
54 | //kbuild:lib-$(CONFIG_TEST1) += test.o test_ptr_hack.o | 54 | //kbuild:lib-$(CONFIG_TEST1) += test.o test_ptr_hack.o |
55 | //kbuild:lib-$(CONFIG_TEST2) += test.o test_ptr_hack.o | 55 | //kbuild:lib-$(CONFIG_TEST2) += test.o test_ptr_hack.o |
56 | //kbuild:lib-$(CONFIG_ASH_BUILTIN_TEST) += test.o test_ptr_hack.o | 56 | |
57 | //kbuild:lib-$(CONFIG_HUSH) += test.o test_ptr_hack.o | 57 | //kbuild:lib-$(CONFIG_ASH_TEST) += test.o test_ptr_hack.o |
58 | //kbuild:lib-$(CONFIG_SH_IS_HUSH) += test.o test_ptr_hack.o | 58 | //kbuild:lib-$(CONFIG_HUSH_TEST) += test.o test_ptr_hack.o |
59 | //kbuild:lib-$(CONFIG_BASH_IS_HUSH) += test.o test_ptr_hack.o | ||
60 | 59 | ||
61 | /* "test --help" is special-cased to ignore --help */ | 60 | /* "test --help" is special-cased to ignore --help */ |
62 | //usage:#define test_trivial_usage NOUSAGE_STR | 61 | //usage:#define test_trivial_usage NOUSAGE_STR |
@@ -843,7 +842,7 @@ int test_main(int argc, char **argv) | |||
843 | const char *arg0; | 842 | const char *arg0; |
844 | 843 | ||
845 | arg0 = bb_basename(argv[0]); | 844 | arg0 = bb_basename(argv[0]); |
846 | if ((ENABLE_TEST1 || ENABLE_TEST2 || ENABLE_ASH_BUILTIN_TEST || ENABLE_HUSH) | 845 | if ((ENABLE_TEST1 || ENABLE_TEST2 || ENABLE_ASH_TEST || ENABLE_HUSH_TEST) |
847 | && (arg0[0] == '[') | 846 | && (arg0[0] == '[') |
848 | ) { | 847 | ) { |
849 | --argc; | 848 | --argc; |
diff --git a/shell/ash.c b/shell/ash.c index 20ed9652c..7c1204a47 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -99,17 +99,17 @@ | |||
99 | //config: are checked for mtime changes, and "you have mail" | 99 | //config: are checked for mtime changes, and "you have mail" |
100 | //config: message is printed if change is detected. | 100 | //config: message is printed if change is detected. |
101 | //config: | 101 | //config: |
102 | //config:config ASH_BUILTIN_ECHO | 102 | //config:config ASH_ECHO |
103 | //config: bool "echo builtin" | 103 | //config: bool "echo builtin" |
104 | //config: default y | 104 | //config: default y |
105 | //config: depends on ASH || SH_IS_ASH || BASH_IS_ASH | 105 | //config: depends on ASH || SH_IS_ASH || BASH_IS_ASH |
106 | //config: | 106 | //config: |
107 | //config:config ASH_BUILTIN_PRINTF | 107 | //config:config ASH_PRINTF |
108 | //config: bool "printf builtin" | 108 | //config: bool "printf builtin" |
109 | //config: default y | 109 | //config: default y |
110 | //config: depends on ASH || SH_IS_ASH || BASH_IS_ASH | 110 | //config: depends on ASH || SH_IS_ASH || BASH_IS_ASH |
111 | //config: | 111 | //config: |
112 | //config:config ASH_BUILTIN_TEST | 112 | //config:config ASH_TEST |
113 | //config: bool "test builtin" | 113 | //config: bool "test builtin" |
114 | //config: default y | 114 | //config: default y |
115 | //config: depends on ASH || SH_IS_ASH || BASH_IS_ASH | 115 | //config: depends on ASH || SH_IS_ASH || BASH_IS_ASH |
@@ -9292,13 +9292,13 @@ static int ulimitcmd(int, char **) FAST_FUNC; | |||
9292 | #define BUILTIN_SPEC_REG_ASSG "7" | 9292 | #define BUILTIN_SPEC_REG_ASSG "7" |
9293 | 9293 | ||
9294 | /* Stubs for calling non-FAST_FUNC's */ | 9294 | /* Stubs for calling non-FAST_FUNC's */ |
9295 | #if ENABLE_ASH_BUILTIN_ECHO | 9295 | #if ENABLE_ASH_ECHO |
9296 | static int FAST_FUNC echocmd(int argc, char **argv) { return echo_main(argc, argv); } | 9296 | static int FAST_FUNC echocmd(int argc, char **argv) { return echo_main(argc, argv); } |
9297 | #endif | 9297 | #endif |
9298 | #if ENABLE_ASH_BUILTIN_PRINTF | 9298 | #if ENABLE_ASH_PRINTF |
9299 | static int FAST_FUNC printfcmd(int argc, char **argv) { return printf_main(argc, argv); } | 9299 | static int FAST_FUNC printfcmd(int argc, char **argv) { return printf_main(argc, argv); } |
9300 | #endif | 9300 | #endif |
9301 | #if ENABLE_ASH_BUILTIN_TEST | 9301 | #if ENABLE_ASH_TEST |
9302 | static int FAST_FUNC testcmd(int argc, char **argv) { return test_main(argc, argv); } | 9302 | static int FAST_FUNC testcmd(int argc, char **argv) { return test_main(argc, argv); } |
9303 | #endif | 9303 | #endif |
9304 | 9304 | ||
@@ -9306,7 +9306,7 @@ static int FAST_FUNC testcmd(int argc, char **argv) { return test_main(argc, a | |||
9306 | static const struct builtincmd builtintab[] = { | 9306 | static const struct builtincmd builtintab[] = { |
9307 | { BUILTIN_SPEC_REG "." , dotcmd }, | 9307 | { BUILTIN_SPEC_REG "." , dotcmd }, |
9308 | { BUILTIN_SPEC_REG ":" , truecmd }, | 9308 | { BUILTIN_SPEC_REG ":" , truecmd }, |
9309 | #if ENABLE_ASH_BUILTIN_TEST | 9309 | #if ENABLE_ASH_TEST |
9310 | { BUILTIN_REGULAR "[" , testcmd }, | 9310 | { BUILTIN_REGULAR "[" , testcmd }, |
9311 | # if ENABLE_ASH_BASH_COMPAT | 9311 | # if ENABLE_ASH_BASH_COMPAT |
9312 | { BUILTIN_REGULAR "[[" , testcmd }, | 9312 | { BUILTIN_REGULAR "[[" , testcmd }, |
@@ -9325,7 +9325,7 @@ static const struct builtincmd builtintab[] = { | |||
9325 | { BUILTIN_REGULAR "command" , commandcmd }, | 9325 | { BUILTIN_REGULAR "command" , commandcmd }, |
9326 | #endif | 9326 | #endif |
9327 | { BUILTIN_SPEC_REG "continue", breakcmd }, | 9327 | { BUILTIN_SPEC_REG "continue", breakcmd }, |
9328 | #if ENABLE_ASH_BUILTIN_ECHO | 9328 | #if ENABLE_ASH_ECHO |
9329 | { BUILTIN_REGULAR "echo" , echocmd }, | 9329 | { BUILTIN_REGULAR "echo" , echocmd }, |
9330 | #endif | 9330 | #endif |
9331 | { BUILTIN_SPEC_REG "eval" , NULL }, /*evalcmd() has a differing prototype*/ | 9331 | { BUILTIN_SPEC_REG "eval" , NULL }, /*evalcmd() has a differing prototype*/ |
@@ -9354,7 +9354,7 @@ static const struct builtincmd builtintab[] = { | |||
9354 | { BUILTIN_NOSPEC "let" , letcmd }, | 9354 | { BUILTIN_NOSPEC "let" , letcmd }, |
9355 | #endif | 9355 | #endif |
9356 | { BUILTIN_ASSIGN "local" , localcmd }, | 9356 | { BUILTIN_ASSIGN "local" , localcmd }, |
9357 | #if ENABLE_ASH_BUILTIN_PRINTF | 9357 | #if ENABLE_ASH_PRINTF |
9358 | { BUILTIN_REGULAR "printf" , printfcmd }, | 9358 | { BUILTIN_REGULAR "printf" , printfcmd }, |
9359 | #endif | 9359 | #endif |
9360 | { BUILTIN_NOSPEC "pwd" , pwdcmd }, | 9360 | { BUILTIN_NOSPEC "pwd" , pwdcmd }, |
@@ -9366,7 +9366,7 @@ static const struct builtincmd builtintab[] = { | |||
9366 | #if ENABLE_ASH_BASH_COMPAT | 9366 | #if ENABLE_ASH_BASH_COMPAT |
9367 | { BUILTIN_SPEC_REG "source" , dotcmd }, | 9367 | { BUILTIN_SPEC_REG "source" , dotcmd }, |
9368 | #endif | 9368 | #endif |
9369 | #if ENABLE_ASH_BUILTIN_TEST | 9369 | #if ENABLE_ASH_TEST |
9370 | { BUILTIN_REGULAR "test" , testcmd }, | 9370 | { BUILTIN_REGULAR "test" , testcmd }, |
9371 | #endif | 9371 | #endif |
9372 | { BUILTIN_SPEC_REG "times" , timescmd }, | 9372 | { BUILTIN_SPEC_REG "times" , timescmd }, |
@@ -9385,15 +9385,15 @@ static const struct builtincmd builtintab[] = { | |||
9385 | /* Should match the above table! */ | 9385 | /* Should match the above table! */ |
9386 | #define COMMANDCMD (builtintab + \ | 9386 | #define COMMANDCMD (builtintab + \ |
9387 | /* . : */ 2 + \ | 9387 | /* . : */ 2 + \ |
9388 | /* [ */ 1 * ENABLE_ASH_BUILTIN_TEST + \ | 9388 | /* [ */ 1 * ENABLE_ASH_TEST + \ |
9389 | /* [[ */ 1 * ENABLE_ASH_BUILTIN_TEST * ENABLE_ASH_BASH_COMPAT + \ | 9389 | /* [[ */ 1 * ENABLE_ASH_TEST * ENABLE_ASH_BASH_COMPAT + \ |
9390 | /* alias */ 1 * ENABLE_ASH_ALIAS + \ | 9390 | /* alias */ 1 * ENABLE_ASH_ALIAS + \ |
9391 | /* bg */ 1 * ENABLE_ASH_JOB_CONTROL + \ | 9391 | /* bg */ 1 * ENABLE_ASH_JOB_CONTROL + \ |
9392 | /* break cd cddir */ 3) | 9392 | /* break cd cddir */ 3) |
9393 | #define EVALCMD (COMMANDCMD + \ | 9393 | #define EVALCMD (COMMANDCMD + \ |
9394 | /* command */ 1 * ENABLE_ASH_CMDCMD + \ | 9394 | /* command */ 1 * ENABLE_ASH_CMDCMD + \ |
9395 | /* continue */ 1 + \ | 9395 | /* continue */ 1 + \ |
9396 | /* echo */ 1 * ENABLE_ASH_BUILTIN_ECHO + \ | 9396 | /* echo */ 1 * ENABLE_ASH_ECHO + \ |
9397 | 0) | 9397 | 0) |
9398 | #define EXECCMD (EVALCMD + \ | 9398 | #define EXECCMD (EVALCMD + \ |
9399 | /* eval */ 1) | 9399 | /* eval */ 1) |
diff --git a/shell/hush.c b/shell/hush.c index 9e508fc6d..c0325cf5e 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -197,6 +197,11 @@ | |||
197 | //config: default y | 197 | //config: default y |
198 | //config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH | 198 | //config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH |
199 | //config: | 199 | //config: |
200 | //config:config HUSH_TEST | ||
201 | //config: bool "test builtin" | ||
202 | //config: default y | ||
203 | //config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH | ||
204 | //config: | ||
200 | //config:config HUSH_HELP | 205 | //config:config HUSH_HELP |
201 | //config: bool "help builtin" | 206 | //config: bool "help builtin" |
202 | //config: default y | 207 | //config: default y |
@@ -942,7 +947,9 @@ static int builtin_set(char **argv) FAST_FUNC; | |||
942 | #endif | 947 | #endif |
943 | static int builtin_shift(char **argv) FAST_FUNC; | 948 | static int builtin_shift(char **argv) FAST_FUNC; |
944 | static int builtin_source(char **argv) FAST_FUNC; | 949 | static int builtin_source(char **argv) FAST_FUNC; |
950 | #if ENABLE_HUSH_TEST | ||
945 | static int builtin_test(char **argv) FAST_FUNC; | 951 | static int builtin_test(char **argv) FAST_FUNC; |
952 | #endif | ||
946 | #if ENABLE_HUSH_TRAP | 953 | #if ENABLE_HUSH_TRAP |
947 | static int builtin_trap(char **argv) FAST_FUNC; | 954 | static int builtin_trap(char **argv) FAST_FUNC; |
948 | #endif | 955 | #endif |
@@ -1061,7 +1068,9 @@ static const struct built_in_command bltins1[] = { | |||
1061 | #endif | 1068 | #endif |
1062 | }; | 1069 | }; |
1063 | static const struct built_in_command bltins2[] = { | 1070 | static const struct built_in_command bltins2[] = { |
1071 | #if ENABLE_HUSH_TEST | ||
1064 | BLTIN("[" , builtin_test , NULL), | 1072 | BLTIN("[" , builtin_test , NULL), |
1073 | #endif | ||
1065 | #if ENABLE_HUSH_ECHO | 1074 | #if ENABLE_HUSH_ECHO |
1066 | BLTIN("echo" , builtin_echo , NULL), | 1075 | BLTIN("echo" , builtin_echo , NULL), |
1067 | #endif | 1076 | #endif |
@@ -1069,7 +1078,9 @@ static const struct built_in_command bltins2[] = { | |||
1069 | BLTIN("printf" , builtin_printf , NULL), | 1078 | BLTIN("printf" , builtin_printf , NULL), |
1070 | #endif | 1079 | #endif |
1071 | BLTIN("pwd" , builtin_pwd , NULL), | 1080 | BLTIN("pwd" , builtin_pwd , NULL), |
1081 | #if ENABLE_HUSH_TEST | ||
1072 | BLTIN("test" , builtin_test , NULL), | 1082 | BLTIN("test" , builtin_test , NULL), |
1083 | #endif | ||
1073 | }; | 1084 | }; |
1074 | 1085 | ||
1075 | 1086 | ||
@@ -8791,6 +8802,7 @@ static int FAST_FUNC builtin_true(char **argv UNUSED_PARAM) | |||
8791 | return 0; | 8802 | return 0; |
8792 | } | 8803 | } |
8793 | 8804 | ||
8805 | #if ENABLE_HUSH_TEST || ENABLE_HUSH_ECHO || ENABLE_HUSH_PRINTF || ENABLE_HUSH_KILL | ||
8794 | static int run_applet_main(char **argv, int (*applet_main_func)(int argc, char **argv)) | 8806 | static int run_applet_main(char **argv, int (*applet_main_func)(int argc, char **argv)) |
8795 | { | 8807 | { |
8796 | int argc = 0; | 8808 | int argc = 0; |
@@ -8800,11 +8812,13 @@ static int run_applet_main(char **argv, int (*applet_main_func)(int argc, char * | |||
8800 | } | 8812 | } |
8801 | return applet_main_func(argc, argv - argc); | 8813 | return applet_main_func(argc, argv - argc); |
8802 | } | 8814 | } |
8803 | 8815 | #endif | |
8816 | #if ENABLE_HUSH_TEST | ||
8804 | static int FAST_FUNC builtin_test(char **argv) | 8817 | static int FAST_FUNC builtin_test(char **argv) |
8805 | { | 8818 | { |
8806 | return run_applet_main(argv, test_main); | 8819 | return run_applet_main(argv, test_main); |
8807 | } | 8820 | } |
8821 | #endif | ||
8808 | #if ENABLE_HUSH_ECHO | 8822 | #if ENABLE_HUSH_ECHO |
8809 | static int FAST_FUNC builtin_echo(char **argv) | 8823 | static int FAST_FUNC builtin_echo(char **argv) |
8810 | { | 8824 | { |
diff --git a/testsuite/mdev.tests b/testsuite/mdev.tests index 59873011a..8515aff31 100755 --- a/testsuite/mdev.tests +++ b/testsuite/mdev.tests | |||
@@ -168,7 +168,7 @@ SKIP= | |||
168 | # continuing to use directory structure from prev test | 168 | # continuing to use directory structure from prev test |
169 | rm -rf mdev.testdir/dev/* | 169 | rm -rf mdev.testdir/dev/* |
170 | echo "sda 0:0 644 @echo @echo TEST" >mdev.testdir/etc/mdev.conf | 170 | echo "sda 0:0 644 @echo @echo TEST" >mdev.testdir/etc/mdev.conf |
171 | optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_EXEC FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME FEATURE_SH_IS_ASH ASH_BUILTIN_ECHO | 171 | optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_EXEC FEATURE_LS_RECURSIVE FEATURE_LS_TIMESTAMPS FEATURE_LS_USERNAME FEATURE_SH_IS_ASH ASH_ECHO |
172 | testing "mdev command" \ | 172 | testing "mdev command" \ |
173 | "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; | 173 | "env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1; |
174 | ls -lnR mdev.testdir/dev | $FILTER_LS" \ | 174 | ls -lnR mdev.testdir/dev | $FILTER_LS" \ |