rev |
line source |
pascal@2585
|
1 --- busybox-1.12.0/coreutils/install.c
|
pascal@2585
|
2 +++ busybox-1.12.0/coreutils/install.c
|
pascal@2585
|
3 @@ -93,9 +93,10 @@
|
pascal@2585
|
4 OPT_GROUP = 1 << 6,
|
pascal@2585
|
5 OPT_MODE = 1 << 7,
|
pascal@2585
|
6 OPT_OWNER = 1 << 8,
|
pascal@2585
|
7 + OPT_D = 1 << 9,
|
pascal@2585
|
8 #if ENABLE_SELINUX
|
pascal@2585
|
9 - OPT_SET_SECURITY_CONTEXT = 1 << 9,
|
pascal@2585
|
10 - OPT_PRESERVE_SECURITY_CONTEXT = 1 << 10,
|
pascal@2585
|
11 + OPT_SET_SECURITY_CONTEXT = 1 << 10,
|
pascal@2585
|
12 + OPT_PRESERVE_SECURITY_CONTEXT = 1 << 11,
|
pascal@2585
|
13 #endif
|
pascal@2585
|
14 };
|
pascal@2585
|
15
|
pascal@2585
|
16 @@ -106,7 +107,7 @@
|
pascal@2585
|
17 /* -c exists for backwards compatibility, it's needed */
|
pascal@2585
|
18 /* -v is ignored ("print name of each created directory") */
|
pascal@2585
|
19 /* -b is ignored ("make a backup of each existing destination file") */
|
pascal@2585
|
20 - flags = getopt32(argv, "cvb" "dpsg:m:o:" USE_SELINUX("Z:"),
|
pascal@2585
|
21 + flags = getopt32(argv, "cvb" "dpsg:m:o:D" USE_SELINUX("Z:"),
|
pascal@2585
|
22 &gid_str, &mode_str, &uid_str USE_SELINUX(, &scontext));
|
pascal@2585
|
23 argc -= optind;
|
pascal@2585
|
24 argv += optind;
|
pascal@2585
|
25 @@ -161,6 +162,12 @@
|
pascal@2585
|
26 } else {
|
pascal@2585
|
27 if (isdir)
|
pascal@2585
|
28 dest = concat_path_file(last, basename(arg));
|
pascal@2585
|
29 + if (flags & OPT_D) {
|
pascal@2585
|
30 + char *dir = xstrdup(dest);
|
pascal@2585
|
31 + bb_make_directory(dirname(dir), 0755, FILEUTILS_RECUR);
|
pascal@2585
|
32 + if (ENABLE_FEATURE_CLEAN_UP)
|
pascal@2585
|
33 + free(dir);
|
pascal@2585
|
34 + }
|
pascal@2585
|
35 if (copy_file(arg, dest, copy_flags)) {
|
pascal@2585
|
36 /* copy is not made */
|
pascal@2585
|
37 ret = EXIT_FAILURE;
|
pascal@2585
|
38
|
pascal@2585
|
39 --- busybox-1.12.0/include/usage.h
|
pascal@2585
|
40 +++ busybox-1.12.0/include/usage.h
|
pascal@2585
|
41 @@ -1869,12 +1869,13 @@
|
pascal@2585
|
42 )
|
pascal@2585
|
43
|
pascal@2585
|
44 #define install_trivial_usage \
|
pascal@2585
|
45 - "[-cgmops] [sources] dest|directory"
|
pascal@2585
|
46 + "[-cdDgmops] [sources] dest|directory"
|
pascal@2585
|
47 #define install_full_usage "\n\n" \
|
pascal@2585
|
48 "Copy files and set attributes\n" \
|
pascal@2585
|
49 "\nOptions:" \
|
pascal@2585
|
50 "\n -c Copy the file, default" \
|
pascal@2585
|
51 "\n -d Create directories" \
|
pascal@2585
|
52 + "\n -D Create target path" \
|
pascal@2585
|
53 "\n -g Set group ownership" \
|
pascal@2585
|
54 "\n -m Set permissions" \
|
pascal@2585
|
55 "\n -o Set ownership" \
|