summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author LaMont Jones <lamontjones@google.com> 2024-05-08 09:13:13 -0700
committer LaMont Jones <lamontjones@google.com> 2024-05-08 09:16:44 -0700
commit992011ea771940e3b85a23355e00f54ff6277804 (patch)
treead64044ddbd76e0baeeb0f26e4450291822a5c86
parentd02d71057082fa14e43d02bcead3d2999e3893c2 (diff)
Always write makefile for ${TARGET_RELEASE}
When writing all makefiles, we also need to write the makefile for ${TARGET_RELEASE}. We can skip writing it a second time if it is not an alias. Bug: 328495189 Test: manual, TH Change-Id: Ia5d1955f419312c76eb9c8a33b1c8a6bcc5efe0b
-rw-r--r--cmd/release_config/release_config/main.go24
1 files changed, 14 insertions, 10 deletions
diff --git a/cmd/release_config/release_config/main.go b/cmd/release_config/release_config/main.go
index 101dbe381..54328068a 100644
--- a/cmd/release_config/release_config/main.go
+++ b/cmd/release_config/release_config/main.go
@@ -83,20 +83,24 @@ func main() {
// We were told to guard operation and either we have no build flag, or it is False.
// Write an empty file so that release_config.mk will use the old process.
os.WriteFile(makefilePath, []byte{}, 0644)
- } else if allMake {
+ return
+ }
+ // Write the makefile where release_config.mk is going to look for it.
+ err = configs.WriteMakefile(makefilePath, targetRelease)
+ if err != nil {
+ panic(err)
+ }
+ if allMake {
// Write one makefile per release config, using the canonical release name.
for k, _ := range configs.ReleaseConfigs {
- makefilePath = filepath.Join(outputDir, fmt.Sprintf("release_config-%s-%s.mk", product, k))
- err = configs.WriteMakefile(makefilePath, k)
- if err != nil {
- panic(err)
+ if k != targetRelease {
+ makefilePath = filepath.Join(outputDir, fmt.Sprintf("release_config-%s-%s.mk", product, k))
+ err = configs.WriteMakefile(makefilePath, k)
+ if err != nil {
+ panic(err)
+ }
}
}
- } else {
- err = configs.WriteMakefile(makefilePath, targetRelease)
- if err != nil {
- panic(err)
- }
}
if json {
err = configs.WriteArtifact(outputDir, product, "json")