summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-01-11 18:43:28 -0600
committerDan McGee <dan@archlinux.org>2011-01-12 09:11:10 -0600
commitcae2bdafec93381284ba487010738d72d0992aab (patch)
tree20a9aa26eea63988463671ce50e44313b65e41e8 /test
parent8e30a46adbe350a9741bbb9748334a4adc9742f6 (diff)
downloadpacman-cae2bdafec93381284ba487010738d72d0992aab.tar.xz
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 0d4dd09993971924d379be4d0944d72f4c77b021)
Diffstat (limited to 'test')
-rwxr-xr-xtest/pacman/pmdb.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/test/pacman/pmdb.py b/test/pacman/pmdb.py
index 8cb1b832..218e3b58 100755
--- a/test/pacman/pmdb.py
+++ b/test/pacman/pmdb.py
@@ -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):
"""