importpkg: fix --hash broken in previous commit
authorHelmut Grohne <helmut@subdivi.de>
Mon, 23 May 2016 19:09:38 +0000 (21:09 +0200)
committerHelmut Grohne <helmut@subdivi.de>
Mon, 23 May 2016 19:09:38 +0000 (21:09 +0200)
importpkg.py

index badef15..92c474e 100755 (executable)
@@ -89,7 +89,7 @@ def main():
     dumper = yaml.SafeDumper(sys.stdout)
     dumper.open()
     if args.hash:
-        stdin = HashedStream(stdin, hashlib.sha256())
+        args.input = HashedStream(args.input, hashlib.sha256())
     try:
         ImportpkgExtractor(dumper.represent).process(args.input)
     except ProcessingFinished:
@@ -97,7 +97,7 @@ def main():
     else:
         raise RuntimeError("unexpected termination of extractor")
     if args.hash:
-        stdin.validate(args.hash)
+        args.input.validate(args.hash)
     dumper.represent("commit")
     dumper.close()