X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=cmd%2Fmeta4-check%2Fmain.go;fp=cmd%2Fmeta4-check%2Fmain.go;h=b807a26993c8b945b477ab63c72ea3ca8b9461ae;hb=ce902a58a32f42801603475c67dd75da86d4502a;hp=61b50486b1d6795d19920662568a36862aa885de;hpb=ec81c80180666b65ffa5c0b04b78b85d4db3d9d4;p=meta4ra.git diff --git a/cmd/meta4-check/main.go b/cmd/meta4-check/main.go index 61b5048..b807a26 100644 --- a/cmd/meta4-check/main.go +++ b/cmd/meta4-check/main.go @@ -90,6 +90,27 @@ and -extract-sig, then you can just specify empty ("") FILE. bad = true } } + + fullPath := toCheck[f.Name] + if !(len(toCheck) == 0 || fullPath != "") { + continue + } + if fullPath == "" { + fullPath = f.Name + } + s, err := os.Stat(fullPath) + if err != nil { + fmt.Println(err) + bad = true + continue + } + if uint64(s.Size()) != f.Size { + fmt.Println("size mismatch", + f.Name, "our:", s.Size(), "their:", f.Size) + bad = true + continue + } + hasher := meta4ra.NewHasher(*hashes) var hashTheir string var hashName string @@ -106,15 +127,11 @@ and -extract-sig, then you can just specify empty ("") FILE. } } } - log.Fatalln("no common hashes found for:", f.Name) + fmt.Println("no common hashes found for:", f.Name) + bad = true + continue + HashFound: - fullPath := toCheck[f.Name] - if !(len(toCheck) == 0 || fullPath != "") { - continue - } - if fullPath == "" { - fullPath = f.Name - } fd, err := os.Open(fullPath) if err != nil { fmt.Println("Error:", f.Name, err) @@ -135,7 +152,7 @@ and -extract-sig, then you can just specify empty ("") FILE. fmt.Println(f.Name, hashName, "good") } else { fmt.Println( - "Hash does not match:", f.Name, hashName, + "hash mismatch:", f.Name, hashName, "our:", hashOur, "their:", hashTheir, )