Rob S wrote:
> But moving on---
> 
> I cannot now view .pdf images in 1.3.5 under windoze
> I'm seeing a
> convertDefault.sh Error
> The script cannot find the ppm file in the temp dir
> 
> any ideas?

Yes. See this from Enrico Forestieri

http://article.gmane.org/gmane.editors.lyx.general:19523

=======================================================================
> - The convertDefault.sh script doesn't work again, it always fails
> when testing for converted file existance. I had to comment those
> lines out in order to get the figures to display in LyX

This is due to a nasty feature of the shell sh.exe included in the package.
If you installed lyx in C:/Programs/lyx, then any path of the form
C:/Programs/lyx/tmp/anything  gets translated to %TEMP%/anything, where
%TEMP% is the windows temporary files location. To test this, try opening a
dos terminal and launching sh.exe, then try "cd C:/Programs/lyx/tmp" and
see
where you end up....

I have also Cygwin installed and noticed that if using cygwin pathnames
this
does not occur, i.e., "cd /c/Programs/lyx/tmp" works (I mounted /c on C:
under
cygwin). For those with Cygwin, this patch works:

$ diff -u convertDefault.sh.orig convertDefault.sh
--- convertDefault.sh.orig      2005-01-03 17:40:30.000000000 +0100
+++ convertDefault.sh   2005-01-05 19:00:14.000000000 +0100
@@ -28,7 +28,13 @@
 # so use everything from the first ':' to the end of the line.
 FILE=`echo "$2" | cut -d ':' -f 2-`

-test -f "$FILE" || {
+# The shell sh.exe distributed with LyX behaves strangely:
+# The references to $INSTDIR/tmp get translated to $TEMP if $INSTDIR is of
+# the type "C:/xyz", but not translated if it is a cygwin path like
"/c/xyz".
+# Hence, $FILE would not be found because it is searched in the wrong
place!
+CYGFILE=`cygpath $FILE`
+
+test -f "$CYGFILE" || {
        echo "$0 ERROR"
        echo "Unable to find file \"${FILE}\""
        exit 1


This "feature" of sh.exe was also responsible for the failure of the old
script lyxpreview2bitmap.sh, used for instant preview.
=======================================================================

I believe that the solution for you is to remove all of the diagnostics at
the end of convertDefault.sh. Ie, just cut out this:

# It appears that convert succeeded, but we know better than to trust
it ;-)
# convert is passed strings in the form "FMT:FILENAME", so use the ':' to
# delimit the two parts.
# Note that Win32 filenames have the form 'C:\my\file',
# so use everything from the first ':' to the end of the line.
FILE=`echo "$2" | cut -d ':' -f 2-`

test -f "$FILE" || {
        echo "$0 ERROR"
        echo "Unable to find file \"${FILE}\""
        exit 1
}

echo "$0 generated file \"${FILE}\" successfully."



-- 
Angus

Reply via email to