]> git.lyx.org Git - lyx.git/commitdiff
lib/configure.py: fix CheckTexPaths
authorBo Peng <bpeng@lyx.org>
Sat, 8 Jul 2006 02:50:24 +0000 (02:50 +0000)
committerBo Peng <bpeng@lyx.org>
Sat, 8 Jul 2006 02:50:24 +0000 (02:50 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14370 a592a061-630c-0410-9148-cb99ea01b6c8

lib/configure.py

index 2aea8c017a8e5ac714eba426fc838d1dbcd9dd1e..8e1502388c0f0b18a0ca2a4b6b89db69fda31de9 100644 (file)
@@ -84,30 +84,21 @@ def checkTeXPaths():
     if os.name == 'nt' or sys.platform == 'cygwin':
         from tempfile import mkstemp
         fd, tmpfname = mkstemp(suffix='.ltx')
-        # a wrapper file
-        wfd, wtmpfname = mkstemp(suffix='.ltx')
         if os.name == 'nt':
             inpname = tmpfname.replace('\\', '/')
-            wtmpfname = wtmpfname.replace('\\', '/')
         else:
             inpname = cmdOutput('cygpath -m ' + tmpfname)
-            wtmpfname = cmdOutput('cygpath -m ' + wtmpfname)
-        os.write(fd, r'''
-\relax
-    ''')
+        inpname = inpname.replace('~', '\\string~')
+        os.write(fd, r'\relax')
         os.close(fd)
-        os.write(wfd, r'\nonstopmode\input{' + inpname.replace('~', '\\string~') + '}' )
-        os.close(wfd)
-        if cmdOutput('latex ' + wtmpfname).find('Error') != -1:
+        latex_out = cmdOutput(r'latex "\nonstopmode\input{%s}"' % inpname)
+        if 'Error' in latex_out:
             print "configure: TeX engine needs posix-style paths in latex files"
             windows_style_tex_paths = 'false'
         else:
             print "configure: TeX engine needs windows-style paths in latex files"
             windows_style_tex_paths = 'true'
-        tmpbname,ext = os.path.splitext(os.path.basename(tmpfname))
-        wtmpbname,ext = os.path.splitext(os.path.basename(wtmpfname))
-        removeFiles( [ tmpfname, wtmpfname, tmpbname + '.log', \
-           tmpbname + '.aux', wtmpbname + '.log', wtmpbname + '.aux' ] )
+        removeFiles([tmpfname, 'texput.log'])
     return windows_style_tex_paths