# Check if the download checksum matches (if provided).
if self.build_source_hash512:
- h = hashlib.sha512()
+ h = hashlib.new("sha512")
f = open(tmpfile, "rb")
while True:
buf = f.read(BUFFER_SIZE)
continue
# Calc hash of the current configuration file.
- config_hash1 = hashlib.sha512()
+ config_hash1 = hashlib.new("sha512")
f = open(target)
while True:
buf = f.read(BUFFER_SIZE)
# Calculating the hash sum of the added file
# and store it in the chksums file.
f = open(filename)
- h = hashlib.sha512()
+ h = hashlib.new("sha512")
while True:
buf = f.read(BUFFER_SIZE)
if not buf:
# Calculate SHA512 hash of regular files.
if m.isreg():
mobj = datafile.extractfile(m)
- h = hashlib.sha512()
+ h = hashlib.new("sha512")
while True:
buf = mobj.read(BUFFER_SIZE)
@property
def path(self):
- h = hashlib.sha1(self.url)
+ h = hashlib.new("sha1")
+ h.update(self.url)
# XXX path is to be changed
return "/var/cache/pakfire/sources/%s" % h.hexdigest()
return "%sB/s" % format_size(s)
def calc_hash1(filename=None, data=None):
- h = hashlib.sha1()
+ h = hashlib.new("sha1")
if filename:
f = open(filename)