From 7802fdce3c1f1234e3be0073117e8fdb7de0e257 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sat, 8 Aug 2015 04:13:55 +0300 Subject: [PATCH] Update zip in dictionary --- slpkg/pkg/build.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/slpkg/pkg/build.py b/slpkg/pkg/build.py index b71c04b4..57452472 100644 --- a/slpkg/pkg/build.py +++ b/slpkg/pkg/build.py @@ -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