Delete output files before copying to them.

Avoid ETXTBSY when copying over a file that's being executed.

Test: manual
Test: m -j
Change-Id: I0427b5018e67e12f685bce95028831b5661eee2c
This commit is contained in:
Josh Gao
2017-07-26 14:09:50 -07:00
parent f5720175dd
commit ae15271392

View File

@@ -47,7 +47,7 @@ var (
// A copy rule.
Cp = pctx.AndroidStaticRule("Cp",
blueprint.RuleParams{
Command: "cp $cpPreserveSymlinks $cpFlags $in $out",
Command: "rm -f $out && cp $cpPreserveSymlinks $cpFlags $in $out",
Description: "cp $out",
},
"cpFlags")