From f1a98af5fcc253081bea85b22ddd64422737394a Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Mon, 29 Feb 2016 12:45:18 -0800 Subject: [PATCH] Replace some uses of acp with cp ACP was originally created to overcome differences with cp between Linux, Darwin, and Windows. We've since dropped Windows as a build host, and don't use features like '-u' anymore. For most of our current usecases, 'acp' is identical to 'cp' except that it splits 'cp -p' into 'acp -p' for mode and ownership, and 'acp -t' for timestamps. On Linux, this could be specified using '--preserve=mode,ownership', but Darwin doesn't have this. Since we're removing the destination file before copying, 'cp' already preserves the mode (modulated by the umask). So the only extra thing that gets preserved with 'acp -p' is ownership, which we should not care about in the build system. (In many cases we shouldn't be preserving mode either, so that readonly source trees can actually be marked readonly, but that will be a future change) Change-Id: Ied96fdc303ac5c774347c07363daec8b6dfb22e4 --- core/definitions.mk | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/core/definitions.mk b/core/definitions.mk index 6960ff34e..9cce072e6 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -2363,7 +2363,7 @@ endef # $(1): source file # $(2): destination file define copy-one-file -$(2): $(1) | $(ACP) +$(2): $(1) @echo "Copy: $$@" $$(copy-file-to-target) endef @@ -2399,13 +2399,15 @@ endef # Copy a single file from one place to another, # preserving permissions and overwriting any existing # file. -# We disable the "-t" option for acp cannot handle -# high resolution timestamp correctly on file systems like ext4. -# Therefore copy-file-to-target is the same as copy-file-to-new-target. +# When we used acp, it could not handle high resolution timestamps +# on file systems like ext4. Because of that, '-t' option was disabled +# and copy-file-to-target was identical to copy-file-to-new-target. +# Keep the behavior until we audit and ensure that switching this back +# won't break anything. define copy-file-to-target @mkdir -p $(dir $@) $(hide) rm -f $@ -$(hide) $(ACP) -p $< $@ +$(hide) cp $< $@ endef # The same as copy-file-to-target, but use the local @@ -2436,7 +2438,7 @@ endef define copy-file-to-new-target @mkdir -p $(dir $@) $(hide) rm -f $@ -$(hide) $(ACP) -p $< $@ +$(hide) cp $< $@ endef # The same as copy-file-to-new-target, but use the local -- 2.11.0