build: add FlagDir variable in prebuild code.

This commit is contained in:
Alexandre Pujol 2023-07-23 20:36:48 +01:00
parent 6325314825
commit c6a048c9ca
Failed to generate hash of commit
2 changed files with 3 additions and 1 deletions

View file

@ -13,11 +13,13 @@ var (
DistDir *paths.Path
Root *paths.Path
RootApparmord *paths.Path
FlagDir *paths.Path
)
func init() {
DistDir = paths.New("dists")
Root = paths.New(".build")
FlagDir = DistDir.Join("flags")
RootApparmord = Root.Join("apparmor.d")
Distribution = getSupportedDistribution()
}

View file

@ -135,7 +135,7 @@ func Configure() (err error) {
// Set flags on some profiles according to manifest defined in `dists/flags/`
func SetFlags() error {
for _, name := range []string{"main.flags", Distribution + ".flags"} {
path := DistDir.Join("flags", name)
path := FlagDir.Join(name)
if !path.Exist() {
continue
}