build: better division of prebuild stages.

This commit is contained in:
Alexandre Pujol 2025-01-12 19:41:47 +01:00
parent 88f1821b19
commit fc85b9fc58
Failed to generate hash of commit
2 changed files with 4 additions and 1 deletions

View file

@ -67,5 +67,6 @@ func init() {
} }
func main() { func main() {
cli.Configure()
cli.Prebuild() cli.Prebuild()
} }

View file

@ -58,7 +58,7 @@ func init() {
flag.StringVar(&file, "file", "", "Only prebuild a given file.") flag.StringVar(&file, "file", "", "Only prebuild a given file.")
} }
func Prebuild() { func Configure() {
flag.Usage = func() { flag.Usage = func() {
fmt.Printf("%s\n%s\n%s\n%s", usage, fmt.Printf("%s\n%s\n%s\n%s", usage,
prebuild.Help("Prepare", prepare.Tasks), prebuild.Help("Prepare", prepare.Tasks),
@ -103,7 +103,9 @@ func Prebuild() {
overwrite, _ := prepare.Tasks["overwrite"].(*prepare.Overwrite) overwrite, _ := prepare.Tasks["overwrite"].(*prepare.Overwrite)
overwrite.OneFile = true overwrite.OneFile = true
} }
}
func Prebuild() {
logging.Step("Building apparmor.d profiles for %s on ABI%d.", prebuild.Distribution, prebuild.ABI) logging.Step("Building apparmor.d profiles for %s on ABI%d.", prebuild.Distribution, prebuild.ABI)
if err := Prepare(); err != nil { if err := Prepare(); err != nil {
logging.Fatal("%s", err.Error()) logging.Fatal("%s", err.Error())