]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Simplify asciidoc-helper
authorSebastian Hahn <sebastian@torproject.org>
Sat, 27 Feb 2010 16:06:06 +0000 (17:06 +0100)
committerSebastian Hahn <sebastian@torproject.org>
Mon, 1 Mar 2010 03:07:55 +0000 (04:07 +0100)
We don't need sed for our string manipulation, so let's get rid of
it. Suggested by weasel.

ChangeLog
doc/Makefile.am
doc/asciidoc-helper.sh

index 7ee0ebec96b38d258ea98bd0ee72aca08ce44216..4b291047a64c2586ddda4402275fe1e39fb8c0d5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -30,7 +30,7 @@ Changes in version 0.2.2.10-alpha - 2010-??-??
   o Code simplifications and refactoring:
     - Fix some urls in the exit notice file and make it XHTML1.1 strict
       compliant. Based on a patch from Christian Kujau.
-
+    - Don't use sed in asciidoc-helper anymore.
 
 Changes in version 0.2.2.9-alpha - 2010-02-22
   o Directory authority changes:
index cccc94823d71bdc8e9a3421e75ead5ce5e4c7e0a..dbc44f0fbf946ef7bed8205985dc238bbaf7e417 100644 (file)
@@ -39,7 +39,7 @@ DIST_SUBDIRS = spec
 # Generate the html documentation from asciidoc, but don't do
 # machine-specific replacements yet
 $(html_in) :
-       $(top_srcdir)/doc/asciidoc-helper.sh html @ASCIIDOC@ @SED@ $(top_srcdir)/doc/$@
+       $(top_srcdir)/doc/asciidoc-helper.sh html @ASCIIDOC@ $(top_srcdir)/doc/$@
 
 tor.html.in : tor.1.txt
 torify.html.in : torify.1.txt
@@ -49,7 +49,7 @@ tor-resolve.html.in : tor-resolve.1.txt
 # Generate the manpage from asciidoc, but don't do
 # machine-specific replacements yet
 $(man_in) :
-       $(top_srcdir)/doc/asciidoc-helper.sh man @A2X@ @SED@ $(top_srcdir)/doc/$@
+       $(top_srcdir)/doc/asciidoc-helper.sh man @A2X@ $(top_srcdir)/doc/$@
 
 tor.1.in : tor.1.txt
 torify.1.in : torify.1.txt
index 90a003d496f485997c8be6238ca1cc3cfa65722e..25b438cd8188b379e28ddcca913efc2a8fa5376f 100755 (executable)
@@ -4,19 +4,19 @@
 # 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
+    input=${output%%.html.in}.1.txt
+    base=${output%%.html.in}
     if [ "$2" != none ]; then
       "$2" -d manpage -o $output $input;
     else
@@ -29,6 +29,9 @@ if [ "$1" = "html" ]; then
       echo "==================================";
     fi
 elif [ "$1" = "man" ]; then
+    input=${output%%.1.in}.1.txt
+    base=${output%%.1.in}
+    
     if test "$2" != none; then
       if $2 -f manpage $input; then
         mv $base.1 $output;