From 0d4dd09993971924d379be4d0944d72f4c77b021 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 11 Jan 2011 18:43:28 -0600 Subject: 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 --- test/pacman/pmdb.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'test/pacman') diff --git a/test/pacman/pmdb.py b/test/pacman/pmdb.py index 60460ce2..b4d0e2d5 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): """ -- cgit v1.2.3-70-g09d2