1
0
forked from ALHP/ALHP.GO

fixed isAvailable not working if no srcinfo is provided

This commit is contained in:
2021-12-14 12:58:18 +01:00
parent 798d349fc3
commit b303531ce1

View File

@@ -492,7 +492,12 @@ func (p *BuildPackage) isAvailable(h *alpm.Handle) bool {
}
buildManager.alpmMutex.Lock()
pkg, err := dbs.FindSatisfier(p.Srcinfo.Packages[0].Pkgname)
var pkg alpm.IPackage
if p.Srcinfo != nil {
pkg, err = dbs.FindSatisfier(p.Srcinfo.Packages[0].Pkgname)
} else {
pkg, err = dbs.FindSatisfier(p.DbPackage.Packages[0])
}
buildManager.alpmMutex.Unlock()
if err != nil {
return false