1*9e94795aSAndroid Build Coastguard WorkerREADME for Android "acp" Command 2*9e94795aSAndroid Build Coastguard Worker 3*9e94795aSAndroid Build Coastguard WorkerThe "cp" command was judged and found wanting. The issues are: 4*9e94795aSAndroid Build Coastguard Worker 5*9e94795aSAndroid Build Coastguard WorkerMac OS X: 6*9e94795aSAndroid Build Coastguard Worker - Uses the BSD cp, not the fancy GNU cp. It lacks the "-u" flag, which 7*9e94795aSAndroid Build Coastguard Worker only copies files if they are newer than the destination. This can 8*9e94795aSAndroid Build Coastguard Worker slow the build when copying lots of content. 9*9e94795aSAndroid Build Coastguard Worker - Doesn't take the "-d" flag, which causes symlinks to be copied as 10*9e94795aSAndroid Build Coastguard Worker links. This is the default behavior, so it's not all bad, but it 11*9e94795aSAndroid Build Coastguard Worker complains if you supply "-d". 12*9e94795aSAndroid Build Coastguard Worker 13*9e94795aSAndroid Build Coastguard WorkerMinGW/Cygwin: 14*9e94795aSAndroid Build Coastguard Worker - Gets really weird when copying a file called "foo.exe", failing with 15*9e94795aSAndroid Build Coastguard Worker "cp: skipping file 'foo.exe', as it was replaced while being copied". 16*9e94795aSAndroid Build Coastguard Worker This only seems to happen when the source file is on an NFS/Samba 17*9e94795aSAndroid Build Coastguard Worker volume. "cp" works okay copying from local disk. 18*9e94795aSAndroid Build Coastguard Worker 19*9e94795aSAndroid Build Coastguard WorkerLinux: 20*9e94795aSAndroid Build Coastguard Worker - On some systems it's possible to have microsecond-accurate timestamps 21*9e94795aSAndroid Build Coastguard Worker on an NFS volume, and non-microsecond timestamps on a local volume. 22*9e94795aSAndroid Build Coastguard Worker If you copy from NFS to local disk, your NFS files will always be 23*9e94795aSAndroid Build Coastguard Worker newer, because the local disk time stamp is truncated rather than 24*9e94795aSAndroid Build Coastguard Worker rounded up. This foils the "-u" flag if you also supply the "-p" flag 25*9e94795aSAndroid Build Coastguard Worker to preserve timestamps. 26*9e94795aSAndroid Build Coastguard Worker - The Darwin linker insists that ranlib be current. If you copy the 27*9e94795aSAndroid Build Coastguard Worker library, the time stamp no longer matches. Preserving the time 28*9e94795aSAndroid Build Coastguard Worker stamp is essential, so simply turning the "-p" flag off doesn't work. 29*9e94795aSAndroid Build Coastguard Worker 30*9e94795aSAndroid Build Coastguard WorkerFutzing around these in make with GNU make functions is awkward at best. 31*9e94795aSAndroid Build Coastguard WorkerIt's easier and more reliable to write a cp command that works properly. 32*9e94795aSAndroid Build Coastguard Worker 33*9e94795aSAndroid Build Coastguard Worker 34*9e94795aSAndroid Build Coastguard WorkerThe "acp" command takes most of the standard flags, following the GNU 35*9e94795aSAndroid Build Coastguard Workerconventions. It adds a "-e" flag, used when copying executables around. 36*9e94795aSAndroid Build Coastguard WorkerOn most systems it is ignored, but on MinGW/Cygwin it allows "cp foo bar" 37*9e94795aSAndroid Build Coastguard Workerto work when what is actually meant is "cp foo.exe bar.exe". Unlike the 38*9e94795aSAndroid Build Coastguard Workerdefault Cygwin cp, "acp foo bar" will not find foo.exe unless you add 39*9e94795aSAndroid Build Coastguard Workerthe "-e" flag, avoiding potential ambiguity. 40*9e94795aSAndroid Build Coastguard Worker 41