Currently lib/configure fails to find tex2lyx if the path to it contains
spaces. These patches fix that. Assuming that you're happy with them,
please apply to both the 14x and 15x branches.
Paul Rubin notes that running configure from within LyX can actually fail
to find tex2lyx unless the script is passed --with-version-suffix. That's a
separate bug and I've asked Paul to file it on bugzilla.
Regards,
Angus
Index: lib/configure.m4
===================================================================
--- lib/configure.m4 (revision 13704)
+++ lib/configure.m4 (working copy)
@@ -260,7 +260,11 @@
SEARCH_PROG([for a text editor], TEXT_EDITOR, xemacs gvim kedit kwrite kate
nedit gedit notepad)
# Search for an installed tex2lyx or a ready-to-install one
-SEARCH_PROG([for a LaTeX -> LyX converter],tex_to_lyx_command,
"$PWD/../src/tex2lyx/tex2lyx -f \$\$i \$\$o" "tex2lyx$version_suffix -f \$\$i
\$\$o")
+PATH_ORIG="$PATH"
+PATH="$PWD/../src/tex2lyx:$PATH"
+SEARCH_PROG([for a LaTeX -> LyX converter],tex_to_lyx_command, 'tex2lyx -f $$i
$$o' 'tex2lyx'"$version_suffix"' -f $$i $$o')
+PATH="$PATH_ORIG"
+unset PATH_ORIG
SEARCH_PROG([for a Noweb -> LyX converter],literate_to_lyx_command,"noweb2lyx
\$\$i \$\$o")
literate_to_lyx_command=`echo $literate_to_lyx_command | sed
"s,noweb2lyx,noweb2lyx$version_suffix,"`
Index: configure.py
===================================================================
--- configure.py (revision 13704)
+++ configure.py (working copy)
@@ -266,10 +266,22 @@
''' 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 "%%" ""' ])