1
0
mirror of https://github.com/moparisthebest/pacman synced 2025-01-09 04:57:59 -05:00

pactest: build the filelist using a set()

This will prevent duplicates, which we had plenty of once I made a few tests
that had a list of files greater than the normal two. The previous logic was
not working quite right.

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2011-01-11 18:43:28 -06:00
parent a9cbd15260
commit 0d4dd09993

View File

@ -38,16 +38,14 @@ def _mkfilelist(files):
usr/local/bin/ usr/local/bin/
usr/local/bin/dummy usr/local/bin/dummy
""" """
i = [] file_list = set()
for f in files: for f in files:
dir = getfilename(f) dir = getfilename(f)
i.append(dir) file_list.add(dir)
while "/" in dir: while "/" in dir:
[dir, tmp] = dir.rsplit("/", 1) [dir, tmp] = dir.rsplit("/", 1)
if not dir + "/" in files: file_list.add(dir + "/")
i.append(dir + "/") return sorted(file_list)
i.sort()
return i
def _mkbackuplist(backup): def _mkbackuplist(backup):
""" """