diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2021-06-22 15:28:34 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2021-06-22 15:28:34 +0200 |
commit | 56bbbfae7df48f778362d1848d2a4afd2c293d76 (patch) | |
tree | b0ad2dff6ec225e2f41383f870f2f55d47911dd8 /include | |
parent | 91b9549a8c739e5f0061dffb292d0dedbe913892 (diff) | |
download | busybox-w32-56bbbfae7df48f778362d1848d2a4afd2c293d76.tar.gz busybox-w32-56bbbfae7df48f778362d1848d2a4afd2c293d76.tar.bz2 busybox-w32-56bbbfae7df48f778362d1848d2a4afd2c293d76.zip |
cp: implement -n
function old new delta
.rodata 103681 103722 +41
packed_usage 33698 33717 +19
copy_file 1678 1696 +18
cp_main 500 492 -8
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/1 up/down: 78/-8) Total: 70 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/include/libbb.h b/include/libbb.h index e38e97ac2..251d7231c 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -450,28 +450,29 @@ enum { /* cp.c, mv.c, install.c depend on these values. CAREFUL when changing th | |||
450 | FILEUTILS_RECUR = 1 << 2, /* -R */ | 450 | FILEUTILS_RECUR = 1 << 2, /* -R */ |
451 | FILEUTILS_FORCE = 1 << 3, /* -f */ | 451 | FILEUTILS_FORCE = 1 << 3, /* -f */ |
452 | FILEUTILS_INTERACTIVE = 1 << 4, /* -i */ | 452 | FILEUTILS_INTERACTIVE = 1 << 4, /* -i */ |
453 | FILEUTILS_MAKE_HARDLINK = 1 << 5, /* -l */ | 453 | FILEUTILS_NO_OVERWRITE = 1 << 5, /* -n */ |
454 | FILEUTILS_MAKE_SOFTLINK = 1 << 6, /* -s */ | 454 | FILEUTILS_MAKE_HARDLINK = 1 << 6, /* -l */ |
455 | FILEUTILS_DEREF_SOFTLINK = 1 << 7, /* -L */ | 455 | FILEUTILS_MAKE_SOFTLINK = 1 << 7, /* -s */ |
456 | FILEUTILS_DEREFERENCE_L0 = 1 << 8, /* -H */ | 456 | FILEUTILS_DEREF_SOFTLINK = 1 << 8, /* -L */ |
457 | FILEUTILS_DEREFERENCE_L0 = 1 << 9, /* -H */ | ||
457 | /* -a = -pdR (mapped in cp.c) */ | 458 | /* -a = -pdR (mapped in cp.c) */ |
458 | /* -r = -dR (mapped in cp.c) */ | 459 | /* -r = -dR (mapped in cp.c) */ |
459 | /* -P = -d (mapped in cp.c) */ | 460 | /* -P = -d (mapped in cp.c) */ |
460 | FILEUTILS_VERBOSE = (1 << 12) * ENABLE_FEATURE_VERBOSE, /* -v */ | 461 | FILEUTILS_VERBOSE = (1 << 13) * ENABLE_FEATURE_VERBOSE, /* -v */ |
461 | FILEUTILS_UPDATE = 1 << 13, /* -u */ | 462 | FILEUTILS_UPDATE = 1 << 14, /* -u */ |
462 | FILEUTILS_NO_TARGET_DIR = 1 << 14, /* -T */ | 463 | FILEUTILS_NO_TARGET_DIR = 1 << 15, /* -T */ |
463 | FILEUTILS_TARGET_DIR = 1 << 15, /* -t DIR */ | 464 | FILEUTILS_TARGET_DIR = 1 << 16, /* -t DIR */ |
464 | #if ENABLE_SELINUX | 465 | #if ENABLE_SELINUX |
465 | FILEUTILS_PRESERVE_SECURITY_CONTEXT = 1 << 16, /* -c */ | 466 | FILEUTILS_PRESERVE_SECURITY_CONTEXT = 1 << 17, /* -c */ |
466 | #endif | 467 | #endif |
467 | #define FILEUTILS_CP_OPTSTR "pdRfilsLHarPvuTt:" IF_SELINUX("c") | 468 | #define FILEUTILS_CP_OPTSTR "pdRfinlsLHarPvuTt:" IF_SELINUX("c") |
468 | /* How many bits in FILEUTILS_CP_OPTSTR? */ | 469 | /* How many bits in FILEUTILS_CP_OPTSTR? */ |
469 | FILEUTILS_CP_OPTNUM = 17 - !ENABLE_SELINUX, | 470 | FILEUTILS_CP_OPTBITS = 18 - !ENABLE_SELINUX, |
470 | 471 | ||
471 | FILEUTILS_RMDEST = 1 << (17 - !ENABLE_SELINUX), /* --remove-destination */ | 472 | FILEUTILS_RMDEST = 1 << (19 - !ENABLE_SELINUX), /* cp --remove-destination */ |
472 | /* bit 18 skipped for "cp --parents" */ | 473 | /* bit 18 skipped for "cp --parents" */ |
473 | FILEUTILS_REFLINK = 1 << (19 - !ENABLE_SELINUX), /* cp --reflink=auto */ | 474 | FILEUTILS_REFLINK = 1 << (20 - !ENABLE_SELINUX), /* cp --reflink=auto */ |
474 | FILEUTILS_REFLINK_ALWAYS = 1 << (20 - !ENABLE_SELINUX), /* cp --reflink[=always] */ | 475 | FILEUTILS_REFLINK_ALWAYS = 1 << (21 - !ENABLE_SELINUX), /* cp --reflink[=always] */ |
475 | /* | 476 | /* |
476 | * Hole. cp may have some bits set here, | 477 | * Hole. cp may have some bits set here, |
477 | * they should not affect remove_file()/copy_file() | 478 | * they should not affect remove_file()/copy_file() |