1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 15:58:50 -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>
(cherry picked from commit 0d4dd09993)
This commit is contained in:
Dan McGee 2011-01-11 18:43:28 -06:00
parent 8e30a46adb
commit cae2bdafec

View File

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