Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/coreutils/cp.c
- Timestamp:
- Dec 20, 2016, 4:07:32 PM (7 years ago)
- Location:
- branches/3.3
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mindi-busybox/coreutils/cp.c
r3232 r3621 32 32 //usage: "\n -i Prompt before overwrite" 33 33 //usage: "\n -l,-s Create (sym)links" 34 //usage: "\n -u Copy only newer files" 34 35 35 36 #include "libbb.h" … … 50 51 int status; 51 52 enum { 52 OPT_a = 1 << (sizeof(FILEUTILS_CP_OPTSTR)-1), 53 OPT_r = 1 << (sizeof(FILEUTILS_CP_OPTSTR)), 54 OPT_P = 1 << (sizeof(FILEUTILS_CP_OPTSTR)+1), 55 OPT_v = 1 << (sizeof(FILEUTILS_CP_OPTSTR)+2), 56 #if ENABLE_FEATURE_CP_LONG_OPTIONS 57 OPT_parents = 1 << (sizeof(FILEUTILS_CP_OPTSTR)+3), 53 FILEUTILS_CP_OPTNUM = sizeof(FILEUTILS_CP_OPTSTR)-1, 54 #if ENABLE_FEATURE_CP_LONG_OPTIONS 55 /*OPT_rmdest = FILEUTILS_RMDEST = 1 << FILEUTILS_CP_OPTNUM */ 56 OPT_parents = 1 << (FILEUTILS_CP_OPTNUM+1), 58 57 #endif 59 58 }; … … 77 76 "symbolic-link\0" No_argument "s" 78 77 "verbose\0" No_argument "v" 79 "parents\0" No_argument "\xff" 78 "update\0" No_argument "u" 79 "remove-destination\0" No_argument "\xff" 80 "parents\0" No_argument "\xfe" 80 81 ; 81 82 #endif 82 // -v (--verbose) is ignored 83 flags = getopt32(argv, FILEUTILS_CP_OPTSTR "arPv"); 83 flags = getopt32(argv, FILEUTILS_CP_OPTSTR); 84 84 /* Options of cp from GNU coreutils 6.10: 85 85 * -a, --archive … … 96 96 * -p same as --preserve=mode,ownership,timestamps 97 97 * -c same as --preserve=context 98 * -u, --update 99 * copy only when the SOURCE file is newer than the destination 100 * file or when the destination file is missing 101 * --remove-destination 102 * remove each existing destination file before attempting to open 98 103 * --parents 99 104 * use full source file name under DIRECTORY … … 108 113 * if possible additional attributes: security context,links,all 109 114 * --no-preserve=ATTR_LIST 110 * --remove-destination111 * remove each existing destination file before attempting to open112 115 * --sparse=WHEN 113 116 * control creation of sparse files … … 120 123 * -T, --no-target-directory 121 124 * treat DEST as a normal file 122 * -u, --update123 * copy only when the SOURCE file is newer than the destination124 * file or when the destination file is missing125 125 * -x, --one-file-system 126 126 * stay on this file system … … 158 158 159 159 #if ENABLE_FEATURE_CP_LONG_OPTIONS 160 //bb_error_msg("flags:%x FILEUTILS_RMDEST:%x OPT_parents:%x", 161 // flags, FILEUTILS_RMDEST, OPT_parents); 160 162 if (flags & OPT_parents) { 161 163 if (!(d_flags & 2)) { 162 164 bb_error_msg_and_die("with --parents, the destination must be a directory"); 163 165 } 166 } 167 if (flags & FILEUTILS_RMDEST) { 168 flags |= FILEUTILS_FORCE; 164 169 } 165 170 #endif
Note:
See TracChangeset
for help on using the changeset viewer.