diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-06-04 19:59:49 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-06-04 19:59:49 +0200 |
commit | e4070cb0d7586037c6fcf0f0f00d8d5b97f649d3 (patch) | |
tree | abb5ef8065937f596c1e1e1249dc745c1076465b | |
parent | 6db13732954b23bd0f6f55c5b3c3941f0547141c (diff) | |
download | busybox-w32-e4070cb0d7586037c6fcf0f0f00d8d5b97f649d3.tar.gz busybox-w32-e4070cb0d7586037c6fcf0f0f00d8d5b97f649d3.tar.bz2 busybox-w32-e4070cb0d7586037c6fcf0f0f00d8d5b97f649d3.zip |
partially migrate coreutils to Config.src and Kbuild.src
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | coreutils/Config.src (renamed from coreutils/Config.in) | 94 | ||||
-rw-r--r-- | coreutils/Kbuild.src (renamed from coreutils/Kbuild) | 12 | ||||
-rw-r--r-- | coreutils/basename.c | 10 | ||||
-rw-r--r-- | coreutils/cat.c | 12 | ||||
-rw-r--r-- | coreutils/date.c | 41 | ||||
-rw-r--r-- | coreutils/test.c | 20 | ||||
-rw-r--r-- | coreutils/tr.c | 29 |
7 files changed, 114 insertions, 104 deletions
diff --git a/coreutils/Config.in b/coreutils/Config.src index 37e885c1c..99384e300 100644 --- a/coreutils/Config.in +++ b/coreutils/Config.src | |||
@@ -5,13 +5,7 @@ | |||
5 | 5 | ||
6 | menu "Coreutils" | 6 | menu "Coreutils" |
7 | 7 | ||
8 | config BASENAME | 8 | INSERT |
9 | bool "basename" | ||
10 | default n | ||
11 | help | ||
12 | basename is used to strip the directory and suffix from filenames, | ||
13 | leaving just the filename itself. Enable this option if you wish | ||
14 | to enable the 'basename' utility. | ||
15 | 9 | ||
16 | config CAL | 10 | config CAL |
17 | bool "cal" | 11 | bool "cal" |
@@ -19,13 +13,6 @@ config CAL | |||
19 | help | 13 | help |
20 | cal is used to display a monthly calender. | 14 | cal is used to display a monthly calender. |
21 | 15 | ||
22 | config CAT | ||
23 | bool "cat" | ||
24 | default n | ||
25 | help | ||
26 | cat is used to concatenate files and print them to the standard | ||
27 | output. Enable this option if you wish to enable the 'cat' utility. | ||
28 | |||
29 | config CATV | 16 | config CATV |
30 | bool "catv" | 17 | bool "catv" |
31 | default n | 18 | default n |
@@ -100,44 +87,6 @@ config CUT | |||
100 | cut is used to print selected parts of lines from | 87 | cut is used to print selected parts of lines from |
101 | each file to stdout. | 88 | each file to stdout. |
102 | 89 | ||
103 | config DATE | ||
104 | bool "date" | ||
105 | default n | ||
106 | help | ||
107 | date is used to set the system date or display the | ||
108 | current time in the given format. | ||
109 | |||
110 | config FEATURE_DATE_ISOFMT | ||
111 | bool "Enable ISO date format output (-I)" | ||
112 | default y | ||
113 | depends on DATE | ||
114 | help | ||
115 | Enable option (-I) to output an ISO-8601 compliant | ||
116 | date/time string. | ||
117 | |||
118 | config FEATURE_DATE_NANO | ||
119 | bool "Support %[num]N nanosecond format specifier" | ||
120 | default y | ||
121 | depends on DATE | ||
122 | help | ||
123 | Support %[num]N format specifier. Adds ~250 bytes of code. | ||
124 | |||
125 | config FEATURE_DATE_COMPAT | ||
126 | bool "Support weird 'date MMDDhhmm[[YY]YY][.ss]' format" | ||
127 | default y | ||
128 | depends on DATE | ||
129 | help | ||
130 | System time can be set by 'date -s DATE' and simply 'date DATE', | ||
131 | but formats of DATE string are different. 'date DATE' accepts | ||
132 | a rather weird MMDDhhmm[[YY]YY][.ss] format with completely | ||
133 | unnatural placement of year between minutes and seconds. | ||
134 | date -s (and other commands like touch -d) use more sensible | ||
135 | formats (for one, ISO format YYYY-MM-DD hh:mm:ss.ssssss). | ||
136 | |||
137 | With this option off, 'date DATE' is 'date -s DATE' support | ||
138 | the same format. With it on, 'date DATE' additionally supports | ||
139 | MMDDhhmm[[YY]YY][.ss] format. | ||
140 | |||
141 | config DD | 90 | config DD |
142 | bool "dd" | 91 | bool "dd" |
143 | default n | 92 | default n |
@@ -711,21 +660,6 @@ config FEATURE_TEE_USE_BLOCK_IO | |||
711 | help | 660 | help |
712 | Enable this option for a faster tee, at expense of size. | 661 | Enable this option for a faster tee, at expense of size. |
713 | 662 | ||
714 | config TEST | ||
715 | bool "test" | ||
716 | default n | ||
717 | help | ||
718 | test is used to check file types and compare values, | ||
719 | returning an appropriate exit code. The bash shell | ||
720 | has test built in, ash can build it in optionally. | ||
721 | |||
722 | config FEATURE_TEST_64 | ||
723 | bool "Extend test to 64 bit" | ||
724 | default n | ||
725 | depends on TEST || ASH_BUILTIN_TEST || HUSH | ||
726 | help | ||
727 | Enable 64-bit support in test. | ||
728 | |||
729 | config TOUCH | 663 | config TOUCH |
730 | bool "touch" | 664 | bool "touch" |
731 | default n | 665 | default n |
@@ -733,32 +667,6 @@ config TOUCH | |||
733 | touch is used to create or change the access and/or | 667 | touch is used to create or change the access and/or |
734 | modification timestamp of specified files. | 668 | modification timestamp of specified files. |
735 | 669 | ||
736 | config TR | ||
737 | bool "tr" | ||
738 | default n | ||
739 | help | ||
740 | tr is used to squeeze, and/or delete characters from standard | ||
741 | input, writing to standard output. | ||
742 | |||
743 | config FEATURE_TR_CLASSES | ||
744 | bool "Enable character classes (such as [:upper:])" | ||
745 | default n | ||
746 | depends on TR | ||
747 | help | ||
748 | Enable character classes, enabling commands such as: | ||
749 | tr [:upper:] [:lower:] to convert input into lowercase. | ||
750 | |||
751 | config FEATURE_TR_EQUIV | ||
752 | bool "Enable equivalence classes" | ||
753 | default n | ||
754 | depends on TR | ||
755 | help | ||
756 | Enable equivalence classes, which essentially add the enclosed | ||
757 | character to the current set. For instance, tr [=a=] xyz would | ||
758 | replace all instances of 'a' with 'xyz'. This option is mainly | ||
759 | useful for cases when no other way of expressing a character | ||
760 | is possible. | ||
761 | |||
762 | config TRUE | 670 | config TRUE |
763 | bool "true" | 671 | bool "true" |
764 | default n | 672 | default n |
diff --git a/coreutils/Kbuild b/coreutils/Kbuild.src index ee22a3f7b..57ea7d6c4 100644 --- a/coreutils/Kbuild +++ b/coreutils/Kbuild.src | |||
@@ -7,12 +7,8 @@ | |||
7 | libs-y += libcoreutils/ | 7 | libs-y += libcoreutils/ |
8 | 8 | ||
9 | lib-y:= | 9 | lib-y:= |
10 | lib-$(CONFIG_BASENAME) += basename.o | 10 | INSERT |
11 | lib-$(CONFIG_CAL) += cal.o | 11 | lib-$(CONFIG_CAL) += cal.o |
12 | lib-$(CONFIG_CAT) += cat.o | ||
13 | lib-$(CONFIG_MORE) += cat.o # more uses it if stdout isn't a tty | ||
14 | lib-$(CONFIG_LESS) += cat.o # less too | ||
15 | lib-$(CONFIG_CRONTAB) += cat.o # crontab -l | ||
16 | lib-$(CONFIG_CATV) += catv.o | 12 | lib-$(CONFIG_CATV) += catv.o |
17 | lib-$(CONFIG_CHGRP) += chgrp.o chown.o | 13 | lib-$(CONFIG_CHGRP) += chgrp.o chown.o |
18 | lib-$(CONFIG_CHMOD) += chmod.o | 14 | lib-$(CONFIG_CHMOD) += chmod.o |
@@ -24,7 +20,6 @@ lib-$(CONFIG_CKSUM) += cksum.o | |||
24 | lib-$(CONFIG_COMM) += comm.o | 20 | lib-$(CONFIG_COMM) += comm.o |
25 | lib-$(CONFIG_CP) += cp.o | 21 | lib-$(CONFIG_CP) += cp.o |
26 | lib-$(CONFIG_CUT) += cut.o | 22 | lib-$(CONFIG_CUT) += cut.o |
27 | lib-$(CONFIG_DATE) += date.o | ||
28 | lib-$(CONFIG_DD) += dd.o | 23 | lib-$(CONFIG_DD) += dd.o |
29 | lib-$(CONFIG_DF) += df.o | 24 | lib-$(CONFIG_DF) += df.o |
30 | lib-$(CONFIG_DIRNAME) += dirname.o | 25 | lib-$(CONFIG_DIRNAME) += dirname.o |
@@ -78,12 +73,7 @@ lib-$(CONFIG_SYNC) += sync.o | |||
78 | lib-$(CONFIG_TAC) += tac.o | 73 | lib-$(CONFIG_TAC) += tac.o |
79 | lib-$(CONFIG_TAIL) += tail.o | 74 | lib-$(CONFIG_TAIL) += tail.o |
80 | lib-$(CONFIG_TEE) += tee.o | 75 | lib-$(CONFIG_TEE) += tee.o |
81 | lib-$(CONFIG_TEST) += test.o test_ptr_hack.o | ||
82 | lib-$(CONFIG_ASH) += test.o test_ptr_hack.o # used by ash | ||
83 | lib-$(CONFIG_HUSH) += test.o test_ptr_hack.o # used by hush | ||
84 | lib-$(CONFIG_MSH) += test.o test_ptr_hack.o # used by msh | ||
85 | lib-$(CONFIG_TOUCH) += touch.o | 76 | lib-$(CONFIG_TOUCH) += touch.o |
86 | lib-$(CONFIG_TR) += tr.o | ||
87 | lib-$(CONFIG_TRUE) += true.o | 77 | lib-$(CONFIG_TRUE) += true.o |
88 | lib-$(CONFIG_TTY) += tty.o | 78 | lib-$(CONFIG_TTY) += tty.o |
89 | lib-$(CONFIG_UNAME) += uname.o | 79 | lib-$(CONFIG_UNAME) += uname.o |
diff --git a/coreutils/basename.c b/coreutils/basename.c index 8a5597e65..f35bdf08e 100644 --- a/coreutils/basename.c +++ b/coreutils/basename.c | |||
@@ -20,6 +20,16 @@ | |||
20 | * 3) Save some space by using strcmp(). Calling strncmp() here was silly. | 20 | * 3) Save some space by using strcmp(). Calling strncmp() here was silly. |
21 | */ | 21 | */ |
22 | 22 | ||
23 | //kbuild:lib-$(CONFIG_BASENAME) += basename.o | ||
24 | |||
25 | //config:config BASENAME | ||
26 | //config: bool "basename" | ||
27 | //config: default n | ||
28 | //config: help | ||
29 | //config: basename is used to strip the directory and suffix from filenames, | ||
30 | //config: leaving just the filename itself. Enable this option if you wish | ||
31 | //config: to enable the 'basename' utility. | ||
32 | |||
23 | #include "libbb.h" | 33 | #include "libbb.h" |
24 | 34 | ||
25 | /* This is a NOFORK applet. Be very careful! */ | 35 | /* This is a NOFORK applet. Be very careful! */ |
diff --git a/coreutils/cat.c b/coreutils/cat.c index 0024eb8d5..dbb6246ba 100644 --- a/coreutils/cat.c +++ b/coreutils/cat.c | |||
@@ -10,6 +10,18 @@ | |||
10 | /* BB_AUDIT SUSv3 compliant */ | 10 | /* BB_AUDIT SUSv3 compliant */ |
11 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/cat.html */ | 11 | /* http://www.opengroup.org/onlinepubs/007904975/utilities/cat.html */ |
12 | 12 | ||
13 | //kbuild:lib-$(CONFIG_CAT) += cat.o | ||
14 | //kbuild:lib-$(CONFIG_MORE) += cat.o # more uses it if stdout isn't a tty | ||
15 | //kbuild:lib-$(CONFIG_LESS) += cat.o # less too | ||
16 | //kbuild:lib-$(CONFIG_CRONTAB) += cat.o # crontab -l | ||
17 | |||
18 | //config:config CAT | ||
19 | //config: bool "cat" | ||
20 | //config: default n | ||
21 | //config: help | ||
22 | //config: cat is used to concatenate files and print them to the standard | ||
23 | //config: output. Enable this option if you wish to enable the 'cat' utility. | ||
24 | |||
13 | #include "libbb.h" | 25 | #include "libbb.h" |
14 | 26 | ||
15 | /* This is a NOFORK applet. Be very careful! */ | 27 | /* This is a NOFORK applet. Be very careful! */ |
diff --git a/coreutils/date.c b/coreutils/date.c index c1390be76..2720a3507 100644 --- a/coreutils/date.c +++ b/coreutils/date.c | |||
@@ -51,6 +51,47 @@ | |||
51 | * and does not support -Ins | 51 | * and does not support -Ins |
52 | * -D FMT is a bbox extension for _input_ conversion of -d DATE | 52 | * -D FMT is a bbox extension for _input_ conversion of -d DATE |
53 | */ | 53 | */ |
54 | |||
55 | //kbuild:lib-$(CONFIG_DATE) += date.o | ||
56 | |||
57 | //config:config DATE | ||
58 | //config: bool "date" | ||
59 | //config: default n | ||
60 | //config: help | ||
61 | //config: date is used to set the system date or display the | ||
62 | //config: current time in the given format. | ||
63 | //config: | ||
64 | //config:config FEATURE_DATE_ISOFMT | ||
65 | //config: bool "Enable ISO date format output (-I)" | ||
66 | //config: default y | ||
67 | //config: depends on DATE | ||
68 | //config: help | ||
69 | //config: Enable option (-I) to output an ISO-8601 compliant | ||
70 | //config: date/time string. | ||
71 | //config: | ||
72 | //config:config FEATURE_DATE_NANO | ||
73 | //config: bool "Support %[num]N nanosecond format specifier" | ||
74 | //config: default y | ||
75 | //config: depends on DATE | ||
76 | //config: help | ||
77 | //config: Support %[num]N format specifier. Adds ~250 bytes of code. | ||
78 | //config: | ||
79 | //config:config FEATURE_DATE_COMPAT | ||
80 | //config: bool "Support weird 'date MMDDhhmm[[YY]YY][.ss]' format" | ||
81 | //config: default y | ||
82 | //config: depends on DATE | ||
83 | //config: help | ||
84 | //config: System time can be set by 'date -s DATE' and simply 'date DATE', | ||
85 | //config: but formats of DATE string are different. 'date DATE' accepts | ||
86 | //config: a rather weird MMDDhhmm[[YY]YY][.ss] format with completely | ||
87 | //config: unnatural placement of year between minutes and seconds. | ||
88 | //config: date -s (and other commands like touch -d) use more sensible | ||
89 | //config: formats (for one, ISO format YYYY-MM-DD hh:mm:ss.ssssss). | ||
90 | //config: | ||
91 | //config: With this option off, 'date DATE' is 'date -s DATE' support | ||
92 | //config: the same format. With it on, 'date DATE' additionally supports | ||
93 | //config: MMDDhhmm[[YY]YY][.ss] format. | ||
94 | |||
54 | #include "libbb.h" | 95 | #include "libbb.h" |
55 | 96 | ||
56 | enum { | 97 | enum { |
diff --git a/coreutils/test.c b/coreutils/test.c index a1d164574..cc4a132a7 100644 --- a/coreutils/test.c +++ b/coreutils/test.c | |||
@@ -19,6 +19,26 @@ | |||
19 | * Original copyright notice states: | 19 | * Original copyright notice states: |
20 | * "This program is in the Public Domain." | 20 | * "This program is in the Public Domain." |
21 | */ | 21 | */ |
22 | |||
23 | //kbuild:lib-$(CONFIG_TEST) += test.o test_ptr_hack.o | ||
24 | //kbuild:lib-$(CONFIG_ASH) += test.o test_ptr_hack.o | ||
25 | //kbuild:lib-$(CONFIG_HUSH) += test.o test_ptr_hack.o | ||
26 | |||
27 | //config:config TEST | ||
28 | //config: bool "test" | ||
29 | //config: default n | ||
30 | //config: help | ||
31 | //config: test is used to check file types and compare values, | ||
32 | //config: returning an appropriate exit code. The bash shell | ||
33 | //config: has test built in, ash can build it in optionally. | ||
34 | //config: | ||
35 | //config:config FEATURE_TEST_64 | ||
36 | //config: bool "Extend test to 64 bit" | ||
37 | //config: default n | ||
38 | //config: depends on TEST || ASH_BUILTIN_TEST || HUSH | ||
39 | //config: help | ||
40 | //config: Enable 64-bit support in test. | ||
41 | |||
22 | #include "libbb.h" | 42 | #include "libbb.h" |
23 | #include <setjmp.h> | 43 | #include <setjmp.h> |
24 | 44 | ||
diff --git a/coreutils/tr.c b/coreutils/tr.c index 6d4cb4a14..12d07152b 100644 --- a/coreutils/tr.c +++ b/coreutils/tr.c | |||
@@ -18,6 +18,35 @@ | |||
18 | /* http://www.opengroup.org/onlinepubs/009695399/utilities/tr.html | 18 | /* http://www.opengroup.org/onlinepubs/009695399/utilities/tr.html |
19 | * TODO: graph, print | 19 | * TODO: graph, print |
20 | */ | 20 | */ |
21 | |||
22 | //kbuild:lib-$(CONFIG_TR) += tr.o | ||
23 | |||
24 | //config:config TR | ||
25 | //config: bool "tr" | ||
26 | //config: default n | ||
27 | //config: help | ||
28 | //config: tr is used to squeeze, and/or delete characters from standard | ||
29 | //config: input, writing to standard output. | ||
30 | |||
31 | config FEATURE_TR_CLASSES | ||
32 | bool "Enable character classes (such as [:upper:])" | ||
33 | default n | ||
34 | depends on TR | ||
35 | help | ||
36 | Enable character classes, enabling commands such as: | ||
37 | tr [:upper:] [:lower:] to convert input into lowercase. | ||
38 | |||
39 | config FEATURE_TR_EQUIV | ||
40 | bool "Enable equivalence classes" | ||
41 | default n | ||
42 | depends on TR | ||
43 | help | ||
44 | Enable equivalence classes, which essentially add the enclosed | ||
45 | character to the current set. For instance, tr [=a=] xyz would | ||
46 | replace all instances of 'a' with 'xyz'. This option is mainly | ||
47 | useful for cases when no other way of expressing a character | ||
48 | is possible. | ||
49 | |||
21 | #include "libbb.h" | 50 | #include "libbb.h" |
22 | 51 | ||
23 | enum { | 52 | enum { |