mirror of
https://github.com/mudler/luet.git
synced 2025-09-06 17:50:34 +00:00
Extend tree validate checks
This commit is contained in:
@@ -81,6 +81,34 @@ func NewTreeValidateCommand() *cobra.Command {
|
|||||||
|
|
||||||
for _, p := range reciper.GetDatabase().World() {
|
for _, p := range reciper.GetDatabase().World() {
|
||||||
|
|
||||||
|
found, err := reciper.GetDatabase().FindPackages(
|
||||||
|
&pkg.DefaultPackage{
|
||||||
|
Name: p.GetName(),
|
||||||
|
Category: p.GetCategory(),
|
||||||
|
Version: ">=0",
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
if err != nil || len(found) < 1 {
|
||||||
|
if err != nil {
|
||||||
|
errstr = err.Error()
|
||||||
|
} else {
|
||||||
|
errstr = "No packages"
|
||||||
|
}
|
||||||
|
Error(fmt.Sprintf("%s/%s-%s: Broken. No versions could be found by database %s",
|
||||||
|
p.GetCategory(), p.GetName(), p.GetVersion(),
|
||||||
|
errstr,
|
||||||
|
))
|
||||||
|
|
||||||
|
errors = append(errors,
|
||||||
|
fmt.Sprintf("%s/%s-%s: Broken. No versions could be found by database %s",
|
||||||
|
p.GetCategory(), p.GetName(), p.GetVersion(),
|
||||||
|
errstr,
|
||||||
|
))
|
||||||
|
|
||||||
|
brokenPkgs++
|
||||||
|
}
|
||||||
|
|
||||||
pkgstr := fmt.Sprintf("%s/%s-%s", p.GetCategory(), p.GetName(),
|
pkgstr := fmt.Sprintf("%s/%s-%s", p.GetCategory(), p.GetName(),
|
||||||
p.GetVersion())
|
p.GetVersion())
|
||||||
|
|
||||||
@@ -115,7 +143,9 @@ func NewTreeValidateCommand() *cobra.Command {
|
|||||||
}
|
}
|
||||||
Info("Checking package "+fmt.Sprintf("%s/%s-%s", p.GetCategory(), p.GetName(), p.GetVersion()), "with", len(p.GetRequires()), "dependencies.")
|
Info("Checking package "+fmt.Sprintf("%s/%s-%s", p.GetCategory(), p.GetName(), p.GetVersion()), "with", len(p.GetRequires()), "dependencies.")
|
||||||
|
|
||||||
for _, r := range p.GetRequires() {
|
all := p.GetRequires()
|
||||||
|
all = append(all, p.GetConflicts()...)
|
||||||
|
for _, r := range all {
|
||||||
|
|
||||||
deps, err := reciper.GetDatabase().FindPackages(
|
deps, err := reciper.GetDatabase().FindPackages(
|
||||||
&pkg.DefaultPackage{
|
&pkg.DefaultPackage{
|
||||||
|
Reference in New Issue
Block a user