Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 3545eeb6 authored by Dan Willemsen's avatar Dan Willemsen
Browse files

Remove destination before copying file

If there's a symlink as the destination to one of these macros,
currently we'll write to the destination of that symlink instead of
overwriting the symlink. We've run into this a few times when a module
is added to replace a symlink that used to exist via
LOCAL_POST_INSTALL_CMD. These have required manual discovery, and
additions to CleanSpec.mk files:
http://android-review.googlesource.com/143334

Use `rm -f` for single-file targets to remove the destination before
copying. On Linux, `cp --remove-destination` can work, but is not
supported by Darwin or acp.

There may still be problems with dependencies when symlinks are
involved, since ninja will use the destination of the symlink to check
whether it is up to date. But at least with this change, if any
dependency gets regenerated, we'll properly reset the file.

Change-Id: I6d3ac0bd9ced5e21a0ff9dad0eaff012a7bc9c75
parent b044f082
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment