aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/soong_ui/main.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/cmd/soong_ui/main.go b/cmd/soong_ui/main.go
index 39303bf2..ec4f90e0 100644
--- a/cmd/soong_ui/main.go
+++ b/cmd/soong_ui/main.go
@@ -180,6 +180,11 @@ func main() {
}
}
+ // Fix up the source tree due to a repo bug where it doesn't remove
+ // linkfiles that have been removed
+ fixBadDanglingLink(buildCtx, "hardware/qcom/sdm710/Android.bp")
+ fixBadDanglingLink(buildCtx, "hardware/qcom/sdm710/Android.mk")
+
f := build.NewSourceFinder(buildCtx, config)
defer f.Shutdown()
build.FindSources(buildCtx, config, f)
@@ -187,6 +192,20 @@ func main() {
c.run(buildCtx, config, args, logsDir)
}
+func fixBadDanglingLink(ctx build.Context, name string) {
+ _, err := os.Lstat(name)
+ if err != nil {
+ return
+ }
+ _, err = os.Stat(name)
+ if os.IsNotExist(err) {
+ err = os.Remove(name)
+ if err != nil {
+ ctx.Fatalf("Failed to remove dangling link %q: %v", name, err)
+ }
+ }
+}
+
func dumpVar(ctx build.Context, config build.Config, args []string, _ string) {
flags := flag.NewFlagSet("dumpvar", flag.ExitOnError)
flags.Usage = func() {