summaryrefslogtreecommitdiff
path: root/android/defs.go
diff options
context:
space:
mode:
author Cole Faust <colefaust@google.com> 2023-08-31 11:00:25 -0700
committer Cole Faust <colefaust@google.com> 2023-08-31 11:00:25 -0700
commit20f2030e29677e4cef5d2ac58ebb6b870e6fbcf5 (patch)
treef41e82af68f0b3fb0fe09cf37c9b3df935ba6614 /android/defs.go
parent8bbe26cad78f2d36e113a356c3cfa5e8d37c8c16 (diff)
Use aquery results to determine if a file should be executable
Now that aquery includes this information. Also added rm -f $out to some rules, because since they write files by shell redirection, if the file existed before and was executable, they wouldn't make the file non-executable and visa versa. Fixes: 297366783 Test: m bazel_sandwich Change-Id: Ie5b6c4275b162601f51deaec9912eea4be16988d
Diffstat (limited to 'android/defs.go')
-rw-r--r--android/defs.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/android/defs.go b/android/defs.go
index 682111ea5..b28d2fa3d 100644
--- a/android/defs.go
+++ b/android/defs.go
@@ -107,8 +107,8 @@ var (
Cat = pctx.AndroidStaticRule("Cat",
blueprint.RuleParams{
- Command: "cat $in > $out",
- Description: "concatenate licenses $out",
+ Command: "rm -f $out && cat $in > $out",
+ Description: "concatenate files to $out",
})
// ubuntu 14.04 offcially use dash for /bin/sh, and its builtin echo command
@@ -116,7 +116,7 @@ var (
// content to file.
writeFile = pctx.AndroidStaticRule("writeFile",
blueprint.RuleParams{
- Command: `/bin/bash -c 'echo -e -n "$$0" > $out' $content`,
+ Command: `rm -f $out && /bin/bash -c 'echo -e -n "$$0" > $out' $content`,
Description: "writing file $out",
},
"content")