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>
This commit is contained in:
Xavier Chantry 2009-07-17 19:33:13 +02:00 committed by Dan McGee
parent 8ebc07744a
commit a3ecbec6b5
1 changed files with 5 additions and 2 deletions

View File

@ -116,9 +116,12 @@ def check(self, root, retcode, localdb, files):
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):