summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-14 11:38:21 -0500
committerJeff Carr <[email protected]>2025-10-14 11:39:02 -0500
commitb0b0a32365d607a10fb7152419a2c1f34ba4df14 (patch)
treee852e4559a3ad1d4ec207cf2ea44bb56e8edc2ce
parentb73be5b5b19c19c6d8f5de8a4adca783144e9659 (diff)
bad idea. something went wrongv0.0.24
-rw-r--r--doIncoming.go7
-rw-r--r--doVerify.go8
-rw-r--r--main.go15
3 files changed, 19 insertions, 11 deletions
diff --git a/doIncoming.go b/doIncoming.go
index 636aa14..636ff18 100644
--- a/doIncoming.go
+++ b/doIncoming.go
@@ -69,11 +69,14 @@ func doIncoming(pb *zoopb.Packages) (string, error) {
log.Printf("different checksums: %s %s\n", path, newfilename)
log.Printf("md5sum old %x vs new %x\n", md5.Sum(olddata), md5.Sum(newdata))
}
+ if argv.Force {
+ moveFileToBroken(newfilename)
+ // os.Rename(path, newfilename)
+ // log.Printf("%s moved incoming oldname %s newname: %s\n", packageName, path, newfilename)
+ }
// return "file already exists. use --force to replace", errors.New("duplicate .deb in incoming/")
me.sh.GoodExit("file already exists. TODO: fix this to use --force to replace")
}
- os.Rename(path, newfilename)
- log.Printf("%s moved incoming oldname %s newname: %s\n", packageName, path, newfilename)
incount += 1
if incount > 100 {
me.sh.GoodExit("file moved")
diff --git a/doVerify.go b/doVerify.go
index 86690d6..44db693 100644
--- a/doVerify.go
+++ b/doVerify.go
@@ -158,6 +158,10 @@ func doVerify() (string, error) {
}
func moveToBroken(p *zoopb.Package) (string, error) {
+ return moveFileToBroken(p.Filename)
+}
+
+func moveFileToBroken(filename string) (string, error) {
if err := os.Chdir(me.pb.BaseDir); err != nil {
return "no '" + me.pb.BaseDir + "' directory", err
}
@@ -165,9 +169,9 @@ func moveToBroken(p *zoopb.Package) (string, error) {
if err := os.MkdirAll(brokendir, 0755); err != nil {
return "mkdir " + brokendir, err
}
- _, fname := filepath.Split(p.Filename)
+ _, fname := filepath.Split(filename)
newname := filepath.Join(brokendir, fname)
- if err := os.Rename(p.Filename, newname); err != nil {
+ if err := os.Rename(filename, newname); err != nil {
return "rename failed " + newname, err
}
// panic("rename worked?")
diff --git a/main.go b/main.go
index 89435e0..c1fa906 100644
--- a/main.go
+++ b/main.go
@@ -132,23 +132,24 @@ func main() {
}
// make and GPG sign the Release files
- s, err = makePackagesFile("riscv64")
+ // s, err = makePackagesFile("riscv64")
s, err = makePackagesFile("amd64")
- s, err = makePackagesFile("arm64")
+ // s, err = makePackagesFile("arm64")
err = doSignRelease()
- }
- /*
- add --update
+ // add --update
cmd := []string{"apt-get", "update"}
cmd = append(cmd, "-o", "Dir::Etc::sourcelist=/etc/apt/sources.list.d/wit.list")
cmd = append(cmd, "-o", "Dir::Etc::sourceparts=/dev/null")
cmd = append(cmd, "-o", "APT::Get::List-Cleanup=0")
log.Info("apt update :", cmd)
+ log.Info("")
+ shell.RunVerbose(cmd)
+ }
+
+ /*
if argv.Update {
log.Info("")
- shell.RunVerbose(cmd)
- log.Info("")
log.Info("")
// log.Info("Local file:", "/var/lib/apt/lists/mirrors.wit.com_wit_dists_sid_main_binary-"+arch+"_Packages")
// log.Info("")