X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=podwrapper.sh.in;h=c883c6a8c811e360dd17addbdd0fef8a56d19865;hp=bd7100593f83e8698883db61d7f4ceb1d138dfcc;hb=6cabc1cd02e181063596b48df55c3f6db51a6bb9;hpb=d71faf98624c1fb2c760e0e9f55205beb06b7644 diff --git a/podwrapper.sh.in b/podwrapper.sh.in index bd71005..c883c6a 100755 --- a/podwrapper.sh.in +++ b/podwrapper.sh.in @@ -1,6 +1,6 @@ #!/bin/bash - # podwrapper.sh -# Copyright (C) 2010 Red Hat Inc. +# Copyright (C) 2010-2011 Red Hat Inc. # @configure_input@ # # This program is free software; you can redistribute it and/or modify @@ -30,6 +30,8 @@ PACKAGE_VERSION="@PACKAGE_VERSION@" POD2MAN="@POD2MAN@" POD2TEXT="@POD2TEXT@" POD2HTML="@POD2HTML@" +POD2_STDERR_OPTION="@POD2_STDERR_OPTION@" +POD2_UTF8_OPTION="@POD2_UTF8_OPTION@" # This script could be run with any current directory, so if a source # or build path is required it must be relative to the following @@ -164,7 +166,7 @@ fi # Now generate the final output format(s). if [ -n "$man_output" ]; then - "$POD2MAN" --stderr -u \ + "$POD2MAN" "$POD2_STDERR_OPTION" "$POD2_UTF8_OPTION" \ --section "$section" -c "Virtualization Support" --name "$name" \ --release "$PACKAGE_NAME-$PACKAGE_VERSION" \ < $tmpdir/full.pod > "$man_output".tmp @@ -172,7 +174,7 @@ if [ -n "$man_output" ]; then fi if [ -n "$text_output" ]; then - "$POD2TEXT" --stderr -u \ + "$POD2TEXT" "$POD2_STDERR_OPTION" "$POD2_UTF8_OPTION" \ < $tmpdir/full.pod > "$text_output".tmp mv "$text_output".tmp "$text_output" fi @@ -182,4 +184,23 @@ if [ -n "$html_output" ]; then --css "pod.css" --htmldir "$abs_top_builddir/html" \ < $tmpdir/full.pod > "$html_output".tmp mv "$html_output".tmp "$html_output" + + # Fix up some of the mess in the HTML output, mainly to make links + # between man pages work properly. + + # Rewrite manpage(n) to manpage(n) if + # there is a linkable manual page. + sed_cmd="sed" + for f in $(cd "$abs_top_builddir/html" && ls -1 *.html); do + b=$(basename $f .html) + m=$(echo $b | sed 's/\(.*\)\.\([1-9]\)$/\1(\2)/') + sed_cmd="$sed_cmd -e 's,$m,$m,g'" + done + echo $sed_cmd + eval $sed_cmd < "$html_output" > "$html_output".tmp + mv "$html_output".tmp "$html_output" + + # Fix links like L + sed 's,guestfs-\1(\([1-9]\)),guestfs-\1(\2),g' < "$html_output" > "$html_output".tmp + mv "$html_output".tmp "$html_output" fi