- if format >= (1,8):
- hashes = [("sha1", apt_pkg.sha1sum),
- ("sha256", apt_pkg.sha256sum)]
- else:
- hashes = []
+ # (hashname, function, originate)
+ # If originate is true, we have to calculate it because
+ # the changes file version is too early for it to be
+ # included
+ hashes = [("sha1", apt_pkg.sha1sum, False),
+ ("sha256", apt_pkg.sha256sum, False)]
+
+ if format <= (1,8):
+ hashes["sha1"] = True
+ hashes["sha256"] = True