From 0c67e08b0a35e39ec11fb7e1404a91f3130217dc Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Wed, 11 Sep 2024 18:27:24 +0200 Subject: [PATCH] packer: partially restore buildPackagesFromFlags() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit a59c9ad5f42cc9d678839ac40d5143c936c8a8ff was not entirely correct: It is desired to call getGokrazySystemPackages(), but we should also keep looking at cfg.Packages (which the commit didn’t). --- internal/packer/packer.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/packer/packer.go b/internal/packer/packer.go index 6961719..6f3983c 100644 --- a/internal/packer/packer.go +++ b/internal/packer/packer.go @@ -92,6 +92,13 @@ func buildPackageMapFromFlags(cfg *config.Struct) map[string]bool { return buildPackages } +func buildPackagesFromFlags(cfg *config.Struct) []string { + var buildPackages []string + buildPackages = append(buildPackages, cfg.Packages...) + buildPackages = append(buildPackages, getGokrazySystemPackages(cfg)...) + return buildPackages +} + func findFlagFiles(cfg *config.Struct) (map[string][]string, error) { if len(cfg.PackageConfig) > 0 { contents := make(map[string][]string) @@ -625,7 +632,7 @@ func FindExtraFiles(cfg *config.Struct) (map[string][]*FileInfo, error) { // fall through to look for extra files in /_gokrazy/extrafiles } - buildPackages := getGokrazySystemPackages(cfg) + buildPackages := buildPackagesFromFlags(cfg) packageDirs, err := packer.PackageDirs(buildPackages) if err != nil { return nil, err