summaryrefslogtreecommitdiff
path: root/doVerify.go
diff options
context:
space:
mode:
Diffstat (limited to 'doVerify.go')
-rw-r--r--doVerify.go32
1 files changed, 23 insertions, 9 deletions
diff --git a/doVerify.go b/doVerify.go
index 3a8029c..0f2a7e3 100644
--- a/doVerify.go
+++ b/doVerify.go
@@ -6,7 +6,6 @@ import (
"path/filepath"
"strings"
- "go.wit.com/lib/cobol"
"go.wit.com/lib/gui/shell"
"go.wit.com/lib/protobuf/zoopb"
"go.wit.com/log"
@@ -111,13 +110,28 @@ func doVerify() (string, error) {
counter += 1
continue
}
- // verify constructed filename
- constructedFilename := p.Package + "_" + p.Version + "_" + p.Architecture + ".deb"
- _, fname := filepath.Split(p.Filename)
- if constructedFilename != fname {
- log.Info("filename mismatch", constructedFilename, fname, cobol.Since(p.Ctime))
- return moveToBroken(p)
- }
+ /*
+ // verify constructed filename
+ constructedFilename := p.Package + "_" + p.Version + "_" + p.Architecture + ".deb"
+ _, fname := filepath.Split(p.Filename)
+ if constructedFilename != fname {
+ log.Info("filename mismatch", constructedFilename, fname, cobol.Since(p.Ctime))
+ counter += 1
+ moveToBroken(p)
+ continue
+ }
+ // verify constructed filepath
+ firstletter := fmt.Sprintf("%1.1s", p.Package)
+ fpath := filepath.Join("pool", "main", firstletter, p.Package)
+ constructedFullname := filepath.Join(fpath, constructedFilename)
+ if p.Filename != constructedFullname {
+ log.Info("bad fullname", p.Filename)
+ log.Info("new fullname", constructedFullname)
+ counter += 1
+ moveToBroken(p)
+ continue
+ }
+ */
// deprecate this and Delete(p) instead?
// log.Info("Package", p.Package)
@@ -147,7 +161,7 @@ func moveToBroken(p *zoopb.Package) (string, error) {
return "no '" + me.pb.BaseDir + "' directory", err
}
brokendir := filepath.Join(me.pb.BaseDir, "broken")
- if err := os.MkdirAll(brokendir, 0755); err != nil {
+ if err := os.MkdirAll(brokendir, os.ModePerm); err != nil {
return "mkdir " + brokendir, err
}
_, fname := filepath.Split(p.Filename)