cgal/Maintenance/rpm/SOURCES/CGAL_manual_tools-latex_to_...

41 lines
1.5 KiB
Diff

Index: src/latex_to_html
===================================================================
--- src/latex_to_html (revision 30268)
+++ src/latex_to_html (working copy)
@@ -302,6 +302,7 @@
ExitCode=0
cmd=${@//(/\\(};
cmd=${cmd//)/\\)};
+ echo "$cmd"
if [ $Quiet -eq 0 ] ; then
{
if ! eval "$cmd" 2>&1 ; then
@@ -529,11 +530,15 @@
ImageFiles=`\cat *.html | cc_extract_images | \sort | \uniq`
for f in $ImageFiles ; do
+ f=`echo $f| sed -e 's|\./||'`
ImageSearchPath="."
if [ ! -r ${CurrentDir}/${dir}/${f} ]; then
ImageSearchPath="`find_in_search_path ${dir}/${f} ${LATEX_CONV_INPUTS}`"
fi
- if [ -r ${CurrentDir}/${ImageSearchPath}/${dir}/${f} ]; then
+ ImageFullPath=${CurrentDir}/${ImageSearchPath}/${dir}/${f}
+ [ -r "$ImageFullPath" ] ||
+ ImageFullPath=`kpsewhich $f`
+ if [ -r "$ImageFullPath" ] ; then
ImageBase=${f##*/}
# relative path, can be empty. If not empty, trailing '/'.
ImagePath=${f%$ImageBase}
@@ -543,7 +548,9 @@
error noexit "failed to create directory for image '$f'."
fi
fi
- \cp ${CurrentDir}/${ImageSearchPath}/${dir}/${f} ${f}
+ if [ ! -r $f ]; then
+ \cp $ImageFullPath ${f}
+ fi
else
error noexit "image file '${CurrentDir}/${dir}/${f}' not found."
fi