summaryrefslogtreecommitdiff
path: root/pactest/pmrule.py
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2007-11-29 22:33:45 -0600
committerDan McGee <dan@archlinux.org>2007-12-10 23:02:20 -0600
commitf8b113ed97652da62c217cef139c58ca1d75d647 (patch)
tree138d21ed4e34d3210ef3d4f28e0040cf6efce911 /pactest/pmrule.py
parent565d2eeed5fdd85b516cbc76bc48be439e42c41f (diff)
downloadpacman-f8b113ed97652da62c217cef139c58ca1d75d647.tar.xz
Fail sanely on OUTPUT rules when --nolog is passed
Check for existence of the logfile first, and output an error if not found Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'pactest/pmrule.py')
-rwxr-xr-xpactest/pmrule.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/pactest/pmrule.py b/pactest/pmrule.py
index f4e35443..ea3ad333 100755
--- a/pactest/pmrule.py
+++ b/pactest/pmrule.py
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
+import os
from util import *
from stat import *
@@ -52,7 +52,11 @@ class pmrule:
if retcode != int(key):
success = 0
elif case == "OUTPUT":
- if not grep(os.path.join(root, LOGFILE), key):
+ logfile = os.path.join(root, LOGFILE)
+ if not os.access(logfile, os.F_OK):
+ print "LOGFILE not found, cannot validate 'OUTPUT' rule"
+ success = 0
+ elif not grep(os.path.join(root, LOGFILE), key):
success = 0
else:
print "PACMAN rule '%s' not found" % case