1
0
forked from ALHP/ALHP.GO

changed repoPurge to work without srcinfo

This commit is contained in:
2021-11-19 23:47:19 +01:00
parent 908fad0923
commit 3e8f4711f0
2 changed files with 5 additions and 8 deletions

View File

@@ -438,8 +438,10 @@ func (b *BuildManager) repoWorker(repo string) {
}
var realPkgs []string
for _, realPkg := range pkg.Srcinfo.Packages {
realPkgs = append(realPkgs, realPkg.Pkgname)
for _, filePath := range pkg.PkgFiles {
fNameSplit := strings.Split(filepath.Base(filePath), "-")
pkgname := strings.Join(fNameSplit[:len(fNameSplit)-3], "-")
realPkgs = append(realPkgs, pkgname)
}
b.repoWG.Add(1)

View File

@@ -507,12 +507,7 @@ func housekeeping(repo string, wg *sync.WaitGroup) error {
case dbpackage.RepositoryCommunity:
upstream = "upstream-community"
}
pkg.Pkgbuild = filepath.Join(conf.Basedir.Upstream, upstream, dbPkg.Pkgbase, "repos", dbPkg.Repository.String()+"-"+conf.Arch, "PKGBUILD")
if err = pkg.genSrcinfo(); err != nil {
log.Warningf("[HK/%s/%s] failed to gen sourceinfo: %v", repo, pkg.Pkgbase, err)
continue
}
// check if pkg signature is valid
valid, err := pkgfile.isSignatureValid()
@@ -549,7 +544,7 @@ func housekeeping(repo string, wg *sync.WaitGroup) error {
if err != nil {
return err
}
pkgResolved, err := dbs.FindSatisfier(pkg.Srcinfo.Packages[0].Pkgname)
pkgResolved, err := dbs.FindSatisfier(dbPkg.Packages[0])
if err != nil || pkgResolved.DB().Name() != dbPkg.Repository.String() {
// package not found on mirror/db -> not part of any repo anymore
log.Infof("[HK/%s/%s] not part of repo", pkg.FullRepo, pkg.Pkgbase)