code cleanup; switch to rm_chroot to remove builddir; new linter conf

This commit is contained in:
Giovanni Harting 2023-06-21 12:54:45 +02:00
parent 442b793524
commit b83c0ecfc8
3 changed files with 8 additions and 2 deletions

View File

@ -32,6 +32,8 @@ linters-settings:
- '8'
- '9'
- '10'
- '100'
- '1000'
ignored-functions:
- strings.SplitN
- os.OpenFile
@ -82,6 +84,9 @@ linters:
- exhaustruct
- forcetypeassert
- godox
- nakedret
- tagalign
- maligned
# remove for new projects
- errname
- goerr113

View File

@ -36,7 +36,7 @@ func housekeeping(repo, march string, wg *sync.WaitGroup) error {
buildManager.repoPurge[pkg.FullRepo] <- []*ProtoPackage{pkg}
continue
} else if err != nil {
log.Warningf("[HK] Problem fetching %s->%q from db: %v", fullRepo, path, err)
log.Warningf("[HK] error fetching %s->%q from db: %v", fullRepo, path, err)
continue
}

View File

@ -132,7 +132,8 @@ func statusID2string(s dbpackage.Status) string {
func cleanBuildDir(dir, chrootDir string) error {
if stat, err := os.Stat(dir); err == nil && stat.IsDir() {
err = os.RemoveAll(dir)
rmCmd := exec.Command("sudo", "rm_chroot.py", dir)
_, err := rmCmd.CombinedOutput()
if err != nil {
return err
}