Update zip in dictionary

This commit is contained in:
Dimitris Zlatanidis 2015-08-08 04:13:55 +03:00
parent e6b262617e
commit 7802fdce3c

View file

@ -71,11 +71,11 @@ class BuildPackage(object):
tar.close()
self._makeflags()
self._delete_sbo()
sbo_md5_list = SBoGrep(self.prgnam).checksum()
for src, sbo_md5 in zip(self.sources, sbo_md5_list):
self._create_md5_dict()
for src in self.sources:
# fix build sources with spaces
src = src.replace("%20", " ")
check_md5(sbo_md5, src)
check_md5(self.sbo_md5[src], src)
shutil.copy2(src, self.prgnam)
os.chdir(self.path + self.prgnam)
# change permissions
@ -107,6 +107,14 @@ class BuildPackage(object):
print("") # new line at exit
raise SystemExit()
def _create_md5_dict(self):
"""Create md5 dictionary per source
"""
self.sbo_md5 = {}
md5_lists = SBoGrep(self.prgnam).checksum()
for src, md5 in zip(self.sources, md5_lists):
self.sbo_md5[src] = md5
def _makeflags(self):
"""Set variable MAKEFLAGS with the numbers of
processors