From 08cffda65eef46958b530abcd19e881f05a524f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20A=C5=9F=C4=B1c=C4=B1?= Date: Wed, 27 Jul 2011 08:40:25 +0000 Subject: [PATCH] Revert "build: Remove redundant dict variable" This variable prevents writing duplicate entries to files.xml. --- pisi/operations/build.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pisi/operations/build.py b/pisi/operations/build.py index 8eda5268..cc223682 100644 --- a/pisi/operations/build.py +++ b/pisi/operations/build.py @@ -937,6 +937,8 @@ class Builder: # FIXME: material collisions after expanding globs could be # reported as errors + d = {} + def add_path(path): # add the files under material path for fpath, fhash in util.get_file_hashes(path, collisions, install_dir): @@ -954,12 +956,9 @@ class Builder: st = os.stat(fpath) else: st = os.lstat(fpath) - - fileinfo = pisi.files.FileInfo(path=frpath, type=ftype, permanent=permanent, + d[frpath] = pisi.files.FileInfo(path=frpath, type=ftype, permanent=permanent, size=fsize, hash=fhash, uid=str(st.st_uid), gid=str(st.st_gid), mode=oct(stat.S_IMODE(st.st_mode))) - files.append(fileinfo) - if stat.S_IMODE(st.st_mode) & stat.S_ISUID: ctx.ui.warning(_("/%s has suid bit set") % frpath) @@ -968,6 +967,9 @@ class Builder: for path in glob.glob(wildcard_path): add_path(path) + for (p, fileinfo) in d.iteritems(): + files.append(fileinfo) + files_xml_path = util.join_path(self.pkg_dir(), ctx.const.files_xml) files.write(files_xml_path) self.files = files