aboutsummaryrefslogtreecommitdiff
path: root/doc/asciidoc-helper.sh
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-03-04 23:30:53 -0500
committerNick Mathewson <nickm@torproject.org>2010-03-04 23:30:53 -0500
commit871974876757f40be7d8056a3f457f0eae2398d9 (patch)
treef1dcf6fe48cc828aaf561f51179d31233c91b77c /doc/asciidoc-helper.sh
parenteb2e56ad3c469eeee38b63902361e86585da8c7c (diff)
parent4db5e7ae7698393552c34d2c28180bbefa87fd62 (diff)
downloadtor-871974876757f40be7d8056a3f457f0eae2398d9.tar
tor-871974876757f40be7d8056a3f457f0eae2398d9.tar.gz
Merge commit 'sebastian/manpage'
Diffstat (limited to 'doc/asciidoc-helper.sh')
-rwxr-xr-xdoc/asciidoc-helper.sh47
1 files changed, 15 insertions, 32 deletions
diff --git a/doc/asciidoc-helper.sh b/doc/asciidoc-helper.sh
index 90a003d49..d24b31918 100755
--- a/doc/asciidoc-helper.sh
+++ b/doc/asciidoc-helper.sh
@@ -4,51 +4,34 @@
# See LICENSE for licensing information
# Run this to generate .html.in or .1.in files from asciidoc files.
# Arguments:
-# html|man asciidocpath sedpath outputfile
+# html|man asciidocpath outputfile
set -e
-if [ $# != 4 ]; then
+if [ $# != 3 ]; then
exit 1;
fi
-output=$4
-input=`echo $output | $3 -e 's/html\.in$/1\.txt/g' -e 's/1\.in$/1\.txt/g'`
-base=`echo $output | $3 -e 's/\.html\.in$//g' -e 's/\.1\.in$//g'`
+output=$3
if [ "$1" = "html" ]; then
- if [ "$2" != none ]; then
- "$2" -d manpage -o $output $input;
- else
- echo "==================================";
- echo;
- echo "The manpage in html form for $base will ";
- echo "NOT be available, because asciidoc doesn't appear to be ";
- echo "installed!";
- echo;
- echo "==================================";
- fi
+ input=${output%%.html.in}.1.txt
+ base=${output%%.html.in}
+ "$2" -d manpage -o $output $input;
elif [ "$1" = "man" ]; then
- if test "$2" != none; then
- if $2 -f manpage $input; then
- mv $base.1 $output;
- else
- echo "==================================";
- echo;
- echo "a2x is installed, but some required docbook support files are";
- echo "missing. Please install docbook-xsl and docbook-xml (Debian)";
- echo "or similar.";
- echo;
- echo "==================================";
- fi;
+ input=${output%%.1.in}.1.txt
+ base=${output%%.1.in}
+
+ if "$2" -f manpage $input; then
+ mv $base.1 $output;
else
echo "==================================";
echo;
- echo "The manpage for $base will NOT be ";
- echo "available, because a2x doesn't appear to be installed!";
+ echo "a2x is installed, but some required docbook support files are";
+ echo "missing. Please install docbook-xsl and docbook-xml (Debian)";
+ echo "or similar.";
echo;
echo "==================================";
+ exit 1;
fi
fi
-
-touch $output; \