]> git.lyx.org Git - features.git/commitdiff
* configure.py : Fix the detection of tex2lyx when running in-place (#6986).
authorJulien Rioux <jrioux@lyx.org>
Wed, 7 Sep 2011 23:59:23 +0000 (23:59 +0000)
committerJulien Rioux <jrioux@lyx.org>
Wed, 7 Sep 2011 23:59:23 +0000 (23:59 +0000)
Remove the hack with os.environ and instead directly search for
../src/tex2lyx/tex2lyx relative to where configure.py is found.

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

lib/configure.py

index 3dde90d6f84177d82da74b2ff7c9e30faa552360..0204d8bbc5af99155df3737a4ca1b05c0d6b8295 100644 (file)
@@ -617,24 +617,21 @@ def checkConverterEntries(java='', perl=''):
 
     checkLuatex()
 
-    ''' 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
-
-# First search for tex2lyx with version suffix (bug 6986)
-    path, t2l = checkProg('a LaTeX/Noweb -> LyX converter', ['tex2lyx' + version_suffix, 'tex2lyx'],
+    # Look for tex2lyx in this order (see bugs #3308 and #6986):
+    #   1)  If we're running LyX in-place then tex2lyx will be found
+    #       in ../src/tex2lyx with respect to the srcdir.
+    #   2)  If LyX was configured with a version suffix then tex2lyx
+    #       will also have this version suffix.
+    #   3)  Otherwise always use tex2lyx.
+    in_place = os.path.join('srcdir', '..', 'src', 'tex2lyx', 'tex2lyx')
+    in_place = os.path.abspath(in_place)
+
+    path, t2l = checkProg('a LaTeX/Noweb -> LyX converter', [in_place, 'tex2lyx' + version_suffix, 'tex2lyx'],
         rc_entry = [r'''\converter latex      lyx        "%% -f $$i $$o"       ""
 \converter literate   lyx        "%% -n -f $$i $$o"    ""'''], not_found = 'tex2lyx')
     if path == '':
         logger.warning("Failed to find tex2lyx on your system.")
 
-    os.environ["PATH"] = path_orig
-
     #
     checkProg('a Noweb -> LaTeX converter', ['noweave -delay -index $$i > $$o'],
         rc_entry = [r'''\converter literate   latex      "%%"  ""