Skip to content

Commit 3cb9266

Browse files
committed
Fix "bashbrew list --build-order" without arch-filter/apply-constraints
1 parent e05261e commit 3cb9266

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

cmd/bashbrew/sort.go

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,33 @@ func sortRepoObjects(rs []*Repo, applyConstraints bool) ([]*Repo, error) {
102102
if applyConstraints && r.SkipConstraints(entry) {
103103
continue
104104
}
105-
if !entry.HasArchitecture(arch) {
105+
/*
106+
// TODO need archFilter here :(
107+
if archFilter && !entry.HasArchitecture(arch) {
106108
continue
107109
}
110+
*/
108111

109-
froms, err := r.DockerFroms(entry)
110-
if err != nil {
111-
return nil, err
112+
entryArches := []string{arch}
113+
if !applyConstraints { // TODO && !archFilter
114+
entryArches = entry.Architectures
115+
}
116+
117+
froms := []string{}
118+
for _, entryArch := range entryArches {
119+
archFroms, err := r.ArchDockerFroms(entryArch, entry)
120+
if err != nil {
121+
return nil, err
122+
}
123+
ArchFroms:
124+
for _, archFrom := range archFroms {
125+
for _, from := range froms {
126+
if from == archFrom {
127+
continue ArchFroms
128+
}
129+
}
130+
froms = append(froms, archFrom)
131+
}
112132
}
113133

114134
for _, from := range froms {

0 commit comments

Comments
 (0)