mirror of
https://github.com/mudler/luet.git
synced 2025-09-17 23:58:48 +00:00
Return candidate not found when appropriate
This commit is contained in:
@@ -829,13 +829,11 @@ PACKAGE:
|
||||
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() {
|
||||
if err != nil { //c.String() == pack.String() {
|
||||
continue REPOSITORY
|
||||
}
|
||||
if err == nil {
|
||||
matches = append(matches, c)
|
||||
continue PACKAGE
|
||||
}
|
||||
matches = append(matches, c)
|
||||
continue PACKAGE
|
||||
} else {
|
||||
// If it's not a selector, just append it
|
||||
matches = append(matches, pack)
|
||||
|
@@ -341,17 +341,18 @@ func (db *BoltDatabase) FindPackageCandidate(p Package) (Package, error) {
|
||||
|
||||
required, err := db.FindPackage(p)
|
||||
if err != nil {
|
||||
|
||||
err = nil
|
||||
// return nil, errors.Wrap(err, "Couldn't find required package in db definition")
|
||||
packages, err := p.Expand(db)
|
||||
// Info("Expanded", packages, err)
|
||||
if err != nil || len(packages) == 0 {
|
||||
required = p
|
||||
err = errors.Wrap(err, "Candidate not found")
|
||||
} else {
|
||||
required = packages.Best(nil)
|
||||
|
||||
}
|
||||
return required, nil
|
||||
return required, err
|
||||
//required = &DefaultPackage{Name: "test"}
|
||||
}
|
||||
|
||||
|
@@ -434,16 +434,17 @@ func (db *InMemoryDatabase) FindPackageCandidate(p Package) (Package, error) {
|
||||
|
||||
required, err := db.FindPackage(p)
|
||||
if err != nil {
|
||||
err = nil
|
||||
// return nil, errors.Wrap(err, "Couldn't find required package in db definition")
|
||||
packages, err := p.Expand(db)
|
||||
// Info("Expanded", packages, err)
|
||||
if err != nil || len(packages) == 0 {
|
||||
required = p
|
||||
err = errors.Wrap(err, "Candidate not found")
|
||||
} else {
|
||||
required = packages.Best(nil)
|
||||
|
||||
}
|
||||
return required, nil
|
||||
return required, err
|
||||
//required = &DefaultPackage{Name: "test"}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user