On Fri, Aug 2, 2013 at 12:00 PM, Stephan Witt <st.w...@gmx.net> wrote:

>
> > >
> > > With your patch we look for the 'tex2lyx' binary in the directory
> <lyx_binary_dir>/tex2lyx. My latest change made it possible to also look in
> <lyx_binary_dir>.
> >
> > Because of the variable naming I didn't got it.
> >
> > >  This was needed for CMake builds and is no longer possible now.
> >
> > Ok, so this updated patch is correct then?
> >
> > Stephan
> >
> >
> > No, because checkProg writes an entry with addToRC and it omits the path
> itself (as it probably assumes that it is in the "PATH" environment
> variable). So, our customly supplied path is lost.
>
> So, then our customly supplied path has to be added to PATH by LyX too


I'd rather do something like the following:

{{{
env_path = os.environ["PATH"]

....

for ac_dir in path + env_path:
...
    if ac_dir in path:
       addToRC(rc_entry[0].replace('%%', os.path.join(path, ac_prog))
    else
        addToRC(rc_entry[0].replace('%%', ac_prog)
 ...
}}}

This alters the behaviour of this function, but I don't seem to be able to
find a case where we actually use this path variable, so it might be safe
to do this. If you do so, please check whether it was actually used or not.

Vincent

Reply via email to