diff options
| author | Jeff Carr <[email protected]> | 2025-10-26 20:02:45 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-26 20:02:45 -0500 |
| commit | 003c700002061be5fd504f9c79e83a064144f5aa (patch) | |
| tree | ec42b79e12a6bf58026f63252ba950e78e0896cf /doIncoming.go | |
| parent | cff810db4c2e2ba9a776f96ab1748e9b5975286b (diff) | |
might work from the .deb file finally
Diffstat (limited to 'doIncoming.go')
| -rw-r--r-- | doIncoming.go | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/doIncoming.go b/doIncoming.go index f592cad..bca869a 100644 --- a/doIncoming.go +++ b/doIncoming.go @@ -11,7 +11,7 @@ import ( "go.wit.com/log" ) -func moveOutOfIncoming(fullname string) error { +func moveOutOfIncoming(fullname string, repopath string) error { _, filename := filepath.Split(fullname) parts := strings.Split(filename, "_") if len(parts) != 3 { @@ -20,7 +20,7 @@ func moveOutOfIncoming(fullname string) error { } packageName := parts[0] letteredDir := log.Sprintf("%1.1s", filename) - newfilename := filepath.Join("pool/main", letteredDir, packageName, filename) + newfilename := filepath.Join(repopath, letteredDir, packageName, filename) destDir := filepath.Dir(newfilename) if err := os.MkdirAll(destDir, 0755); err != nil { @@ -32,10 +32,8 @@ func moveOutOfIncoming(fullname string) error { log.Info("DEBIAN POLICY: YOU CAN NEVER REBUILD THE SAME FILE. APT WILL NOT REINSTALL IT. AUTO REMOVE: ", fullname) return os.Remove(fullname) } - if argv.Force { - // file can be moved - os.Rename(fullname, newfilename) - } + // file can be moved + os.Rename(fullname, newfilename) log.Printf("%s moved incoming oldname %s newname: %s\n", packageName, fullname, newfilename) return nil } @@ -53,7 +51,7 @@ func doIncoming(pb *zoopb.Packages) (string, error) { for _, filename := range files { // log.Info("need to move", filename) - moveOutOfIncoming(filename) + moveOutOfIncoming(filename, "pool/main") } globPattern = "/home/mirrors/wit/incoming-devel/*.deb" @@ -64,7 +62,7 @@ func doIncoming(pb *zoopb.Packages) (string, error) { for _, filename := range files { // log.Info("need to move", filename) - moveOutOfIncoming(filename) + moveOutOfIncoming(filename, "pool/main") } s := log.Sprintf("scanned (%d) in incoming", len(files)) |
