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

Commit 785fbd53 authored by Kornel Dulęba's avatar Kornel Dulęba
Browse files

Don't list build variant release configs

The build variant release configs are not meant to be used in lunch and
therefore shouldn't be listed in ALL_RELEASE_CONFIGS_FOR_PRODUCT.
Otherwise one can do something like "lunch husky-user-user", which
doesn't sound right.

Bug: b/378961230
Test: build/soong/bin/list_releases husky
Change-Id: Ie7a5487aa85018b430c5b816d902149184903eee
parent 9ef6edba
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -91,6 +91,16 @@ type ReleaseConfig struct {
	ReleaseConfigType rc_proto.ReleaseConfigType
}

// If true, this is a proper release config that can be used in "lunch".
func (config *ReleaseConfig) isConfigListable() bool {
	switch config.ReleaseConfigType {
	case rc_proto.ReleaseConfigType_RELEASE_CONFIG:
		return true
	}

	return false
}

// If true, this ReleaseConfigType may only inherit from a ReleaseConfig of the
// same ReleaseConfigType.
var ReleaseConfigInheritanceDenyMap = map[rc_proto.ReleaseConfigType]bool{
+4 −2
Original line number Diff line number Diff line
@@ -449,9 +449,11 @@ func (configs *ReleaseConfigs) getReleaseConfig(name string, allow_missing bool)
func (configs *ReleaseConfigs) GetAllReleaseNames() []string {
	var allReleaseNames []string
	for _, v := range configs.ReleaseConfigs {
		if v.isConfigListable() {
			allReleaseNames = append(allReleaseNames, v.Name)
			allReleaseNames = append(allReleaseNames, v.OtherNames...)
		}
	}
	slices.Sort(allReleaseNames)
	return allReleaseNames
}