fix(builder): Ensure "solo-metapackages" do not break builds
The previous logic failed because single meta-packages such as "nixery.dev/shell" would not end up removing the meta-package itself from the list of packages passed to Nix, causing a build failure. This was a regression introduced in 827468a.
This commit is contained in:
parent
a924093d09
commit
df88da126a
1 changed files with 7 additions and 1 deletions
|
@ -149,16 +149,22 @@ type ImageResult struct {
|
|||
// * `arm64`: Causes Nixery to build images for the ARM64 architecture
|
||||
func metaPackages(packages []string) (*Architecture, []string) {
|
||||
arch := &amd64
|
||||
|
||||
var metapkgs []string
|
||||
lastMeta := 0
|
||||
for idx, p := range packages {
|
||||
if p == "shell" || p == "arm64" {
|
||||
metapkgs = append(metapkgs, p)
|
||||
lastMeta = idx + 1
|
||||
} else {
|
||||
packages = packages[idx:]
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// Chop off the meta-packages from the front of the package
|
||||
// list
|
||||
packages = packages[lastMeta:]
|
||||
|
||||
for _, p := range metapkgs {
|
||||
switch p {
|
||||
case "shell":
|
||||
|
|
Loading…
Reference in a new issue