diff --git a/cmd/prebuild/main.go b/cmd/prebuild/main.go index 83a36c9e..ac65a4d9 100644 --- a/cmd/prebuild/main.go +++ b/cmd/prebuild/main.go @@ -30,6 +30,7 @@ var ( Full bool Complain bool Distribution string + DistDir *paths.Path Root *paths.Path RootApparmord *paths.Path @@ -44,6 +45,7 @@ type prepareFunc func() error type buildFunc func(string) string func init() { + DistDir = paths.New("dists") Root = paths.New(".build") RootApparmord = Root.Join("apparmor.d") Distribution, _ = util.GetSupportedDistribution() diff --git a/cmd/prebuild/prepare.go b/cmd/prebuild/prepare.go index 09a3fd38..223ff2d0 100644 --- a/cmd/prebuild/prepare.go +++ b/cmd/prebuild/prepare.go @@ -37,7 +37,7 @@ func Synchronise() error { // Ignore profiles and files as defined in dists/ignore/ func Ignore() error { for _, name := range []string{"main.ignore", Distribution + ".ignore"} { - path := paths.New("dists/ignore/" + name) + path := DistDir.Join("ignore", name) if !path.Exist() { continue } @@ -186,7 +186,7 @@ func copyTo(src *paths.Path, dst *paths.Path) error { // Set flags on some profiles according to manifest defined in `dists/flags/` func SetFlags() error { for _, name := range []string{"main.flags", Distribution + ".flags"} { - path := paths.New("dists/flags/" + name) + path := DistDir.Join("flags", name) if !path.Exist() { continue }