Skip to content

Commit

Permalink
packer: partially restore buildPackagesFromFlags()
Browse files Browse the repository at this point in the history
Commit a59c9ad was not entirely correct:
It is desired to call getGokrazySystemPackages(), but we should also
keep looking at cfg.Packages (which the commit didn’t).
  • Loading branch information
stapelberg committed Sep 11, 2024
1 parent feda2a3 commit 0c67e08
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion internal/packer/packer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -625,7 +632,7 @@ func FindExtraFiles(cfg *config.Struct) (map[string][]*FileInfo, error) {
// fall through to look for extra files in <pkg>/_gokrazy/extrafiles
}

buildPackages := getGokrazySystemPackages(cfg)
buildPackages := buildPackagesFromFlags(cfg)
packageDirs, err := packer.PackageDirs(buildPackages)
if err != nil {
return nil, err
Expand Down

0 comments on commit 0c67e08

Please sign in to comment.