From: Richard Heck Date: Tue, 10 Aug 2010 21:43:08 +0000 (+0000) Subject: Improve the error reporting, or checking, in configure.py. X-Git-Tag: 2.0.0~2815 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=7d8b56a21dd9b4576e59317c0c1e00d53fc1158c;p=features.git Improve the error reporting, or checking, in configure.py. There doesn't seem to be any way to report an error other than by exiting. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35119 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/lib/configure.py b/lib/configure.py index 05afc06712..6ac45507b6 100644 --- a/lib/configure.py +++ b/lib/configure.py @@ -992,7 +992,8 @@ def checkLatexConfig(check_config, bool_docbook): # Construct the list of classes to test for. # build the list of available layout files and convert it to commands # for chkconfig.ltx - p1 = re.compile(r'\Declare(LaTeX|DocBook)Class') + declare = re.compile(r'\Declare(LaTeX|DocBook)Class\s*(\[([^,]*)(,.*)*\])*\s*{(.*)}') + empty = re.compile(r'^\s*$') testclasses = list() for file in glob.glob( os.path.join('layouts', '*.layout') ) + \ glob.glob( os.path.join(srcdir, 'layouts', '*.layout' ) ) : @@ -1000,11 +1001,11 @@ def checkLatexConfig(check_config, bool_docbook): continue classname = file.split(os.sep)[-1].split('.')[0] for line in open(file).readlines(): - if p1.search(line) == None: - continue - if line[0] != '#': - logger.error("Wrong input layout file with line '" + line) + if not empty.match(line) and line[0] != '#': + logger.error("Failed to find \Declare line for layout file `" + file + "'") sys.exit(3) + if declare.search(line) == None: + continue testclasses.append("\\TestDocClass{%s}{%s}" % (classname, line[1:].strip())) break testclasses.sort()