build: use the same technique to disable upstream profile on all distribution.

Only enabled on Ubuntu & opensuse
This commit is contained in:
Alexandre Pujol 2024-06-04 19:52:06 +01:00
parent c40c3e1c98
commit 34973baaea
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
6 changed files with 45 additions and 95 deletions

View file

@ -28,12 +28,17 @@ func (p Configure) Apply() ([]string, error) {
res := []string{}
switch cfg.Distribution {
case "arch", "opensuse":
if cfg.Overwrite {
if err := cfg.Overwrite.Apply(); err != nil {
return res, err
}
}
case "ubuntu":
cfg.Overwrite.AptClean()
if cfg.Overwrite.Enabled {
profiles := cfg.Overwrite.Get()
cfg.Overwrite.Apt(profiles)
if cfg.Overwrite {
if err := cfg.Overwrite.Apply(); err != nil {
return res, err
}
} else {
if err := util.CopyTo(cfg.DistDir.Join("ubuntu"), cfg.RootApparmord); err != nil {
return res, err