From cad0b936e52f52ebeaeffcad1462d7fab231ae0b Mon Sep 17 00:00:00 2001 From: Alexandre Pujol Date: Wed, 3 Apr 2024 21:05:24 +0100 Subject: [PATCH] build: make debian hide file edditable. --- pkg/prebuild/cfg/files.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pkg/prebuild/cfg/files.go b/pkg/prebuild/cfg/files.go index 90acc2d8..6d635d65 100644 --- a/pkg/prebuild/cfg/files.go +++ b/pkg/prebuild/cfg/files.go @@ -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) } }