]> git.lyx.org Git - features.git/commitdiff
From Angus:
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Fri, 21 Apr 2006 15:15:55 +0000 (15:15 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Fri, 21 Apr 2006 15:15:55 +0000 (15:15 +0000)
Enable lib/configure.py to find tex2lyx if the path to it contains spaces.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13708 a592a061-630c-0410-9148-cb99ea01b6c8

lib/configure.py

index 85d0a7ed7b34fe8c314d33cd180b00934a3e5505..b96bf8b394da82247cbc69af7f0181ed6bc21c63 100644 (file)
@@ -266,10 +266,22 @@ def checkConverterEntries():
   ''' Check all converters (\converter entries) '''
   checkProg('the pdflatex program', ['pdflatex $$i'],
     rc_entry = [ r'\converter pdflatex   pdf2       "%%"       "latex"' ])
-  #
-  checkProg('a LaTeX -> LyX converter', [os.path.join('..','src','tex2lyx','tex2lyx') + ' -f $$i $$o', \
+  
+  ''' If we're running LyX in-place then tex2lyx will be found in
+      ../src/tex2lyx. Add this directory to the PATH temporarily and
+      search for tex2lyx.
+      Use PATH to avoid any problems with paths-with-spaces.
+  '''
+  path_orig = os.environ["PATH"]
+  os.environ["PATH"] = os.path.join('..','src','tex2lyx') + \
+    os.pathsep + path_orig
+
+  checkProg('a LaTeX -> LyX converter', ['tex2lyx -f $$i $$o', \
     'tex2lyx' +  version_suffix + ' -f $$i $$o' ],
     rc_entry = [ r'\converter latex      lyx        "%%"       ""' ])
+
+  os.environ["PATH"] = path_orig
+
   #
   checkProg('a Noweb -> LyX converter', ['noweb2lyx' + version_suffix + ' $$i $$o'], path = ['./reLyX'],
     rc_entry = [ r'\converter literate   lyx        "%%"       ""' ])