build: make debian hide file edditable.

This commit is contained in:
Alexandre Pujol 2024-04-03 21:05:24 +01:00
parent 095254864f
commit cad0b936e5
No known key found for this signature in database
GPG Key ID: C5469996F0DF68EC

View File

@ -10,6 +10,14 @@ import (
"github.com/roddhjav/apparmor.d/pkg/util"
)
var Hide = `# This file is generated by "make", all edit will be lost.
/etc/apparmor.d/usr.bin.firefox
/etc/apparmor.d/usr.sbin.cups-browsed
/etc/apparmor.d/usr.sbin.cupsd
/etc/apparmor.d/usr.sbin.rsyslogd
`
type Flagger struct{}
func (f Flagger) Read(name string) map[string][]string {
@ -76,15 +84,8 @@ func (o Overwriter) Apt(files []string) {
// Clean the debian/apparmor.d.hide file
func (o Overwriter) AptClean() {
const debianHide = `# This file is generated by "make", all edit will be lost.
/etc/apparmor.d/usr.bin.firefox
/etc/apparmor.d/usr.sbin.cups-browsed
/etc/apparmor.d/usr.sbin.cupsd
/etc/apparmor.d/usr.sbin.rsyslogd
`
path := DebianDir.Join("apparmor.d.hide")
if err := path.WriteFile([]byte(debianHide)); err != nil {
if err := path.WriteFile([]byte(Hide)); err != nil {
panic(err)
}
}