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

Commit 7a07b85f authored by Kousik Kumar's avatar Kousik Kumar Committed by Gerrit Code Review
Browse files

Merge "Remove unused symlink code" into main

parents e6153b54 4555802d
Loading
Loading
Loading
Loading
+0 −19
Original line number Diff line number Diff line
@@ -289,31 +289,12 @@ func logAndSymlinkSetup(buildCtx build.Context, config build.Config) {
		}
	}

	// 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")

	// Create a source finder.
	f := build.NewSourceFinder(buildCtx, config)
	defer f.Shutdown()
	build.FindSources(buildCtx, config, f)
}

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) {
	logAndSymlinkSetup(ctx, config)
	flags := flag.NewFlagSet("dumpvar", flag.ExitOnError)