improved logging

This commit is contained in:
2021-07-29 16:53:15 +02:00
parent 816ce81207
commit 959ac2d689
2 changed files with 10 additions and 10 deletions

View File

@@ -267,7 +267,7 @@ func (b *BuildManager) parseWorker() {
continue
}
isLatest, dep, err := isMirrorLatest(alpmHandle, pkg)
isLatest, local, syncVersion, err := isMirrorLatest(alpmHandle, pkg)
if err != nil {
log.Warningf("[%s/%s] Problem solving dependencies: %v", pkg.FullRepo, info.Pkgbase, err)
}
@@ -277,13 +277,13 @@ func (b *BuildManager) parseWorker() {
dbLock.Unlock()
if !isLatest {
if dep != nil {
log.Infof("Delayed %s: not all dependencies are up to date (from local: %s==%s)", info.Pkgbase, dep.Name(), dep.Version())
if local != nil {
log.Infof("Delayed %s: not all dependencies are up to date (local: %s==%s, sync: %s==%s)", info.Pkgbase, local.Name(), local.Version(), local.Name(), syncVersion)
} else {
log.Infof("Delayed %s: not all dependencies are up to date", info.Pkgbase)
}
dbLock.Lock()
dbPkg = dbPkg.Update().SetSkipReason("waiting for mirror").SaveX(context.Background())
dbPkg = dbPkg.Update().SetSkipReason(fmt.Sprintf("waiting for %s==%s", local.Name(), syncVersion)).SaveX(context.Background())
dbLock.Unlock()
b.parseWG.Done()
continue

View File

@@ -458,10 +458,10 @@ func setupMakepkg(march string) {
check(os.WriteFile(lMakepkg, []byte(makepkgStr), os.ModePerm))
}
func isMirrorLatest(h *alpm.Handle, buildPkg *BuildPackage) (bool, alpm.IPackage, error) {
func isMirrorLatest(h *alpm.Handle, buildPkg *BuildPackage) (bool, alpm.IPackage, string, error) {
dbs, err := h.SyncDBs()
if err != nil {
return false, nil, err
return false, nil, "", err
}
allDepends := buildPkg.Srcinfo.Depends
@@ -470,22 +470,22 @@ func isMirrorLatest(h *alpm.Handle, buildPkg *BuildPackage) (bool, alpm.IPackage
for _, dep := range allDepends {
pkg, err := dbs.FindSatisfier(dep.Value)
if err != nil {
return false, nil, err
return false, nil, "", err
}
svn2gitVer, err := getSVN2GITVersion(&BuildPackage{
Pkgbase: pkg.Base(),
})
if err != nil {
return false, nil, err
return false, nil, "", err
}
if svn2gitVer != "" && alpm.VerCmp(svn2gitVer, pkg.Version()) != 0 {
return false, pkg, nil
return false, pkg, svn2gitVer, nil
}
}
return true, nil, nil
return true, nil, "", nil
}
func contains(s interface{}, str string) bool {