diff options
author | Helmut Grohne <helmut@subdivi.de> | 2016-04-16 11:22:18 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2016-04-16 11:22:18 +0200 |
commit | 0715cc5f94438d58e2fc59c065a0afbd3dbb525a (patch) | |
tree | 46c396ec3c112f330dd9a41fdefd71dec4f378fa /importpkg.py | |
parent | f5684c218a7e7ed1166c0e60394daa05cda311fa (diff) | |
download | debian-dedup-0715cc5f94438d58e2fc59c065a0afbd3dbb525a.tar.gz |
add a validate method to HashedStream
Diffstat (limited to 'importpkg.py')
-rwxr-xr-x | importpkg.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/importpkg.py b/importpkg.py index 2cdefc4..f72cf03 100755 --- a/importpkg.py +++ b/importpkg.py @@ -107,10 +107,7 @@ def main(): stdin = HashedStream(stdin, hashlib.sha256()) process_package(stdin, hash_functions, dumper.represent) if options.hash: - while stdin.read(4096): - pass - if stdin.hexdigest() != options.hash: - raise ValueError("hash sum mismatch") + stdin.validate(options.hash) dumper.represent("commit") dumper.close() |