1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-10 11:35:00 -05:00

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>
This commit is contained in:
Andrew Gregory 2014-10-06 03:55:06 -04:00 committed by Allan McRae
parent 19c3179b7e
commit 6dd593c293

View File

@ -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