The branch, biblatex2, has been updated.

- Log -----------------------------------------------------------------

commit 74f774d6cf18a897deb533d3afc697abb31f824e
Merge: b9aabe6 1b75227
Author: Juergen Spitzmueller <[email protected]>
Date:   Wed Jan 11 10:45:48 2017 +0100

    Merge branch 'master' into biblatex2

diff --cc lib/configure.py
index 4ba71c9,e374673..8a016a9
--- a/lib/configure.py
+++ b/lib/configure.py
@@@ -1499,128 -1529,10 +1529,129 @@@ def processModuleFile(file, filename, b
              cm.write(line + '\n')
          cm.close()
  
-     return '"%s" "%s" "%s" "%s" "%s" "%s" "%s"\n' % (modname, filename, desc, 
pkgs, req, excl, catgy)
+     return ('"%s" "%s" "%s" "%s" "%s" "%s" "%s"\n'
+             % (modname, filename, desc, pkgs, req, excl, catgy))
  
  
 +def checkCiteEnginesConfig():
 +  removeFiles(['lyxciteengines.lst', 'chkciteengines.tex'])
 +
 +  logger.info('+checking list of cite engines... ')
 +  tx = open('lyxciteengines.lst', 'w')
 +  tx.write('''## This file declares cite engines and their associated 
definition files.
 +## It has been automatically generated by configure
 +## Use "Options/Reconfigure" if you need to update it after a
 +## configuration change.
 +## "CiteEngineName" "filename" "CiteEngineType" "CiteFramework" 
"DefaultBiblio" "Description" "Packages"
 +''')
 +
 +  # build the list of available modules
 +  seen = []
 +  # note that this searches the local directory first, then the
 +  # system directory. that way, we pick up the user's version first.
 +  for file in glob.glob( os.path.join('citeengines', '*.citeengine') ) + \
 +      glob.glob( os.path.join(srcdir, 'citeengines', '*.citeengine' ) ) :
 +      # valid file?
 +      logger.info(file)
 +      if not os.path.isfile(file):
 +          continue
 +
 +      filename = file.split(os.sep)[-1]
 +      filename = filename[:-11]
 +      if seen.count(filename):
 +          continue
 +
 +      seen.append(filename)
 +      retval = processCiteEngineFile(file, filename, bool_docbook)
 +      if retval != "":
 +          tx.write(retval)
 +  tx.close()
 +  logger.info('\tdone')
 +
 +
 +def processCiteEngineFile(file, filename, bool_docbook):
 +    ''' process cite engines file and get a line of result
 +
 +        The top of a cite engine file should look like this:
 +          #\DeclareLyXCiteEngine[LaTeX Packages]{CiteEngineName}
 +          #DescriptionBegin
 +          #...body of description...
 +          #DescriptionEnd
 +        We expect output:
 +          "CiteEngineName" "filename" "CiteEngineType" "CiteFramework" 
"DefaultBiblio" "Description" "Packages"
 +    '''
 +    remods = re.compile(r'\DeclareLyXCiteEngine\s*(?:\[([^]]*?)\])?{(.*)}')
 +    redbeg = re.compile(r'#+\s*DescriptionBegin\s*$')
 +    redend = re.compile(r'#+\s*DescriptionEnd\s*$')
 +    recet = re.compile(r'\s*CiteEngineType\s*(.*)')
 +    redb = re.compile(r'\s*DefaultBiblio\s*(.*)')
 +    resfm = re.compile(r'\s*CiteFramework\s*(.*)')
 +
 +    modname = desc = pkgs = cet = db = cfm = ""
 +    readingDescription = False
 +    descLines = []
 +
 +    for line in open(file).readlines():
 +      if readingDescription:
 +        res = redend.search(line)
 +        if res != None:
 +          readingDescription = False
 +          desc = " ".join(descLines)
 +          # Escape quotes.
 +          desc = desc.replace('"', '\\"')
 +          continue
 +        descLines.append(line[1:].strip())
 +        continue
 +      res = redbeg.search(line)
 +      if res != None:
 +        readingDescription = True
 +        continue
 +      res = remods.search(line)
 +      if res != None:
 +          (pkgs, modname) = res.groups()
 +          if pkgs == None:
 +            pkgs = ""
 +          else:
 +            tmp = [s.strip() for s in pkgs.split(",")]
 +            pkgs = ",".join(tmp)
 +          continue
 +      res = recet.search(line)
 +      if res != None:
 +        cet = res.group(1)
 +        continue
 +      res = redb.search(line)
 +      if res != None:
 +        db = res.group(1)
 +        continue
 +      res = resfm.search(line)
 +      if res != None:
 +        cfm = res.group(1)
 +        continue
 +
 +    if modname == "":
 +      logger.warning("Cite Engine File file without \DeclareLyXCiteEngine 
line. ")
 +      return ""
 +
 +    if pkgs != "":
 +        # this cite engine has some latex dependencies:
 +        # append the dependencies to chkciteengines.tex,
 +        # which is \input'ed by chkconfig.ltx
 +        testpackages = list()
 +        for pkg in pkgs.split(","):
 +            if "->" in pkg:
 +                # this is a converter dependency: skip
 +                continue
 +            if pkg.endswith(".sty"):
 +                pkg = pkg[:-4]
 +            testpackages.append("\\TestPackage{%s}" % (pkg,))
 +        cm = open('chkciteengines.tex', 'a')
 +        for line in testpackages:
 +            cm.write(line + '\n')
 +        cm.close()
 +
 +    return '"%s" "%s" "%s" "%s" "%s" "%s" "%s"\n' % (modname, filename, cet, 
cfm, db, desc, pkgs)
 +
 +
  def checkTeXAllowSpaces():
      ''' Let's check whether spaces are allowed in TeX file names '''
      tex_allows_spaces = 'false'

commit 1b752275b00498c546334205227b65ed70119ae3
Author: Günter Milde <[email protected]>
Date:   Wed Jan 11 10:42:32 2017 +0100

    Python formatting (no change to function).
    
    * remove trailing whitespace,
    * remove/replace NL-escaping backslashs,
    * wrap long lines.

diff --git a/lib/configure.py b/lib/configure.py
index fb1abd3..e374673 100644
--- a/lib/configure.py
+++ b/lib/configure.py
@@ -72,7 +72,7 @@ def cmdOutput(cmd, async = False):
             cmd = 'cmd /d /c pushd ' + shortPath(os.getcwd()) + '&' + cmd
     else:
         b = True
-    pipe = subprocess.Popen(cmd, shell=b, close_fds=b, stdin=subprocess.PIPE, \
+    pipe = subprocess.Popen(cmd, shell=b, close_fds=b, stdin=subprocess.PIPE,
                             stdout=subprocess.PIPE, universal_newlines=True)
     pipe.stdin.close()
     if async:
@@ -110,16 +110,16 @@ def setEnviron():
 
 def copy_tree(src, dst, preserve_symlinks=False, level=0):
     ''' Copy an entire directory tree 'src' to a new location 'dst'.
- 
+
     Code inspired from distutils.copy_tree.
-        Copying ignores non-regular files and the cache directory.
+         Copying ignores non-regular files and the cache directory.
     Pipes may be present as leftovers from LyX for lyx-server.
 
     If 'preserve_symlinks' is true, symlinks will be
     copied as symlinks (on platforms that support them!); otherwise
     (the default), the destination of the symlink will be copied.
     '''
- 
+
     if not os.path.isdir(src):
         raise FileError("cannot copy tree '%s': not a directory" % src)
     try:
@@ -127,12 +127,12 @@ def copy_tree(src, dst, preserve_symlinks=False, level=0):
     except os.error as oserror:
         (errno, errstr) = oserror.args
         raise FileError("error listing files in '%s': %s" % (src, errstr))
- 
+
     if not os.path.isdir(dst):
         os.makedirs(dst)
- 
+
     outputs = []
- 
+
     for name in names:
         src_name = os.path.join(src, name)
         dst_name = os.path.join(dst, name)
@@ -150,7 +150,7 @@ def copy_tree(src, dst, preserve_symlinks=False, level=0):
             outputs.append(dst_name)
         else:
             logger.info("Ignore non-regular file %s", src_name)
- 
+
     return outputs
 
 
@@ -176,7 +176,7 @@ def checkUpgrade():
 
 def createDirectories():
     ''' Create the build directories if necessary '''
-    for dir in ['bind', 'clipart', 'doc', 'examples', 'images', 'kbd', \
+    for dir in ['bind', 'clipart', 'doc', 'examples', 'images', 'kbd',
         'layouts', 'scripts', 'templates', 'ui' ]:
         if not os.path.isdir( dir ):
             try:
@@ -210,9 +210,11 @@ def checkTeXPaths():
         inpname = inpname.replace('~', '\\string~')
         os.write(fd, r'\relax')
         os.close(fd)
-        latex_out = cmdOutput(r'latex 
"\nonstopmode\input{%s}\makeatletter\@@end"' % inpname)
+        latex_out = cmdOutput(r'latex 
"\nonstopmode\input{%s}\makeatletter\@@end"'
+                              % inpname)
         if 'Error' in latex_out:
-            latex_out = cmdOutput(r'latex 
"\nonstopmode\input{\"%s\"}\makeatletter\@@end"' % inpname)
+            latex_out = cmdOutput(r'latex 
"\nonstopmode\input{\"%s\"}\makeatletter\@@end"'
+                                  % inpname)
         if 'Error' in latex_out:
             logger.warning("configure: TeX engine needs posix-style paths in 
latex files")
             windows_style_tex_paths = 'false'
@@ -252,7 +254,8 @@ def checkProg(description, progs, rc_entry = [], path = [], 
not_found = ''):
     '''
     # one rc entry for each progs plus not_found entry
     if len(rc_entry) > 1 and len(rc_entry) != len(progs) + 1:
-        logger.error("rc entry should have one item or item for each prog and 
not_found.")
+        logger.error("rc entry should have one item or item "
+                     "for each prog and not_found.")
         sys.exit(2)
     logger.info('checking for ' + description + '...')
     ## print '(' + ','.join(progs) + ')',
@@ -279,13 +282,17 @@ def checkProg(description, progs, rc_entry = [], path = 
[], not_found = ''):
                     logger.info(msg + ' yes')
                     # deal with java and perl
                     if ac_word.endswith('.class'):
-                        ac_prog = ac_prog.replace(ac_word, r'%s \"%s\"' % 
(java, os.path.join(ac_dir, ac_word[:-6])))
+                        ac_prog = ac_prog.replace(ac_word, r'%s \"%s\"'
+                                    % (java, os.path.join(ac_dir, 
ac_word[:-6])))
                     elif ac_word.endswith('.jar'):
-                        ac_prog = ac_prog.replace(ac_word, r'%s -jar \"%s\"' % 
(java, os.path.join(ac_dir, ac_word)))
+                        ac_prog = ac_prog.replace(ac_word, r'%s -jar \"%s\"'
+                                    % (java, os.path.join(ac_dir, ac_word)))
                     elif ac_word.endswith('.pl'):
-                        ac_prog = ac_prog.replace(ac_word, r'%s -w \"%s\"' % 
(perl, os.path.join(ac_dir, ac_word)))
+                        ac_prog = ac_prog.replace(ac_word, r'%s -w \"%s\"'
+                                    % (perl, os.path.join(ac_dir, ac_word)))
                     elif ac_dir in additional_path:
-                        ac_prog = ac_prog.replace(ac_word, r'\"%s\"' % 
(os.path.join(ac_dir, ac_word)))
+                        ac_prog = ac_prog.replace(ac_word, r'\"%s\"'
+                                    % (os.path.join(ac_dir, ac_word)))
                     # write rc entries for this command
                     if len(rc_entry) == 1:
                         addToRC(rc_entry[0].replace('%%', ac_prog))
@@ -300,7 +307,8 @@ def checkProg(description, progs, rc_entry = [], path = [], 
not_found = ''):
     return ['', not_found]
 
 
-def checkProgAlternatives(description, progs, rc_entry = [], alt_rc_entry = 
[], path = [], not_found = ''):
+def checkProgAlternatives(description, progs, rc_entry = [],
+                          alt_rc_entry = [], path = [], not_found = ''):
     '''
         The same as checkProg, but additionally, all found programs will be 
added
         as alt_rc_entries
@@ -340,13 +348,17 @@ def checkProgAlternatives(description, progs, rc_entry = 
[], alt_rc_entry = [],
                     m = None
                     # deal with java and perl
                     if ac_word.endswith('.class'):
-                        ac_prog = ac_prog.replace(ac_word, r'%s \"%s\"' % 
(java, os.path.join(ac_dir, ac_word[:-6])))
+                        ac_prog = ac_prog.replace(ac_word, r'%s \"%s\"'
+                                    % (java, os.path.join(ac_dir, 
ac_word[:-6])))
                     elif ac_word.endswith('.jar'):
-                        ac_prog = ac_prog.replace(ac_word, r'%s -jar \"%s\"' % 
(java, os.path.join(ac_dir, ac_word)))
+                        ac_prog = ac_prog.replace(ac_word, r'%s -jar \"%s\"'
+                                    % (java, os.path.join(ac_dir, ac_word)))
                     elif ac_word.endswith('.pl'):
-                        ac_prog = ac_prog.replace(ac_word, r'%s -w \"%s\"' % 
(perl, os.path.join(ac_dir, ac_word)))
+                        ac_prog = ac_prog.replace(ac_word, r'%s -w \"%s\"'
+                                    % (perl, os.path.join(ac_dir, ac_word)))
                     elif ac_dir in additional_path:
-                        ac_prog = ac_prog.replace(ac_word, r'\"%s\"' % 
(os.path.join(ac_dir, ac_word)))
+                        ac_prog = ac_prog.replace(ac_word, r'\"%s\"'
+                                    % (os.path.join(ac_dir, ac_word)))
                     # write rc entries for this command
                     if found_prime == False:
                         if len(rc_entry) == 1:
@@ -438,33 +450,38 @@ def listAlternatives(progs, alt_type, rc_entry = []):
 def checkViewer(description, progs, rc_entry = [], path = []):
     ''' The same as checkProgAlternatives, but for viewers '''
     alt_rc_entry = listAlternatives(progs, 'viewer', rc_entry)
-    return checkProgAlternatives(description, progs, rc_entry, alt_rc_entry, 
path, not_found = 'auto')
+    return checkProgAlternatives(description, progs, rc_entry,
+                                 alt_rc_entry, path, not_found = 'auto')
 
 
 def checkEditor(description, progs, rc_entry = [], path = []):
     ''' The same as checkProgAlternatives, but for editors '''
     alt_rc_entry = listAlternatives(progs, 'editor', rc_entry)
-    return checkProgAlternatives(description, progs, rc_entry, alt_rc_entry, 
path, not_found = 'auto')
+    return checkProgAlternatives(description, progs, rc_entry,
+                                 alt_rc_entry, path, not_found = 'auto')
 
 
 def checkViewerNoRC(description, progs, rc_entry = [], path = []):
     ''' The same as checkViewer, but do not add rc entry '''
     alt_rc_entry = listAlternatives(progs, 'viewer', rc_entry)
     rc_entry = []
-    return checkProgAlternatives(description, progs, rc_entry, alt_rc_entry, 
path, not_found = 'auto')
+    return checkProgAlternatives(description, progs, rc_entry,
+                                 alt_rc_entry, path, not_found = 'auto')
 
 
 def checkEditorNoRC(description, progs, rc_entry = [], path = []):
     ''' The same as checkViewer, but do not add rc entry '''
     alt_rc_entry = listAlternatives(progs, 'editor', rc_entry)
     rc_entry = []
-    return checkProgAlternatives(description, progs, rc_entry, alt_rc_entry, 
path, not_found = 'auto')
+    return checkProgAlternatives(description, progs, rc_entry,
+                                 alt_rc_entry, path, not_found = 'auto')
 
 
 def checkViewerEditor(description, progs, rc_entry = [], path = []):
     ''' The same as checkProgAlternatives, but for viewers and editors '''
     alt_rc_entry = listAlternatives(progs, ['editor', 'viewer'], rc_entry)
-    return checkProgAlternatives(description, progs, rc_entry, alt_rc_entry, 
path, not_found = 'auto')
+    return checkProgAlternatives(description, progs, rc_entry,
+                                 alt_rc_entry, path, not_found = 'auto')
 
 
 def checkDTLtools():
@@ -606,10 +623,10 @@ def checkFormatEntries(dtl_tools):
 \Format xpm        xpm     XPM                    "" "%s"      "%s"    ""      
"image/x-xpixmap"'''
     path, iv = checkViewerNoRC('a raster image viewer', ['xv', 'kview', 
'gimp-remote', 'gimp'], rc_entry = [imageformats])
     path, ie = checkEditorNoRC('a raster image editor', ['gimp-remote', 
'gimp'], rc_entry = [imageformats])
-    addToRC(imageformats % \
+    addToRC(imageformats %
         (iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, ie, iv, 
ie, iv, ie) )
     #
-    checkViewerEditor('a text editor', ['xemacs', 'gvim', 'kedit', 'kwrite', 
'kate', \
+    checkViewerEditor('a text editor', ['xemacs', 'gvim', 'kedit', 'kwrite', 
'kate',
         'nedit', 'gedit', 'notepad', 'geany', 'leafpad', 'mousepad'],
         rc_entry = [r'''\Format asciichess asc    "Plain text (chess output)"  
"" ""   "%%"    ""      ""
 \Format docbook    sgml    DocBook                B  ""        "%%"    
"document,menu=export"  ""
@@ -645,25 +662,29 @@ def checkFormatEntries(dtl_tools):
     checkViewer('an HTML previewer', ['firefox', 'mozilla file://$$p$$i', 
'netscape'],
         rc_entry = [r'\Format xhtml      xhtml   "LyXHTML"              y "%%" 
""    "document,menu=export"    "application/xhtml+xml"'])
  #
-    checkEditor('a BibTeX editor', ['jabref', 'JabRef', \
-        'pybliographic', 'bibdesk', 'gbib', 'kbib', \
-        'kbibtex', 'sixpack', 'bibedit', 'tkbibtex' \
-        'xemacs', 'gvim', 'kedit', 'kwrite', 'kate', \
-        'jedit', 'TeXnicCenter', 'WinEdt', 'WinShell', 'PSPad', \
+    checkEditor('a BibTeX editor', ['jabref', 'JabRef',
+        'pybliographic', 'bibdesk', 'gbib', 'kbib',
+        'kbibtex', 'sixpack', 'bibedit', 'tkbibtex'
+        'xemacs', 'gvim', 'kedit', 'kwrite', 'kate',
+        'jedit', 'TeXnicCenter', 'WinEdt', 'WinShell', 'PSPad',
         'nedit', 'gedit', 'notepad', 'geany', 'leafpad', 'mousepad'],
         rc_entry = [r'''\Format bibtex bib    "BibTeX"         "" ""   "%%"    
""      "text/x-bibtex"''' ])
     #
     #checkProg('a Postscript interpreter', ['gs'],
     #  rc_entry = [ r'\ps_command "%%"' ])
-    checkViewer('a Postscript previewer', ['kghostview', 'okular', 'qpdfview 
--unique', 'evince', 'gv', 'ghostview -swap', 'gsview64', 'gsview32'],
+    checkViewer('a Postscript previewer', ['kghostview', 'okular', 'qpdfview 
--unique',
+                                           'evince', 'gv', 'ghostview -swap',
+                                           'gsview64', 'gsview32'],
         rc_entry = [r'''\Format eps        eps     EPS                    "" 
"%%"      ""      "vector"        "image/x-eps"
 \Format eps2       eps    "EPS (uncropped)"       "" "%%"      ""      
"vector"        ""
 \Format eps3       eps    "EPS (cropped)"         "" "%%"      ""      
"document"      ""
 \Format ps         ps      Postscript             t  "%%"      ""      
"document,vector,menu=export"   "application/postscript"'''])
     # for xdg-open issues look here: 
http://www.mail-archive.com/[email protected]/msg151818.html
     # the MIME type is set for pdf6, because that one needs to be 
autodetectable by libmime
-    checkViewer('a PDF previewer', ['pdfview', 'kpdf', 'okular', 'qpdfview 
--unique', 'evince', 'kghostview', 'xpdf', 'SumatraPDF', 'acrobat', 'acroread', 
'mupdf', \
-                   'gv', 'ghostview', 'AcroRd32', 'gsview64', 'gsview32'],
+    checkViewer('a PDF previewer', ['pdfview', 'kpdf', 'okular', 'qpdfview 
--unique',
+                                    'evince', 'kghostview', 'xpdf', 
'SumatraPDF',
+                                    'acrobat', 'acroread', 'mupdf', 'gv',
+                                    'ghostview', 'AcroRd32', 'gsview64', 
'gsview32'],
         rc_entry = [r'''\Format pdf        pdf    "PDF (ps2pdf)"          P  
"%%"      ""      "document,vector,menu=export"   ""
 \Format pdf2       pdf    "PDF (pdflatex)"        F  "%%"      ""      
"document,vector,menu=export"   ""
 \Format pdf3       pdf    "PDF (dvipdfm)"         m  "%%"      ""      
"document,vector,menu=export"   ""
@@ -776,7 +797,7 @@ def checkConverterEntries():
 \converter knitr   luatex     "%%"     "needauth"
 \converter knitr   dviluatex  "%%"     "needauth"'''])
     #
-    checkProg('a Sweave -> R/S code converter', ['Rscript --verbose --no-save 
--no-restore $$s/scripts/lyxstangle.R $$i $$e $$r'], 
+    checkProg('a Sweave -> R/S code converter', ['Rscript --verbose --no-save 
--no-restore $$s/scripts/lyxstangle.R $$i $$e $$r'],
         rc_entry = [ r'\converter sweave      r      "%%"    "needauth"' ])
     #
     checkProg('a knitr -> R/S code converter', ['Rscript --verbose --no-save 
--no-restore $$s/scripts/lyxknitr.R $$p$$i $$p$$o $$e $$r tangle'],
@@ -784,9 +805,9 @@ def checkConverterEntries():
     #
     checkProg('an HTML -> LaTeX converter', ['html2latex $$i', 'gnuhtml2latex',
         'htmltolatex -input $$i -output $$o', 'htmltolatex.jar -input $$i 
-output $$o'],
-        rc_entry = [ r'\converter html       latex      "%%"   ""', \
-                     r'\converter html       latex      "python -tt 
$$s/scripts/html2latexwrapper.py %% $$i $$o"       ""', \
-                     r'\converter html       latex      "%%"   ""', \
+        rc_entry = [ r'\converter html       latex      "%%"   ""',
+                     r'\converter html       latex      "python -tt 
$$s/scripts/html2latexwrapper.py %% $$i $$o"       ""',
+                     r'\converter html       latex      "%%"   ""',
                      r'\converter html       latex      "%%"   ""', '' ])
     #
     checkProg('an MS Word -> LaTeX converter', ['wvCleanLatex $$i $$o'],
@@ -811,16 +832,16 @@ def checkConverterEntries():
     else:
       # search for HTML converters other than eLyXer
       # On SuSE the scripts have a .sh suffix, and on debian they are in 
/usr/share/tex4ht/
-      path, htmlconv = checkProg('a LaTeX -> HTML converter', ['htlatex $$i', 
'htlatex.sh $$i', \
-          '/usr/share/tex4ht/htlatex $$i', 'tth  -t -e2 -L$$b < $$i > $$o', \
+      path, htmlconv = checkProg('a LaTeX -> HTML converter', ['htlatex $$i', 
'htlatex.sh $$i',
+          '/usr/share/tex4ht/htlatex $$i', 'tth  -t -e2 -L$$b < $$i > $$o',
           'latex2html -no_subdir -split 0 -show_section_numbers $$i', 'hevea 
-s $$i'],
           rc_entry = [ r'\converter latex      html       "%%" "needaux"' ])
       if htmlconv.find('htlatex') >= 0 or htmlconv == 'latex2html':
         addToRC(r'''\copier    html       "python -tt $$s/scripts/ext_copy.py 
-e html,png,css $$i $$o"''')
       else:
         addToRC(r'''\copier    html       "python -tt $$s/scripts/ext_copy.py 
$$i $$o"''')
-      path, htmlconv = checkProg('a LaTeX -> HTML (MS Word) converter', 
["htlatex $$i 'html,word' 'symbol/!' '-cvalidate'", \
-          "htlatex.sh $$i 'html,word' 'symbol/!' '-cvalidate'", \
+      path, htmlconv = checkProg('a LaTeX -> HTML (MS Word) converter', 
["htlatex $$i 'html,word' 'symbol/!' '-cvalidate'",
+          "htlatex.sh $$i 'html,word' 'symbol/!' '-cvalidate'",
           "/usr/share/tex4ht/htlatex $$i 'html,word' 'symbol/!' '-cvalidate'"],
           rc_entry = [ r'\converter latex      wordhtml   "%%" "needaux"' ])
       if htmlconv.find('htlatex') >= 0:
@@ -873,7 +894,7 @@ def checkConverterEntries():
     #
     checkProg('a RTF -> HTML converter', ['unrtf --html  $$i > $$o'],
         rc_entry = [ r'\converter rtf      html        "%%"    ""' ])
-    # Do not define a converter to pdf6, ps is a pure export format 
+    # Do not define a converter to pdf6, ps is a pure export format
     checkProg('a PS to PDF converter', ['ps2pdf $$i $$o'],
         rc_entry = [ r'\converter ps         pdf        "%%"   ""' ])
     #
@@ -1145,15 +1166,19 @@ def checkOtherEntries():
     ''' entries other than Format and Converter '''
     checkProg('ChkTeX', ['chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38'],
         rc_entry = [ r'\chktex_command "%%"' ])
-    checkProgAlternatives('BibTeX or alternative programs', ['bibtex', 
'bibtex8', 'biber'],
+    checkProgAlternatives('BibTeX or alternative programs',
+        ['bibtex', 'bibtex8', 'biber'],
         rc_entry = [ r'\bibtex_command "%%"' ],
         alt_rc_entry = [ r'\bibtex_alternatives "%%"' ])
-    checkProg('a specific Japanese BibTeX variant', ['pbibtex', 'jbibtex', 
'bibtex'],
+    checkProg('a specific Japanese BibTeX variant',
+        ['pbibtex', 'jbibtex', 'bibtex'],
         rc_entry = [ r'\jbibtex_command "%%"' ])
-    checkProgAlternatives('available index processors', ['texindy', 'makeindex 
-c -q', 'xindy'],
+    checkProgAlternatives('available index processors',
+        ['texindy', 'makeindex -c -q', 'xindy'],
         rc_entry = [ r'\index_command "%%"' ],
         alt_rc_entry = [ r'\index_alternatives "%%"' ])
-    checkProg('an index processor appropriate to Japanese', ['mendex -c -q', 
'jmakeindex -c -q', 'makeindex -c -q'],
+    checkProg('an index processor appropriate to Japanese',
+        ['mendex -c -q', 'jmakeindex -c -q', 'makeindex -c -q'],
         rc_entry = [ r'\jindex_command "%%"' ])
     checkProg('the splitindex processor', ['splitindex.pl', 'splitindex',
         'splitindex.class'], rc_entry = [ r'\splitindex_command "%%"' ])
@@ -1177,19 +1202,19 @@ def processLayoutFile(file, bool_docbook):
         Declare lines look like this:
 
         \DeclareLaTeXClass[<requirements>]{<description>}
-        
+
         Optionally, a \DeclareCategory line follows:
-        
+
         \DeclareCategory{<category>}
-        
+
         So for example (article.layout, scrbook.layout, svjog.layout)
-        
+
         \DeclareLaTeXClass{article}
         \DeclareCategory{Articles}
-        
+
         \DeclareLaTeXClass[scrbook]{book (koma-script)}
         \DeclareCategory{Books}
-        
+
         \DeclareLaTeXClass[svjour,svjog.clo]{article (Springer - svjour/jog)}
 
         we'd expect this output:
@@ -1226,7 +1251,8 @@ def processLayoutFile(file, bool_docbook):
                 prereq_latex = ','.join(prereq_list)
             prereq_docbook = {'true':'', 'false':'docbook'}[bool_docbook]
             prereq = {'LaTeX':prereq_latex, 
'DocBook':prereq_docbook}[classtype]
-            classdeclaration = '"%s" "%s" "%s" "%s" "%s"' % (classname, opt, 
desc, avai, prereq)
+            classdeclaration = ('"%s" "%s" "%s" "%s" "%s"'
+                               % (classname, opt, desc, avai, prereq))
             if categorydeclaration != '""':
                 return classdeclaration + " " + categorydeclaration
         if qres != None:
@@ -1265,8 +1291,8 @@ def checkLatexConfig(check_config, bool_docbook):
         # build the list of available layout files and convert it to commands
         # for chkconfig.ltx
         foundClasses = []
-        for file in glob.glob( os.path.join('layouts', '*.layout') ) + \
-            glob.glob( os.path.join(srcdir, 'layouts', '*.layout' ) ) :
+        for file in (glob.glob(os.path.join('layouts', '*.layout'))
+                     + glob.glob(os.path.join(srcdir, 'layouts', '*.layout'))):
             # valid file?
             if not os.path.isfile(file):
                 continue
@@ -1307,8 +1333,8 @@ def checkLatexConfig(check_config, bool_docbook):
     category = re.compile(r'^\s*#\s*\\DeclareCategory{(.*)}\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' ) ) :
+    for file in (glob.glob( os.path.join('layouts', '*.layout') )
+                 + glob.glob( os.path.join(srcdir, 'layouts', '*.layout' ) ) ):
         nodeclaration = False
         if not os.path.isfile(file):
             continue
@@ -1318,7 +1344,8 @@ def checkLatexConfig(check_config, bool_docbook):
         for line in open(file).readlines():
             if not empty.match(line) and line[0] != '#':
                 if decline == "":
-                    logger.warning("Failed to find valid \Declare line for 
layout file `" + file + "'.\n\t=> Skipping this file!")
+                    logger.warning("Failed to find valid \Declare line "
+                        "for layout file `%s'.\n\t=> Skipping this file!" % 
file)
                     nodeclaration = True
                 # A class, but no category declaration. Just break.
                 break
@@ -1326,7 +1353,8 @@ def checkLatexConfig(check_config, bool_docbook):
                 decline = "\\TestDocClass{%s}{%s}" % (classname, 
line[1:].strip())
                 testclasses.append(decline)
             elif category.search(line) != None:
-                catline = "\\DeclareCategory{%s}{%s}" % (classname, 
category.search(line).groups()[0])
+                catline = ("\\DeclareCategory{%s}{%s}"
+                           % (classname, category.search(line).groups()[0]))
                 testclasses.append(catline)
             if catline == "" or decline == "":
                 continue
@@ -1368,8 +1396,10 @@ def checkLatexConfig(check_config, bool_docbook):
         pass
     # if configure successed, move textclass.lst.tmp to textclass.lst
     # and packages.lst.tmp to packages.lst
-    if os.path.isfile('textclass.lst.tmp') and 
len(open('textclass.lst.tmp').read()) > 0 \
-        and os.path.isfile('packages.lst.tmp') and 
len(open('packages.lst.tmp').read()) > 0:
+    if (os.path.isfile('textclass.lst.tmp')
+          and len(open('textclass.lst.tmp').read()) > 0
+        and os.path.isfile('packages.lst.tmp')
+          and len(open('packages.lst.tmp').read()) > 0):
         shutil.move('textclass.lst.tmp', 'textclass.lst')
         shutil.move('packages.lst.tmp', 'packages.lst')
     return ret
@@ -1391,8 +1421,8 @@ def checkModulesConfig():
   seen = []
   # note that this searches the local directory first, then the
   # system directory. that way, we pick up the user's version first.
-  for file in glob.glob( os.path.join('layouts', '*.module') ) + \
-      glob.glob( os.path.join(srcdir, 'layouts', '*.module' ) ) :
+  for file in (glob.glob( os.path.join('layouts', '*.module') )
+               + glob.glob( os.path.join(srcdir, 'layouts', '*.module' ) ) ):
       # valid file?
       logger.info(file)
       if not os.path.isfile(file):
@@ -1499,7 +1529,8 @@ def processModuleFile(file, filename, bool_docbook):
             cm.write(line + '\n')
         cm.close()
 
-    return '"%s" "%s" "%s" "%s" "%s" "%s" "%s"\n' % (modname, filename, desc, 
pkgs, req, excl, catgy)
+    return ('"%s" "%s" "%s" "%s" "%s" "%s" "%s"\n'
+            % (modname, filename, desc, pkgs, req, excl, catgy))
 
 
 def checkTeXAllowSpaces():
@@ -1534,7 +1565,8 @@ def rescanTeXFiles():
     interpreter = sys.executable
     if interpreter == '':
         interpreter = "python"
-    tfp = cmdOutput(interpreter + " -tt " + '"' + os.path.join(srcdir, 
'scripts', 'TeXFiles.py') + '"')
+    tfp = cmdOutput(interpreter + " -tt " + '"'
+                    + os.path.join(srcdir, 'scripts', 'TeXFiles.py') + '"')
     logger.info(tfp)
     logger.info("\tdone")
 

commit 931542d758caf8de718c917ba641c81c6fb76ab1
Author: Kornel Benko <[email protected]>
Date:   Wed Jan 11 10:17:25 2017 +0100

    Typo

diff --git a/lib/doc/Development.lyx b/lib/doc/Development.lyx
index 9232eea..18f0861 100644
--- a/lib/doc/Development.lyx
+++ b/lib/doc/Development.lyx
@@ -3446,7 +3446,7 @@ unreliable:nonstandard
 \begin_layout Itemize
 Check the log file Testing/Temporary/LastTest.log.
  In case of latex-errors rerun the failing test with environment variable
- 'LAX_DEBUG_LATEX' set to '1'.
+ 'LYX_DEBUG_LATEX' set to '1'.
  This will include latex messages in LastTest.log, so it should be easier
  to interpret the fail-reason.
 \end_layout

commit b487e2b050eb1bbe2254a2232214262f6921c655
Author: Kornel Benko <[email protected]>
Date:   Wed Jan 11 10:15:13 2017 +0100

    Cmake tests: Allow ignoring some latex error messages
    
    New file: ignoreLatexErrorsTests
    The sublabels in this list of export-testnames specify which error
    messages should be ignored.
    For each sublabel (for example "xxx") the lyx-command line is expanded with
      "--ignore-error-message xxx"

diff --git a/development/autotests/ExportTests.cmake 
b/development/autotests/ExportTests.cmake
index 7184994..9d3e6d0 100644
--- a/development/autotests/ExportTests.cmake
+++ b/development/autotests/ExportTests.cmake
@@ -186,7 +186,7 @@ macro(maketestname testname inverted listinverted 
listignored listunreliable lis
   endif()
 endmacro()
 
-macro(loadTestList filename resList depth)
+macro(loadTestList filename resList depth splitlangs)
   # Create list of strings from a file without comments
   # ENCODING parameter is a new feature in cmake 3.1
   initLangVars(${resList})
@@ -218,8 +218,12 @@ macro(loadTestList filename resList depth)
         list(REMOVE_DUPLICATES mylabels)
         set(sublabel ${_newl})
       else()
-        string(REGEX REPLACE "(\\/|\\||\\(|\\))" "  " _vxx ${_newl})
-        string(REGEX MATCHALL " ([a-z][a-z](_[A-Z][A-Z])?) " _vx ${_vxx})
+       if (splitlangs)
+         string(REGEX REPLACE "(\\/|\\||\\(|\\))" "  " _vxx ${_newl})
+         string(REGEX MATCHALL " ([a-z][a-z](_[A-Z][A-Z])?) " _vx ${_vxx})
+       else()
+         set(_vx OFF)
+       endif()
         if(_vx)
           foreach(_v ${_vx})
             string(REGEX REPLACE " " "" _v ${_v})
@@ -276,10 +280,11 @@ assignLabelDepth(1 "unreliable" "inverted")
 assignLabelDepth(2 "suspended")
 assignLabelDepth(-1 "examples" "manuals" "mathmacros" "templates" "autotests")
 
-loadTestList(invertedTests invertedTests 7)
-loadTestList(ignoredTests ignoredTests 0)
-loadTestList(suspendedTests suspendedTests 6)
-loadTestList(unreliableTests unreliableTests 5)
+loadTestList(invertedTests invertedTests 7 ON)
+loadTestList(ignoredTests ignoredTests 0 ON)
+loadTestList(suspendedTests suspendedTests 6 ON)
+loadTestList(unreliableTests unreliableTests 5 ON)
+loadTestList(ignoreLatexErrorsTests ignoreLatexErrorsTests 8 OFF)
 
 foreach(libsubfolderx autotests/export lib/doc lib/examples lib/templates 
autotests/mathmacros)
   set(testlabel "export")
@@ -417,6 +422,8 @@ foreach(libsubfolderx autotests/export lib/doc lib/examples 
lib/templates autote
           set(mytestlabel ${testlabel})
           maketestname(TestName inverted invertedTests ignoredTests 
unreliableTests mytestlabel)
           if(TestName)
+           set(missingLabels )
+           findexpr(mfound TestName ignoreLatexErrorsTests missingLabels)
             add_test(NAME ${TestName}
               WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${LYX_HOME}"
               COMMAND ${CMAKE_COMMAND} -DLYX_ROOT=${LIBSUB_SRC_DIR}
@@ -429,6 +436,7 @@ foreach(libsubfolderx autotests/export lib/doc lib/examples 
lib/templates autote
               -Dfile=${f}
               -Dinverted=${inverted}
               -DTOP_SRC_DIR=${TOP_SRC_DIR}
+             "-DIgnoreErrorMessage=${missingLabels}"
               -DPERL_EXECUTABLE=${PERL_EXECUTABLE}
               -DXMLLINT_EXECUTABLE=${XMLLINT_EXECUTABLE}
               -DENCODING=${_enc2}
diff --git a/development/autotests/export.cmake 
b/development/autotests/export.cmake
index 08fd86e..3dd32d9 100755
--- a/development/autotests/export.cmake
+++ b/development/autotests/export.cmake
@@ -24,12 +24,14 @@
 #       -Dfile=xxx \
 #       -Dinverted=[01] \
 #       -DTOP_SRC_DIR=${TOP_SRC_DIR} \
+#       -DIgnoreErrorMessage=(ON/OFF) \
 #       -DPERL_EXECUTABLE=${PERL_EXECUTABLE} \
 #       -DXMLLINT_EXECUTABLE=${XMLLINT_EXECUTABLE} \
 #       -DENCODING=xxx \
 #       -P "${TOP_SRC_DIR}/development/autotests/export.cmake"
 #
 
+message(STATUS "IgnoreErrorMessage = ${IgnoreErrorMessage}")
 set(Perl_Script "${TOP_SRC_DIR}/development/autotests/useSystemFonts.pl")
 set(Structure_Script 
"${TOP_SRC_DIR}/development/autotests/beginEndStructureCheck.pl")
 set(LanguageFile "${TOP_SRC_DIR}/lib/languages")
@@ -139,14 +141,20 @@ if (extension MATCHES "\\.lyx$")
   endforeach()
 else()
   if ($ENV{LYX_DEBUG_LATEX})
-    set(LatexDebugParam -dbg latex)
+    set(LyXExtraParams -dbg latex)
   else()
-    set(LatexDebugParam)
+    set(LyXExtraParams)
   endif()
-  message(STATUS "Executing ${lyx} ${LatexDebugParam} -userdir 
\"${LYX_TESTS_USERDIR}\" -E ${format} ${result_file_name} \"${LYX_SOURCE}\"")
+  if(IgnoreErrorMessage)
+    foreach (_em ${IgnoreErrorMessage})
+      list(APPEND LyXExtraParams --ignore-error-message ${_em})
+    endforeach()
+  endif()
+  string(REGEX REPLACE ";" " " _LyXExtraParams "${LyXExtraParams}")
+  message(STATUS "Executing ${lyx} ${_LyXExtraParams} -userdir 
\"${LYX_TESTS_USERDIR}\" -E ${format} ${result_file_name} \"${LYX_SOURCE}\"")
   file(REMOVE ${result_file_name})
   execute_process(
-    COMMAND ${lyx} ${LatexDebugParam} -userdir "${LYX_TESTS_USERDIR}" -E 
${format} ${result_file_name} "${LYX_SOURCE}"
+    COMMAND ${lyx} ${LyXExtraParams} -userdir "${LYX_TESTS_USERDIR}" -E 
${format} ${result_file_name} "${LYX_SOURCE}"
     RESULT_VARIABLE _err)
 
   #check if result file created
diff --git a/development/autotests/ignoreLatexErrorsTests 
b/development/autotests/ignoreLatexErrorsTests
new file mode 100644
index 0000000..42c36ba
--- /dev/null
+++ b/development/autotests/ignoreLatexErrorsTests
@@ -0,0 +1,2 @@
+Sublabel: missing_glyphs
+export/doc/UserGuide_(dvi3|pdf4|pdf5)_systemF

commit 96ffb70cd521f397a4ac0f9912e67506f99accf8
Author: Juergen Spitzmueller <[email protected]>
Date:   Wed Jan 11 09:21:13 2017 +0100

    Command line option to ignore error msgs
    
    Needed by the test framework

diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp
index c4f9870..9faf201 100644
--- a/src/LaTeX.cpp
+++ b/src/LaTeX.cpp
@@ -18,6 +18,7 @@
 #include "BufferList.h"
 #include "LaTeX.h"
 #include "LyXRC.h"
+#include "LyX.h"
 #include "DepTable.h"
 
 #include "support/debug.h"
@@ -899,8 +900,9 @@ int LaTeX::scanLogFile(TeXErrors & terr)
                                                 from_local8bit("pdfTeX Error"),
                                                 from_local8bit(token),
                                                 child_name);
-                       } else if (prefixIs(token, "Missing character: There is 
no ")
-                                          && !contains(token, "nullfont")) {
+                       } else if (!ignore_missing_glyphs
+                                  && prefixIs(token, "Missing character: There 
is no ")
+                                  && !contains(token, "nullfont")) {
                                // Warning about missing glyph in selected font
                                // may be dataloss (bug 9610)
                                // but can be ignored for 'nullfont' (bug 
10394).
diff --git a/src/LyX.cpp b/src/LyX.cpp
index b10b60b..259aeb6 100644
--- a/src/LyX.cpp
+++ b/src/LyX.cpp
@@ -98,6 +98,13 @@ bool use_gui = true;
 bool verbose = false;
 
 
+// Do not treat the "missing glyphs" warning of fontspec as an error message.
+// The default is false and can be changed with the option
+// --ignore-error-message missing_glyphs
+// This is used in automated testing.
+bool ignore_missing_glyphs = false;
+
+
 // We default to open documents in an already running instance, provided that
 // the lyxpipe has been setup. This can be overridden either on the command
 // line or through preference settings.
@@ -1161,6 +1168,10 @@ int parse_help(string const &, string const &, string &)
                  "                  specifying whether all files, main file 
only, or no files,\n"
                  "                  respectively, are to be overwritten during 
a batch export.\n"
                  "                  Anything else is equivalent to `all', but 
is not consumed.\n"
+                 "\t--ignore-error-message which\n"
+                 "                  allows you to ignore specific LaTeX error 
messages.\n"
+                 "                  Do not use for final documents! Currently 
supported values:\n"
+                  "                  * missing_glyphs: Fontspec `missing 
glyphs' error.\n"
                  "\t-n [--no-remote]\n"
                  "                  open documents in a new instance\n"
                  "\t-r [--remote]\n"
@@ -1309,6 +1320,16 @@ int parse_verbose(string const &, string const &, string 
&)
 }
 
 
+int parse_ignore_error_message(string const & arg1, string const &, string &)
+{
+       if (arg1 == "missing_glyphs") {
+               ignore_missing_glyphs = true;
+               return 1;
+       }
+       return 0;
+}
+
+
 int parse_force(string const & arg, string const &, string &)
 {
        if (arg == "all") {
@@ -1358,6 +1379,7 @@ void LyX::easyParse(int & argc, char * argv[])
        cmdmap["--remote"] = parse_remote;
        cmdmap["-v"] = parse_verbose;
        cmdmap["--verbose"] = parse_verbose;
+       cmdmap["--ignore-error-message"] = parse_ignore_error_message;
 
        for (int i = 1; i < argc; ++i) {
                map<string, cmd_helper>::const_iterator it
diff --git a/src/LyX.h b/src/LyX.h
index 4b9c201..11c67a3 100644
--- a/src/LyX.h
+++ b/src/LyX.h
@@ -52,6 +52,7 @@ enum OverwriteFiles {
 
 extern bool use_gui;
 extern bool verbose;
+extern bool ignore_missing_glyphs;
 extern RunMode run_mode;
 extern OverwriteFiles force_overwrite;
 

commit d221d1734a619dd1046b0588793683110c64f542
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Mon Jan 9 18:23:17 2017 +0100

    Fix display of empty box in nested macros
    
    The rewrite of nesting handling at 0f15dcc6 was incomplete: the
    macro nesting has to be reset to 0 when inside a macro argument at
    level 1.

diff --git a/src/mathed/MathMacro.cpp b/src/mathed/MathMacro.cpp
index 1311bc9..7670f48 100644
--- a/src/mathed/MathMacro.cpp
+++ b/src/mathed/MathMacro.cpp
@@ -82,7 +82,8 @@ public:
                // macro arguments are in macros
                LATTEST(mathMacro_->nesting() > 0);
                /// The macro nesting can change display of insets. Change it 
locally.
-               Changer chg = make_change(mi.base.macro_nesting, 
mathMacro_->nesting());
+               Changer chg = make_change(mi.base.macro_nesting,
+                                         mathMacro_->nesting() == 1 ? 0 : 
mathMacro_->nesting());
 
                MathRow::Element e_beg(MathRow::BEG_ARG);
                e_beg.macro = mathMacro_;

-----------------------------------------------------------------------

Summary of changes:
 development/autotests/ExportTests.cmake      |   22 +++-
 development/autotests/export.cmake           |   16 ++-
 development/autotests/ignoreLatexErrorsTests |    2 +
 lib/configure.py                             |  168 +++++++++++++++-----------
 lib/doc/Development.lyx                      |    2 +-
 src/LaTeX.cpp                                |    6 +-
 src/LyX.cpp                                  |   22 ++++
 src/LyX.h                                    |    1 +
 src/mathed/MathMacro.cpp                     |    3 +-
 9 files changed, 159 insertions(+), 83 deletions(-)
 create mode 100644 development/autotests/ignoreLatexErrorsTests


hooks/post-receive
-- 
Repository for new features

Reply via email to