Skip to content

Commit

Permalink
Revert "build: Remove redundant dict variable"
Browse files Browse the repository at this point in the history
This variable prevents writing duplicate entries to files.xml.
  • Loading branch information
Fatih Aşıcı committed Jul 27, 2011
1 parent 03810cb commit 08cffda
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pisi/operations/build.py
Expand Up @@ -937,6 +937,8 @@ def gen_files_xml(self, package):
# 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):
Expand All @@ -954,12 +956,9 @@ def add_path(path):
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)

Expand All @@ -968,6 +967,9 @@ def add_path(path):
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
Expand Down

0 comments on commit 08cffda

Please sign in to comment.