try locking alpm db

This commit is contained in:
2021-08-31 21:13:22 +02:00
parent 6f8d0cd68e
commit eb5df207a2
2 changed files with 5 additions and 0 deletions

View File

@@ -523,11 +523,13 @@ func (b *BuildManager) syncWorker() {
}
// fetch updates between sync runs
b.alpmMutex.Lock()
check(alpmHandle.Release())
setupChroot()
var err error
alpmHandle, err = initALPM(filepath.Join(conf.Basedir.Chroot, pristineChroot), filepath.Join(conf.Basedir.Chroot, pristineChroot, "/var/lib/pacman"))
check(err)
b.alpmMutex.Unlock()
pkgBuilds, err := Glob(filepath.Join(conf.Basedir.Upstream, "/**/PKGBUILD"))
check(err)