forked from ALHP/ALHP.GO
changed repoPurge to work without srcinfo
This commit is contained in:
6
main.go
6
main.go
@@ -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)
|
||||
|
7
utils.go
7
utils.go
@@ -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)
|
||||
|
Reference in New Issue
Block a user