summaryrefslogtreecommitdiff
path: root/doIncoming.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-10 18:44:55 -0500
committerJeff Carr <[email protected]>2025-10-11 04:22:44 -0500
commit34c30323a684af8b2a952ec4c7c324ef88e946ff (patch)
tree3efa0eb0bdab95346a505f1279e11a69610864a7 /doIncoming.go
parent4166d4404f827e695526f3768fff65537a40735b (diff)
cleaned up 'incoming' subcommand output
Diffstat (limited to 'doIncoming.go')
-rw-r--r--doIncoming.go17
1 files changed, 10 insertions, 7 deletions
diff --git a/doIncoming.go b/doIncoming.go
index 9f2202d..1859d86 100644
--- a/doIncoming.go
+++ b/doIncoming.go
@@ -14,20 +14,20 @@ import (
func doIncoming() (string, error) {
os.Chdir(me.mirrorsDir)
- for p := range me.pb.IterAll() {
- log.Info(p.Package, p.Filename)
- }
-
var counter int
+ var incount int
+ var newcount int
err := filepath.Walk("pool", func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}
if !info.IsDir() && strings.HasSuffix(info.Name(), ".deb") {
+ counter += 1
found := me.pb.FindByFilename(path)
if found == nil {
log.Printf("new file %s\n", path)
+ newcount += 1
return nil
}
if strings.HasPrefix(path, "pool/main/incoming") {
@@ -59,13 +59,15 @@ func doIncoming() (string, error) {
}
os.Rename(path, newfilename)
log.Printf("%s moved incoming oldname %s newname: %s\n", found.Package, path, newfilename)
- counter += 1
+ incount += 1
if counter > 100 {
me.sh.GoodExit("file moved")
}
return nil
}
- log.Info("already processed", path)
+ if argv.Verbose {
+ log.Info("already processed", path)
+ }
// Get control info
// cmd := exec.Command("dpkg-deb", "-I", path)
@@ -79,5 +81,6 @@ func doIncoming() (string, error) {
return nil
})
- return "scanned incoming", err
+ s := log.Sprintf("scaned %d files. (%d) in incoming. (%d) new files", counter, incount, newcount)
+ return s, err
}