summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Chantry <shiningxc@gmail.com>2009-07-17 19:33:13 +0200
committerDan McGee <dan@archlinux.org>2009-07-20 10:12:26 -0500
commita3ecbec6b584b3595c041850e4c8bf242f7ce74a (patch)
tree82b831c9c35f70bc136278dd0fb7f0079d74b31b
parent8ebc07744ac58ed1e42af3a52d998587fca85f8b (diff)
downloadpacman-a3ecbec6b584b3595c041850e4c8bf242f7ce74a.tar.xz
pactest : safety check with MODE
check that the file exists first, otherwise pactest just breaks. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
-rwxr-xr-xpactest/pmrule.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/pactest/pmrule.py b/pactest/pmrule.py
index ea3ad333..e7c9c44f 100755
--- a/pactest/pmrule.py
+++ b/pactest/pmrule.py
@@ -116,9 +116,12 @@ class pmrule:
if not f.ismodified():
success = 0
elif case == "MODE":
- mode = os.lstat(filename)[ST_MODE]
- if int(value,8) != S_IMODE(mode):
+ if not os.path.isfile(filename):
success = 0
+ else:
+ mode = os.lstat(filename)[ST_MODE]
+ if int(value,8) != S_IMODE(mode):
+ success = 0
elif case == "TYPE":
if value == "dir":
if not os.path.isdir(filename):