diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2021-06-21 19:35:33 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2021-06-21 19:38:39 +0200 |
commit | 0ec52d438a41be92d2d8e8651242b4d9faf23a6c (patch) | |
tree | c80be8cec69e3852a151e5d3329d1d63d2f7d672 /include | |
parent | 1de709fda2e75aeef160b3b13a43865e7a622f06 (diff) | |
download | busybox-w32-0ec52d438a41be92d2d8e8651242b4d9faf23a6c.tar.gz busybox-w32-0ec52d438a41be92d2d8e8651242b4d9faf23a6c.tar.bz2 busybox-w32-0ec52d438a41be92d2d8e8651242b4d9faf23a6c.zip |
cp: implement -t DIR
function old new delta
packed_usage 33713 33734 +21
.rodata 103670 103672 +2
cp_main 506 500 -6
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/1 up/down: 23/-6) Total: 17 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/include/libbb.h b/include/libbb.h index 9a95a176d..e38e97ac2 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -460,13 +460,18 @@ enum { /* cp.c, mv.c, install.c depend on these values. CAREFUL when changing th | |||
460 | FILEUTILS_VERBOSE = (1 << 12) * ENABLE_FEATURE_VERBOSE, /* -v */ | 460 | FILEUTILS_VERBOSE = (1 << 12) * ENABLE_FEATURE_VERBOSE, /* -v */ |
461 | FILEUTILS_UPDATE = 1 << 13, /* -u */ | 461 | FILEUTILS_UPDATE = 1 << 13, /* -u */ |
462 | FILEUTILS_NO_TARGET_DIR = 1 << 14, /* -T */ | 462 | FILEUTILS_NO_TARGET_DIR = 1 << 14, /* -T */ |
463 | FILEUTILS_TARGET_DIR = 1 << 15, /* -t DIR */ | ||
463 | #if ENABLE_SELINUX | 464 | #if ENABLE_SELINUX |
464 | FILEUTILS_PRESERVE_SECURITY_CONTEXT = 1 << 15, /* -c */ | 465 | FILEUTILS_PRESERVE_SECURITY_CONTEXT = 1 << 16, /* -c */ |
465 | #endif | 466 | #endif |
466 | FILEUTILS_RMDEST = 1 << (16 - !ENABLE_SELINUX), /* --remove-destination */ | 467 | #define FILEUTILS_CP_OPTSTR "pdRfilsLHarPvuTt:" IF_SELINUX("c") |
467 | /* bit 17 skipped for "cp --parents" */ | 468 | /* How many bits in FILEUTILS_CP_OPTSTR? */ |
468 | FILEUTILS_REFLINK = 1 << (18 - !ENABLE_SELINUX), /* cp --reflink=auto */ | 469 | FILEUTILS_CP_OPTNUM = 17 - !ENABLE_SELINUX, |
469 | FILEUTILS_REFLINK_ALWAYS = 1 << (19 - !ENABLE_SELINUX), /* cp --reflink[=always] */ | 470 | |
471 | FILEUTILS_RMDEST = 1 << (17 - !ENABLE_SELINUX), /* --remove-destination */ | ||
472 | /* bit 18 skipped for "cp --parents" */ | ||
473 | FILEUTILS_REFLINK = 1 << (19 - !ENABLE_SELINUX), /* cp --reflink=auto */ | ||
474 | FILEUTILS_REFLINK_ALWAYS = 1 << (20 - !ENABLE_SELINUX), /* cp --reflink[=always] */ | ||
470 | /* | 475 | /* |
471 | * Hole. cp may have some bits set here, | 476 | * Hole. cp may have some bits set here, |
472 | * they should not affect remove_file()/copy_file() | 477 | * they should not affect remove_file()/copy_file() |
@@ -476,7 +481,7 @@ enum { /* cp.c, mv.c, install.c depend on these values. CAREFUL when changing th | |||
476 | #endif | 481 | #endif |
477 | FILEUTILS_IGNORE_CHMOD_ERR = 1 << 31, | 482 | FILEUTILS_IGNORE_CHMOD_ERR = 1 << 31, |
478 | }; | 483 | }; |
479 | #define FILEUTILS_CP_OPTSTR "pdRfilsLHarPvuT" IF_SELINUX("c") | 484 | |
480 | extern int remove_file(const char *path, int flags) FAST_FUNC; | 485 | extern int remove_file(const char *path, int flags) FAST_FUNC; |
481 | /* NB: without FILEUTILS_RECUR in flags, it will basically "cat" | 486 | /* NB: without FILEUTILS_RECUR in flags, it will basically "cat" |
482 | * the source, not copy (unless "source" is a directory). | 487 | * the source, not copy (unless "source" is a directory). |