Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/pactest/pmdb.py
diff options
context:
space:
mode:
Diffstat (limited to 'pactest/pmdb.py')
-rwxr-xr-xpactest/pmdb.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/pactest/pmdb.py b/pactest/pmdb.py
index cc852c2a..af392000 100755
--- a/pactest/pmdb.py
+++ b/pactest/pmdb.py
@@ -119,7 +119,10 @@ class pmdb:
# desc
filename = os.path.join(path, "desc")
- fd = file(filename, "r")
+ if not os.path.isfile(filename):
+ print "invalid db entry found (desc missing) for pkg", pkgname
+ return None
+ fd = open(filename, "r")
while 1:
line = fd.readline()
if not line:
@@ -158,7 +161,10 @@ class pmdb:
# files
filename = os.path.join(path, "files")
- fd = file(filename, "r")
+ if not os.path.isfile(filename):
+ print "invalid db entry found (files missing) for pkg", pkgname
+ return None
+ fd = open(filename, "r")
while 1:
line = fd.readline()
if not line:
@@ -177,6 +183,9 @@ class pmdb:
# depends
filename = os.path.join(path, "depends")
+ if not os.path.isfile(filename):
+ print "invalid db entry found (depends missing) for pkg", pkgname
+ return None
fd = file(filename, "r")
while 1:
line = fd.readline()