code cleanup; switch to rm_chroot to remove builddir; new linter conf
This commit is contained in:
parent
442b793524
commit
b83c0ecfc8
|
@ -32,6 +32,8 @@ linters-settings:
|
||||||
- '8'
|
- '8'
|
||||||
- '9'
|
- '9'
|
||||||
- '10'
|
- '10'
|
||||||
|
- '100'
|
||||||
|
- '1000'
|
||||||
ignored-functions:
|
ignored-functions:
|
||||||
- strings.SplitN
|
- strings.SplitN
|
||||||
- os.OpenFile
|
- os.OpenFile
|
||||||
|
@ -82,6 +84,9 @@ linters:
|
||||||
- exhaustruct
|
- exhaustruct
|
||||||
- forcetypeassert
|
- forcetypeassert
|
||||||
- godox
|
- godox
|
||||||
|
- nakedret
|
||||||
|
- tagalign
|
||||||
|
- maligned
|
||||||
# remove for new projects
|
# remove for new projects
|
||||||
- errname
|
- errname
|
||||||
- goerr113
|
- goerr113
|
||||||
|
|
|
@ -36,7 +36,7 @@ func housekeeping(repo, march string, wg *sync.WaitGroup) error {
|
||||||
buildManager.repoPurge[pkg.FullRepo] <- []*ProtoPackage{pkg}
|
buildManager.repoPurge[pkg.FullRepo] <- []*ProtoPackage{pkg}
|
||||||
continue
|
continue
|
||||||
} else if err != nil {
|
} 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
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
3
utils.go
3
utils.go
|
@ -132,7 +132,8 @@ func statusID2string(s dbpackage.Status) string {
|
||||||
|
|
||||||
func cleanBuildDir(dir, chrootDir string) error {
|
func cleanBuildDir(dir, chrootDir string) error {
|
||||||
if stat, err := os.Stat(dir); err == nil && stat.IsDir() {
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue