mirror of
https://github.com/mudler/luet.git
synced 2025-09-20 10:46:16 +00:00
Skip repository if no candidate is found
FindPackageCandidate is idempotent and returns the same definition if no new is found. This prevents installs from multiple-repos
This commit is contained in:
@@ -530,14 +530,21 @@ func (re Repositories) ResolveSelectors(p []pkg.Package) []pkg.Package {
|
||||
var matches []pkg.Package
|
||||
PACKAGE:
|
||||
for _, pack := range p {
|
||||
REPOSITORY:
|
||||
for _, r := range re {
|
||||
if pack.IsSelector() {
|
||||
c, err := r.GetTree().GetDatabase().FindPackageCandidate(pack)
|
||||
// If FindPackageCandidate returns the same package, it means it couldn't find one.
|
||||
// Skip this repository and keep looking.
|
||||
if c.String() == pack.String() {
|
||||
continue REPOSITORY
|
||||
}
|
||||
if err == nil {
|
||||
matches = append(matches, c)
|
||||
continue PACKAGE
|
||||
}
|
||||
} else {
|
||||
// If it's not a selector, just append it
|
||||
matches = append(matches, pack)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user