diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-12 08:12:33 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-12 08:12:33 +0000 |
commit | cc5e090f12fb4e3834fb1a55bc91d7618af8ce78 (patch) | |
tree | 34813e8836287c21cb893ab7d3aee666db415d62 /debianutils | |
parent | aa198dd39cad6cb41fbf6c8b64301b581a9ba206 (diff) | |
download | busybox-w32-cc5e090f12fb4e3834fb1a55bc91d7618af8ce78.tar.gz busybox-w32-cc5e090f12fb4e3834fb1a55bc91d7618af8ce78.tar.bz2 busybox-w32-cc5e090f12fb4e3834fb1a55bc91d7618af8ce78.zip |
move several applets to more correct ex-project. No code changes.
Diffstat (limited to 'debianutils')
-rw-r--r-- | debianutils/Config.in | 14 | ||||
-rw-r--r-- | debianutils/Kbuild | 11 | ||||
-rw-r--r-- | debianutils/readlink.c | 50 |
3 files changed, 5 insertions, 70 deletions
diff --git a/debianutils/Config.in b/debianutils/Config.in index c49197666..50ccac803 100644 --- a/debianutils/Config.in +++ b/debianutils/Config.in | |||
@@ -17,20 +17,6 @@ config PIPE_PROGRESS | |||
17 | help | 17 | help |
18 | Display a dot to indicate pipe activity. | 18 | Display a dot to indicate pipe activity. |
19 | 19 | ||
20 | config READLINK | ||
21 | bool "readlink" | ||
22 | default n | ||
23 | help | ||
24 | This program reads a symbolic link and returns the name | ||
25 | of the file it points to | ||
26 | |||
27 | config FEATURE_READLINK_FOLLOW | ||
28 | bool "Enable canonicalization by following all symlinks (-f)" | ||
29 | default n | ||
30 | depends on READLINK | ||
31 | help | ||
32 | Enable the readlink option (-f). | ||
33 | |||
34 | config RUN_PARTS | 20 | config RUN_PARTS |
35 | bool "run-parts" | 21 | bool "run-parts" |
36 | default n | 22 | default n |
diff --git a/debianutils/Kbuild b/debianutils/Kbuild index 99df6a536..bcf6126ad 100644 --- a/debianutils/Kbuild +++ b/debianutils/Kbuild | |||
@@ -5,9 +5,8 @@ | |||
5 | # Licensed under the GPL v2, see the file LICENSE in this tarball. | 5 | # Licensed under the GPL v2, see the file LICENSE in this tarball. |
6 | 6 | ||
7 | lib-y:= | 7 | lib-y:= |
8 | lib-$(CONFIG_MKTEMP) += mktemp.o | 8 | lib-$(CONFIG_MKTEMP) += mktemp.o |
9 | lib-$(CONFIG_PIPE_PROGRESS) += pipe_progress.o | 9 | lib-$(CONFIG_PIPE_PROGRESS) += pipe_progress.o |
10 | lib-$(CONFIG_READLINK) += readlink.o | 10 | lib-$(CONFIG_RUN_PARTS) += run_parts.o |
11 | lib-$(CONFIG_RUN_PARTS) += run_parts.o | 11 | lib-$(CONFIG_START_STOP_DAEMON) += start_stop_daemon.o |
12 | lib-$(CONFIG_START_STOP_DAEMON) += start_stop_daemon.o | 12 | lib-$(CONFIG_WHICH) += which.o |
13 | lib-$(CONFIG_WHICH) += which.o | ||
diff --git a/debianutils/readlink.c b/debianutils/readlink.c deleted file mode 100644 index d454cbf19..000000000 --- a/debianutils/readlink.c +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | ||
2 | /* | ||
3 | * Mini readlink implementation for busybox | ||
4 | * | ||
5 | * Copyright (C) 2000,2001 Matt Kraai <kraai@alumni.carnegiemellon.edu> | ||
6 | * | ||
7 | * Licensed under GPL v2 or later, see file LICENSE in this tarball for details. | ||
8 | */ | ||
9 | |||
10 | #include <getopt.h> | ||
11 | |||
12 | #include "libbb.h" | ||
13 | |||
14 | int readlink_main(int argc, char **argv); | ||
15 | int readlink_main(int argc, char **argv) | ||
16 | { | ||
17 | char *buf; | ||
18 | char *fname; | ||
19 | |||
20 | USE_FEATURE_READLINK_FOLLOW( | ||
21 | unsigned opt; | ||
22 | /* We need exactly one non-option argument. */ | ||
23 | opt_complementary = "=1"; | ||
24 | opt = getopt32(argc, argv, "f"); | ||
25 | fname = argv[optind]; | ||
26 | ) | ||
27 | SKIP_FEATURE_READLINK_FOLLOW( | ||
28 | const unsigned opt = 0; | ||
29 | if (argc != 2) bb_show_usage(); | ||
30 | fname = argv[1]; | ||
31 | ) | ||
32 | |||
33 | /* compat: coreutils readlink reports errors silently via exit code */ | ||
34 | logmode = LOGMODE_NONE; | ||
35 | |||
36 | if (opt) { | ||
37 | buf = realpath(fname, bb_common_bufsiz1); | ||
38 | } else { | ||
39 | buf = xmalloc_readlink_or_warn(fname); | ||
40 | } | ||
41 | |||
42 | if (!buf) | ||
43 | return EXIT_FAILURE; | ||
44 | puts(buf); | ||
45 | |||
46 | if (ENABLE_FEATURE_CLEAN_UP && !opt) | ||
47 | free(buf); | ||
48 | |||
49 | fflush_stdout_and_exit(EXIT_SUCCESS); | ||
50 | } | ||