aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-01-30 01:30:39 +0000
committerRob Landley <rob@landley.net>2006-01-30 01:30:39 +0000
commitf8fd4db92f5626ef0065f5838fad42ad0fd0b362 (patch)
tree7a894633a6e3e0fd48f32f6fc1eb9596b01477ee
parentdd53c24d412c304e19ba64c7a9cb26dd1068bcd0 (diff)
downloadbusybox-w32-f8fd4db92f5626ef0065f5838fad42ad0fd0b362.tar.gz
busybox-w32-f8fd4db92f5626ef0065f5838fad42ad0fd0b362.tar.bz2
busybox-w32-f8fd4db92f5626ef0065f5838fad42ad0fd0b362.zip
Move SUSv2 obsolete feature disabling to debug menu, invert meaning of
symbol (switched on to remove now: test your apps to make sure they _don't_ do this, because as some point we should just yank it), fixup head/tail/fold. Also tweak "make allyesconfig" so anything starting with CONFIG_DEBUG gets left switched off. Possibly other things we want to put in the debug menu?
-rw-r--r--Config.in25
-rw-r--r--Makefile2
-rw-r--r--coreutils/fold.c32
-rw-r--r--coreutils/head.c19
-rw-r--r--coreutils/tail.c25
5 files changed, 32 insertions, 71 deletions
diff --git a/Config.in b/Config.in
index 1b87c1251..204821091 100644
--- a/Config.in
+++ b/Config.in
@@ -251,23 +251,6 @@ config CONFIG_BUILD_AT_ONCE
251 251
252 Say 'N' unless you know what you are doing. 252 Say 'N' unless you know what you are doing.
253 253
254config CONFIG_FEATURE_SUSv2
255 bool "Enable features that are in SuSv2 but not SuSv3?"
256 default y
257 help
258 This option will enable backwards compatability with SuSv2,
259 specifically, numeric options such as 'head -1 <file>' will be
260 supported.
261
262config CONFIG_FEATURE_SUSv2_OBSOLETE
263 bool "Enable features that are obsolete in SuSv2"
264 depends on CONFIG_FEATURE_SUSv2
265 default y
266 help
267 Enable pre- SuSv2 features which are deprecated in SuSv2 and
268 above.
269 Disables support for e.g. numeric arguments in fold.
270
271endmenu 254endmenu
272 255
273menu 'Installation Options' 256menu 'Installation Options'
@@ -389,5 +372,13 @@ config CONFIG_EFENCE
389 372
390endchoice 373endchoice
391 374
375config CONFIG_DEBUG_YANK_SUSv2
376 bool "Disable obsolete features removed before SUSv3?"
377 default y
378 help
379 This option will disable backwards compatability with SuSv2,
380 specifically, old-style numeric options ('command -1 <file>')
381 will not be supported in head, tail, and fold. (Note: should
382 yank from renice too.)
392 383
393endmenu 384endmenu
diff --git a/Makefile b/Makefile
index 9841659fe..09504e766 100644
--- a/Makefile
+++ b/Makefile
@@ -184,7 +184,7 @@ randconfig: scripts/config/conf
184 184
185allyesconfig: scripts/config/conf 185allyesconfig: scripts/config/conf
186 @./scripts/config/conf -y $(CONFIG_CONFIG_IN) 186 @./scripts/config/conf -y $(CONFIG_CONFIG_IN)
187 sed -i -r -e "s/^(USING_CROSS_COMPILER|CONFIG_(DEBUG|STATIC|SELINUX|FEATURE_DEVFS|BUILD_AT_ONCE)).*/# \1 is not set/" .config 187 sed -i -r -e "s/^(USING_CROSS_COMPILER|CONFIG_(DEBUG.*|STATIC|SELINUX|FEATURE_DEVFS|BUILD_AT_ONCE))=.*/# \1 is not set/" .config
188 echo "CONFIG_FEATURE_SHARED_BUSYBOX=y" >> .config 188 echo "CONFIG_FEATURE_SHARED_BUSYBOX=y" >> .config
189 @./scripts/config/conf -o $(CONFIG_CONFIG_IN) 189 @./scripts/config/conf -o $(CONFIG_CONFIG_IN)
190 190
diff --git a/coreutils/fold.c b/coreutils/fold.c
index ee0fdc250..53ef44681 100644
--- a/coreutils/fold.c
+++ b/coreutils/fold.c
@@ -53,25 +53,25 @@ extern int fold_main(int argc, char **argv)
53 int errs = 0; 53 int errs = 0;
54 54
55 55
56#ifdef CONFIG_FEATURE_SUSv2_OBSOLETE 56 if(!ENABLE_DEBUG_YANK_SUSv2) {
57 /* Turn any numeric options into -w options. */ 57 /* Turn any numeric options into -w options. */
58 for (i = 1; i < argc; i++) { 58 for (i = 1; i < argc; i++) {
59 char const *a = argv[i]; 59 char const *a = argv[i];
60 60
61 if (a[0] == '-') { 61 if (a[0] == '-') {
62 if (a[1] == '-' && !a[2]) 62 if (a[1] == '-' && !a[2])
63 break; 63 break;
64 if (isdigit(a[1])) { 64 if (isdigit(a[1])) {
65 char *s = xmalloc(strlen(a) + 2); 65 char *s = xmalloc(strlen(a) + 2);
66 66
67 s[0] = '-'; 67 s[0] = '-';
68 s[1] = 'w'; 68 s[1] = 'w';
69 strcpy(s + 2, a + 1); 69 strcpy(s + 2, a + 1);
70 argv[i] = s; 70 argv[i] = s;
71 }
71 } 72 }
72 } 73 }
73 } 74 }
74#endif
75 75
76 flags = bb_getopt_ulflags(argc, argv, "bsw:", &w_opt); 76 flags = bb_getopt_ulflags(argc, argv, "bsw:", &w_opt);
77 if (flags & FLAG_WIDTH) 77 if (flags & FLAG_WIDTH)
diff --git a/coreutils/head.c b/coreutils/head.c
index eb0dcf212..17d3ef890 100644
--- a/coreutils/head.c
+++ b/coreutils/head.c
@@ -4,20 +4,7 @@
4 * 4 *
5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org> 5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 */ 8 */
22 9
23/* BB_AUDIT SUSv3 compliant */ 10/* BB_AUDIT SUSv3 compliant */
@@ -56,7 +43,7 @@ int head_main(int argc, char **argv)
56 int c; 43 int c;
57 int retval = EXIT_SUCCESS; 44 int retval = EXIT_SUCCESS;
58 45
59#if defined CONFIG_FEATURE_SUSv2 || ENABLE_FEATURE_FANCY_HEAD 46#if !ENABLE_DEBUG_YANK_SUSv2 || ENABLE_FEATURE_FANCY_HEAD
60 /* Allow legacy syntax of an initial numeric option without -n. */ 47 /* Allow legacy syntax of an initial numeric option without -n. */
61 if ((argc > 1) && (argv[1][0] == '-') 48 if ((argc > 1) && (argv[1][0] == '-')
62 /* && (isdigit)(argv[1][1]) */ 49 /* && (isdigit)(argv[1][1]) */
@@ -85,7 +72,7 @@ int head_main(int argc, char **argv)
85#endif 72#endif
86 case 'n': 73 case 'n':
87 p = optarg; 74 p = optarg;
88#if defined CONFIG_FEATURE_SUSv2 || ENABLE_FEATURE_FANCY_HEAD 75#if !ENABLE_DEBUG_YANK_SUSv2 || ENABLE_FEATURE_FANCY_HEAD
89 GET_COUNT: 76 GET_COUNT:
90#endif 77#endif
91 count = bb_xgetularg10(p); 78 count = bb_xgetularg10(p);
diff --git a/coreutils/tail.c b/coreutils/tail.c
index 49c00f3c9..48abc4b84 100644
--- a/coreutils/tail.c
+++ b/coreutils/tail.c
@@ -4,20 +4,7 @@
4 * 4 *
5 * Copyright (C) 2001 by Matt Kraai <kraai@alumni.carnegiemellon.edu> 5 * Copyright (C) 2001 by Matt Kraai <kraai@alumni.carnegiemellon.edu>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 */ 8 */
22 9
23/* BB_AUDIT SUSv3 compliant (need fancy for -c) */ 10/* BB_AUDIT SUSv3 compliant (need fancy for -c) */
@@ -53,11 +40,7 @@ static const struct suffix_mult tail_suffixes[] = {
53 { NULL, 0 } 40 { NULL, 0 }
54}; 41};
55 42
56static int status 43static int status;
57#if EXIT_SUCCESS != 0
58 = EXIT_SUCCESS /* If it is 0 (paranoid check), let bss initialize it. */
59#endif
60 ;
61 44
62static void tail_xprint_header(const char *fmt, const char *filename) 45static void tail_xprint_header(const char *fmt, const char *filename)
63{ 46{
@@ -121,7 +104,7 @@ int tail_main(int argc, char **argv)
121 char *s, *buf; 104 char *s, *buf;
122 const char *fmt; 105 const char *fmt;
123 106
124#if defined CONFIG_FEATURE_SUSv2 || ENABLE_FEATURE_FANCY_TAIL 107#if !ENABLE_DEBUG_YANK_SUSv2 || ENABLE_FEATURE_FANCY_TAIL
125 /* Allow legacy syntax of an initial numeric option without -n. */ 108 /* Allow legacy syntax of an initial numeric option without -n. */
126 if (argc >=2 && ((argv[1][0] == '+') || ((argv[1][0] == '-') 109 if (argc >=2 && ((argv[1][0] == '+') || ((argv[1][0] == '-')
127 /* && (isdigit)(argv[1][1]) */ 110 /* && (isdigit)(argv[1][1]) */
@@ -142,7 +125,7 @@ int tail_main(int argc, char **argv)
142 count_bytes = 1; 125 count_bytes = 1;
143 /* FALLS THROUGH */ 126 /* FALLS THROUGH */
144 case 'n': 127 case 'n':
145#if defined CONFIG_FEATURE_SUSv2 || ENABLE_FEATURE_FANCY_TAIL 128#if !ENABLE_DEBUG_YANK_SUSv2 || ENABLE_FEATURE_FANCY_TAIL
146 GET_COUNT: 129 GET_COUNT:
147#endif 130#endif
148 count = bb_xgetlarg10_sfx(optarg, tail_suffixes); 131 count = bb_xgetlarg10_sfx(optarg, tail_suffixes);