X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=depfix.go;h=bc4452cef820c3a40b507bd860ec9094be701d5a;hb=d50ba0bfdabd90a8d472ed57a5afcffd7a893340;hp=87ecd882961cf8026d2398dc0dcf4a96bbbac2c9;hpb=0db0e21921706ba645c229e809fd3668542dcaae;p=goredo.git diff --git a/depfix.go b/depfix.go index 87ecd88..bc4452c 100644 --- a/depfix.go +++ b/depfix.go @@ -18,7 +18,6 @@ along with this program. If not, see . package main import ( - "encoding/hex" "errors" "io" "io/fs" @@ -111,7 +110,7 @@ func depFix(root string) error { if err != nil { return ErrLine(err) } - theirHsh := mustHexDecode(m["Hash"]) + theirHsh := mustHashDecode(m["Hash"]) fd, err := os.Open(path.Join(root, dep)) if err != nil { if errors.Is(err, fs.ErrNotExist) { @@ -149,7 +148,7 @@ func depFix(root string) error { if err != nil { return ErrLine(err) } - if hsh != string(theirHsh) { + if hsh != theirHsh { tracef( CDebug, "depfix: %s/%s -> %s: hash differs", root, entry.Name(), dep, @@ -159,7 +158,7 @@ func depFix(root string) error { fields = []recfile.Field{ {Name: "Type", Value: DepTypeIfchange}, {Name: "Target", Value: dep}, - {Name: "Hash", Value: hex.EncodeToString([]byte(hsh))}, + {Name: "Hash", Value: hsh.String()}, } fields = append(fields, inode.RecfileFields()...) fieldses[len(fieldses)-1] = fields