# HG changeset patch # User Pascal Bellard # Date 1239120231 0 # Node ID 3b9c9f5954e2031c266a5fb8b3c17083564015ce # Parent 285b47e3673ca20d84d2bf3d9c0d75d282739532 busybox/install: add -D support diff -r 285b47e3673c -r 3b9c9f5954e2 busybox-pam/receipt --- a/busybox-pam/receipt Tue Apr 07 14:20:40 2009 +0000 +++ b/busybox-pam/receipt Tue Apr 07 16:03:51 2009 +0000 @@ -34,6 +34,7 @@ modprobe.u paths.u mkswap.u +install.u EOT cp $WOK/busybox/stuff/$SOURCE-$VERSION.config .config sed -i 's/# CONFIG_PAM is not set/CONFIG_PAM=y/' .config diff -r 285b47e3673c -r 3b9c9f5954e2 busybox/receipt --- a/busybox/receipt Tue Apr 07 14:20:40 2009 +0000 +++ b/busybox/receipt Tue Apr 07 16:03:51 2009 +0000 @@ -32,6 +32,7 @@ modprobe.u paths.u mkswap.u +install.u EOT cp ../stuff/$PACKAGE-$VERSION.config .config make oldconfig diff -r 285b47e3673c -r 3b9c9f5954e2 busybox/stuff/busybox-1.12.0-install.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/busybox/stuff/busybox-1.12.0-install.u Tue Apr 07 16:03:51 2009 +0000 @@ -0,0 +1,55 @@ +--- busybox-1.12.0/coreutils/install.c ++++ busybox-1.12.0/coreutils/install.c +@@ -93,9 +93,10 @@ + OPT_GROUP = 1 << 6, + OPT_MODE = 1 << 7, + OPT_OWNER = 1 << 8, ++ OPT_D = 1 << 9, + #if ENABLE_SELINUX +- OPT_SET_SECURITY_CONTEXT = 1 << 9, +- OPT_PRESERVE_SECURITY_CONTEXT = 1 << 10, ++ OPT_SET_SECURITY_CONTEXT = 1 << 10, ++ OPT_PRESERVE_SECURITY_CONTEXT = 1 << 11, + #endif + }; + +@@ -106,7 +107,7 @@ + /* -c exists for backwards compatibility, it's needed */ + /* -v is ignored ("print name of each created directory") */ + /* -b is ignored ("make a backup of each existing destination file") */ +- flags = getopt32(argv, "cvb" "dpsg:m:o:" USE_SELINUX("Z:"), ++ flags = getopt32(argv, "cvb" "dpsg:m:o:D" USE_SELINUX("Z:"), + &gid_str, &mode_str, &uid_str USE_SELINUX(, &scontext)); + argc -= optind; + argv += optind; +@@ -161,6 +162,12 @@ + } else { + if (isdir) + dest = concat_path_file(last, basename(arg)); ++ if (flags & OPT_D) { ++ char *dir = xstrdup(dest); ++ bb_make_directory(dirname(dir), 0755, FILEUTILS_RECUR); ++ if (ENABLE_FEATURE_CLEAN_UP) ++ free(dir); ++ } + if (copy_file(arg, dest, copy_flags)) { + /* copy is not made */ + ret = EXIT_FAILURE; + +--- busybox-1.12.0/include/usage.h ++++ busybox-1.12.0/include/usage.h +@@ -1869,12 +1869,13 @@ + ) + + #define install_trivial_usage \ +- "[-cgmops] [sources] dest|directory" ++ "[-cdDgmops] [sources] dest|directory" + #define install_full_usage "\n\n" \ + "Copy files and set attributes\n" \ + "\nOptions:" \ + "\n -c Copy the file, default" \ + "\n -d Create directories" \ ++ "\n -D Create target path" \ + "\n -g Set group ownership" \ + "\n -m Set permissions" \ + "\n -o Set ownership" \