Paul A. Rubin wrote:

> [posted and mailed]
> 
> Angus Leeming <[EMAIL PROTECTED]> wrote in
> news:[EMAIL PROTECTED]:
> 
>> 
>> You say that, if you run convertDefault.sh 'by hand', it works
>> perfectly?
> 
> Yes
>> Could you try again with this new version, dumping output
>> to a LyX temp directory.
>> 
>> In fact, since file names like C:/foo/bar/file.xyz are clearly
>> dodgy on Win32, please try the attached script which will change
>> them to C:\foo\bar\file.xyz
> 
> Here's the output (run by hand):
> 
> 
> 
>> C:\LyX\lyx\bin>sh ../share/lyx/scripts/convertdefault.sh
> jpg:C:/LyX/Documents/ha
>> ppy.jpg ppm:C:/LyX/lyx/tmp/lyx_tmpdir604a01532/happy.ppm
>> ../share/lyx/scripts/convertdefault.sh invoked as:
>> jpg:C:/LyX/Documents/happy.jpg
> ppm:C:/LyX/lyx/tmp/lyx_tmpdir604a01532/happy.ppm
>> $arg1 is jpg:C:\LyX\Documents\happy.jpg
>> $arg2 is ppm:C:\LyX\lyx\tmp\lyx_tmpdir604a01532\happy.ppm
>> ../share/lyx/scripts/convertdefault.sh ERROR
>> Unable to find file "C:\LyX\lyx\tmp\lyx_tmpdir604a01532\happy.ppm"
> 
> The target file happy.ppm was created and is in fact sitting in the
> temp directory when the "Unable to find ..." message is generated.
> The path and file name are correct.

Good. So we have probably nailed down the problem. The file is 
generated correctly but LyX itself is unable to understand this 
'mixed language' file name 'C:/foo/bar.ppm'.

The proper fix will almost certainly be to tell LyX that the file name 
is of the form 'C:\foo\bar.ppm. It should be able to find that well 
enough.

> I poked around with the script myself over the weekend, and may have
> come up with at least a partial answer.

Yes, I have come to this conclusion myself and have changed the script 
appropriately. The relevant line is now
FILE=`echo $arg2 | sed 's,^[^:]*:,,'`

which cuts off anything up to and including the first ':'.

In the long run it may be easier to change the language and use 
python.

> Disclaimer here:  I grew up in the PC world and speak very limited
> amounts of Unix.  Someone who actually understands sh should check
> this over.

Well, I'll hold your hand in the unix world if you hold mine in the pc 
one ;-)

I'll try and fix the real problem which lies in the LyX sources.

Many thanks for your detective work.
-- 
Angus

Reply via email to