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 d6999c57..9f40e33e 100644
--- a/cmd/soong_ui/main.go
+++ b/cmd/soong_ui/main.go
@@ -132,6 +132,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)
@@ -160,6 +165,20 @@ func main() {
}
}
+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) {
flags := flag.NewFlagSet("dumpvar", flag.ExitOnError)
flags.Usage = func() {