summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormstsirkin <mstsirkin@0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652>2014-01-12 11:03:18 +0000
committermstsirkin <mstsirkin@0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652>2014-01-12 11:03:18 +0000
commit59bc2cdaed84e9e323358845e83aba1a3a006e38 (patch)
tree7772041544fca6debefede931247455aa2350198
parent36937d05753be9ea5af6e7888b039e8f16594239 (diff)
makehtml.sh: drop workaround, add warning
Issues in html generation turn out to be due to tex4ht being unable to find fonts due to misconfigured font paths. As we are unable to work-around them properly anyway replace work-around with a warning and print suggestions for fixing the config. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@182 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
-rwxr-xr-xmakehtml.sh26
1 files changed, 19 insertions, 7 deletions
diff --git a/makehtml.sh b/makehtml.sh
index 2ca387b..cad297c 100755
--- a/makehtml.sh
+++ b/makehtml.sh
@@ -19,17 +19,29 @@ sed 's/>~/>"/g' $SPECDOC.tmp2 >$SPECDOC.tmp3
sed 's/>=~/>="/g' $SPECDOC.tmp3 >$SPECDOC.tmp4
sed 's/~</"</g' $SPECDOC.tmp4 >$SPECDOC.tmp5
-#For some unclear reason we get 'fi' replaced by NULL character
-# on Fedora. file recognizes result as a binary data.
-# Detect and work around this.
+# If font paths are misconfigured, we get ligatures
+# (such as 'ff or 'fi') replaced by NULL character in output.
+# This in not a valid HTML output, so detect this and warn user.
+# For detection, we rely on the fact that file utility
+# recognizes files with NULL characters as binary data.
if test `file -b $SPECDOC.tmp5` = 'data';
then
- perl -p -e 's/\0/fi/g' $SPECDOC.tmp5 >$SPECDOC.tmp6
-else
- cp $SPECDOC.tmp5 $SPECDOC.tmp6
+ echo
+ echo WARNING!
+ echo
+ echo NULL characters detected in file output.
+ echo This is likely due to tex4ht being unable to find font files.
+ echo If installed, you might need to fix font file paths
+ echo for tex4ht by locating tex4ht.env file in your setup
+ echo correcting font file paths there and copying it to
+ echo tex4ht.env or .tex4ht in your home directory.
+ echo
+ echo WARNING!
+ echo Proceeding but HTML output appears to be malformed.
+ echo
fi
-mv $SPECDOC.tmp6 $SPECDOC.html
+mv $SPECDOC.tmp5 $SPECDOC.html
rm $SPECDOC.tmp*
#uncomment if you have a broken t4ht