diff --git a/pkg/prebuild/builder/dev.go b/pkg/prebuild/builder/dev.go new file mode 100644 index 00000000..3f4840b4 --- /dev/null +++ b/pkg/prebuild/builder/dev.go @@ -0,0 +1,35 @@ +// apparmor.d - Full set of apparmor profiles +// Copyright (C) 2021-2024 Alexandre Pujol +// SPDX-License-Identifier: GPL-2.0-only + +package builder + +import ( + "github.com/roddhjav/apparmor.d/pkg/prebuild/cfg" + "github.com/roddhjav/apparmor.d/pkg/util" +) + +var ( + regDev = util.ToRegexRepl([]string{ + `PUx`, `pux`, + `Px`, `px`, + `Ux`, `ux`, + }) +) + +type Dev struct { + cfg.Base +} + +func init() { + RegisterBuilder(&Dev{ + Base: cfg.Base{ + Keyword: "dev", + Msg: "Apply test development changes", + }, + }) +} + +func (b Dev) Apply(profile string) string { + return regDev.Replace(profile) +} diff --git a/pkg/prebuild/prebuild.go b/pkg/prebuild/prebuild.go index e5fb1fa9..412f465e 100644 --- a/pkg/prebuild/prebuild.go +++ b/pkg/prebuild/prebuild.go @@ -28,6 +28,7 @@ func init() { // Build tasks applied by default builder.Register("userspace") + builder.Register("dev") switch cfg.Distribution { case "ubuntu":