add debug package cleanup to housekeeping
This commit is contained in:
parent
a834c7fb04
commit
1c1f1fba17
@ -492,6 +492,7 @@ func (b *BuildManager) syncWorker(ctx context.Context) error {
|
||||
if err != nil {
|
||||
log.Warningf("log-housekeeping failed: %v", err)
|
||||
}
|
||||
debugHK()
|
||||
|
||||
// fetch updates between sync runs
|
||||
b.alpmMutex.Lock()
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"somegit.dev/ALHP/ALHP.GO/ent"
|
||||
"somegit.dev/ALHP/ALHP.GO/ent/dbpackage"
|
||||
@ -304,3 +305,16 @@ func logHK() error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func debugHK() {
|
||||
for _, march := range conf.March {
|
||||
if _, err := os.Stat(filepath.Join(conf.Basedir.Debug, march)); err == nil {
|
||||
log.Debugf("[DHK/%s] start cleanup debug packages", march)
|
||||
cleanCmd := exec.Command("paccache", "-rc", filepath.Join(conf.Basedir.Debug, march), "-k", "1")
|
||||
res, err := cleanCmd.CombinedOutput()
|
||||
if err != nil {
|
||||
log.Warningf("[DHK/%s] cleanup debug packages failed: %v (%s)", march, err, string(res))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user