Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cmd/config_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ import (

// makeId creates an opaque, deterministic string identifier, unique for each package present in the config.
func makeId(pkg *api.Package) string {
return pkg.Name
id := pkg.Name
if pkg.Arch != "" {
id += "." + pkg.Arch
}
return id
}

func sortedKeys[K cmp.Ordered, V any](m map[K]V) []K {
Expand Down
3 changes: 3 additions & 0 deletions pkg/sat/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@ func (loader *Loader) explodeSamePackageConflicts(pkgVar *Var) bf.Formula {
if otherVar.Package == pkgVar.Package { // itself
continue
}
if otherVar.Package.Arch != pkgVar.Package.Arch {
continue
}
conflictingVars = append(conflictingVars, bf.Var(otherVar.satVarName))
}
if len(conflictingVars) == 0 {
Expand Down
27 changes: 27 additions & 0 deletions pkg/sat/sat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1493,6 +1493,33 @@ func TestNewResolver(t *testing.T) {
exclude: []string{"testb-0:1.x86_64"},
solvable: true,
},
{name: "package needed in two architectures, and referenced by name", packages: []*api.Package{
newPkgAP("testa", "1", "i686", 1, []string{}, []string{"/usr/lib/libfoo.so"}, []string{}),
newPkgAP("testb", "1", "x86_64", 1, []string{}, []string{"/usr/lib64/libfoo.so"}, []string{}),
newPkgAP("testc", "1", "noarch", 1, []string{}, []string{"foo"}, []string{}),
newPkgAP("foo", "1", "i686", 1, []string{"/usr/lib/libfoo.so"}, []string{}, []string{}),
newPkgAP("foo", "1", "x86_64", 1, []string{"/usr/lib64/libfoo.so"}, []string{}, []string{}),
}, requires: []string{
"testa", "testb", "testc",
},
architectures: []string{"x86_64", "i686"},
install: []string{"testa-0:1.i686", "testb-0:1.x86_64", "testc-0:1.noarch", "foo-0:1.i686", "foo-0:1.x86_64"},
exclude: []string{},
solvable: true,
},
{name: "package needed in two architectures, and referenced by file", packages: []*api.Package{
newPkgAP("testa", "1", "i686", 1, []string{}, []string{"/usr/lib/libfoo.so"}, []string{}),
newPkgAP("testb", "1", "x86_64", 1, []string{}, []string{"/usr/lib64/libfoo.so"}, []string{}),
newPkgAP("foo", "1", "i686", 1, []string{"/usr/lib/libfoo.so"}, []string{}, []string{}),
newPkgAP("foo", "1", "x86_64", 1, []string{"/usr/lib64/libfoo.so"}, []string{}, []string{}),
}, requires: []string{
"testa", "testb",
},
architectures: []string{"x86_64", "i686"},
install: []string{"testa-0:1.i686", "testb-0:1.x86_64", "foo-0:1.i686", "foo-0:1.x86_64"},
exclude: []string{},
solvable: true,
},

// TODO: Add test cases.
}
Expand Down
Loading