Am 18.01.2011 um 14:59 schrieb Vincent van Ravesteijn:

>> To make a portable LyX you need a proper working replaceEnvironmentPath().
>> (I.e. $LyXDir/component1/bin:$LyXDir/component2/bin in path_prefix must be
>> translated to /path/to/lyx/component1/bin:/path/to/lyx/component2/bin).
>> 
>> To fix this I effectively have to revert your change set
>> http://www.lyx.org/trac/changeset/29587
>> 
> 
> 
> The only thing I did is to not replace anything, when there is no
> proper replacement. That is what you call, put back the verbatim
> value.

Unfortunately it's not the only thing you did.
You introduced the regression that only the last occurrence of
a variable gets replaced. Your assumption was that boost returns
the first match - it's the last one instead!

$LyXDir/component1/bin:$LyXDir/component2/bin =>
$LyXDir/component1/bin:/path/to/lyx/component2/bin

> What is the problem with this approach?

Any shell I know of (and the feature is inspired by unix-shells) and
make too either silently replaces unknown variables with the empty string
or raises an error. To copy the variable name is unusual, I'd say.

> Apparently, $LyXDir is a
> valid variable name, which can  be replaced/expanded, so we do it. If
> we encounter a variable name that is not valid, we don't do anything.

But the goal was to avoid the replacement of a real $ in a file name.
This goal is missed if the user passes a file name with a real $ followed
by an existing variable name. Then the bug is there again.

Stephan

Reply via email to