summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2014-10-06 03:55:06 -0400
committerAllan McRae <allan@archlinux.org>2014-10-13 12:54:29 +1000
commit6dd593c293bdc808b5e7040d06657c4f89e1a8bd (patch)
tree764a7a6efb154815ae87833eb947474cd053b77c /test
parent19c3179b7ebfa4c35dff45792c922602d9322417 (diff)
downloadpacman-6dd593c293bdc808b5e7040d06657c4f89e1a8bd.tar.xz
pmrule: make backup file test more robust
This prevents an exception in the event backup entries are not in the correct format and brings the test in line with alpm's backup parsing which splits on the last tab rather than the first. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'test')
-rw-r--r--test/pacman/pmrule.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/test/pacman/pmrule.py b/test/pacman/pmrule.py
index 0eec8ea9..c2336c5d 100644
--- a/test/pacman/pmrule.py
+++ b/test/pacman/pmrule.py
@@ -103,13 +103,11 @@ class pmrule(object):
if not value in newpkg.files:
success = 0
elif case == "BACKUP":
- found = 0
+ success = 0
for f in newpkg.backup:
- name, md5sum = f.split("\t")
- if value == name:
- found = 1
- if not found:
- success = 0
+ if f.startswith(value + "\t"):
+ success = 1
+ break;
else:
tap.diag("PKG rule '%s' not found" % case)
success = -1