Bennett Helm wrote:

> With recent versions of lyx-1.3.6 (but not 1.4.0), the PATH environment
> is not set up properly. There are two problems:
> 
> 1. It looks as though /usr/bin and /usr/local/bin are not properly
> added, so attempting to run the configure script or view files results
> in errors like the following:
> 
> sh: line 1: sh: No such file or directory
> sh: line 1: pplatex: No such file or directory
> sh: line 1: dvipdfm: No such file or directory
> sh: line 1: latex2html: No such file or directory
> sh: line 1: dvips: No such file or directory
> sh: line 1: open: No such file or directory
> 
> 
> 2. It looks like now users must manually enter the path to their TeX
> installation in the preference dialog. It would be nice to package LyX
> so that this was not necessary.

Sure. But the packaging is a secondary step. Let's get the core
functionality working first.

Here I have an entry in my .lyx-1.3.6cvs/preferences file:
\path_prefix "/foo/bar"
(Input using the Preferences dialog, save, exit lyx, restart.)

The relevant block of code in src/lyx_main.C is:

    if (!lyxrc.path_prefix.empty())
        prependEnvPath("PATH", lyxrc.path_prefix);

    // Having reset the PATH we're now in a position to run configure
    // if necessary.
    if (reconfigure)
        reconfigureUserLyXDir();

So, I can't see why things don't work for you. Attached is a simple patch
to output some diagnostic info. Please update your 1.3.x tree and then
apply the patch from the top level src dir as:

$ patch -p0 < diagnostics.diff

Here it results in output to the console:

lyxrc.path_prefix is /foo/bar
Env var "PATH",
"/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/angus/bin",
is prepended with "/foo/bar"
        result: 
/foo/bar:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/angus/bin

> So, is it possible to define a PATH and pass this to LyX without having
> LyX overwrite it?
> 
> Thanks.
> 
> Bennett

-- 
Angus
Index: src/lyx_main.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_main.C,v
retrieving revision 1.134.2.13
diff -u -p -r1.134.2.13 lyx_main.C
--- src/lyx_main.C	13 Feb 2005 17:12:31 -0000	1.134.2.13
+++ src/lyx_main.C	13 Feb 2005 17:16:58 -0000
@@ -361,6 +361,7 @@ void LyX::init(bool gui)
 		lyxrc.print();
 	}
 
+	lyxerr << "lyxrc.path_prefix is " << lyxrc.path_prefix << std::endl;
 	if (!lyxrc.path_prefix.empty())
 		prependEnvPath("PATH", lyxrc.path_prefix);
 
Index: src/support/filetools.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/support/filetools.C,v
retrieving revision 1.146.2.14
diff -u -p -r1.146.2.14 filetools.C
--- src/support/filetools.C	2 Feb 2005 12:58:06 -0000	1.146.2.14
+++ src/support/filetools.C	13 Feb 2005 17:17:00 -0000
@@ -427,6 +427,8 @@ void setEnvPath(string const & name, vec
 
 void prependEnvPath(string const & name, string const & prefix)
 {
+	lyxerr << "Env var \"" << name << "\", \"" << GetEnv(name)
+	       << "\", is prepended with \"" << prefix << "\"\n";
 	vector<string> env_var = getEnvPath(name);
 
 	typedef boost::char_separator<char> Separator;
@@ -450,6 +452,7 @@ void prependEnvPath(string const & name,
 	}
 
 	setEnvPath(name, env_var);
+	lyxerr << "\tresult: " << GetEnv(name) << std::endl;
 }
 
 

Reply via email to