From 5891c139dadeb642ca8eaa6915fca34d14bbbbe8 Mon Sep 17 00:00:00 2001 From: Julien Rioux Date: Wed, 7 Sep 2011 23:59:23 +0000 Subject: [PATCH] * configure.py : Fix the detection of tex2lyx when running in-place (#6986). 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 | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/lib/configure.py b/lib/configure.py index 3dde90d6f8..0204d8bbc5 100644 --- a/lib/configure.py +++ b/lib/configure.py @@ -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 "%%" "" -- 2.39.2