Lines 1-61
Link Here
|
1 |
--- a2x.orig 2009-07-23 18:51:01.485493322 +0200 |
|
|
2 |
+++ a2x 2009-07-23 18:52:01.107211768 +0200 |
3 |
@@ -9,11 +9,12 @@ |
4 |
|
5 |
VERSION=1.0.0 |
6 |
BASENAME=$(basename "$0") |
7 |
+GETOPT=%%PREFIX%%/bin/getopt |
8 |
REALNAME="$0" |
9 |
if [ ! -e "$REALNAME" ]; then |
10 |
REALNAME=$(which "$REALNAME") |
11 |
fi |
12 |
-REALNAME="$(readlink -f "$REALNAME")" |
13 |
+REALNAME="$(/bin/realpath "$REALNAME")" |
14 |
CONF_DIR=/etc/asciidoc |
15 |
# FOP executable is named fop on some systems. |
16 |
FOP_COMMAND="fop.sh" |
17 |
@@ -244,14 +245,14 @@ |
18 |
if [ -z "$*" ]; then |
19 |
help; exit 0 |
20 |
fi |
21 |
- require "getopt" |
22 |
- getopt -T >/dev/null |
23 |
+ require "$GETOPT" |
24 |
+ $GETOPT -T >/dev/null |
25 |
if [ $? -ne 4 ]; then |
26 |
quit "enhanced getopt(1) required" |
27 |
fi |
28 |
short_opts="a:d:D:f:hLnsv" |
29 |
long_opts="attribute:,asciidoc-opts:,destination-dir:,doctype:,help,icons-dir:,dry-run,format:,copy,icons,skip-asciidoc,stylesheet:,unsafe,version,verbose,xsltproc-opts:,dblatex-opts:,fop,fop-opts:,no-xmllint" |
30 |
- args=$(getopt -o $short_opts -l $long_opts -n $BASENAME -- "$@" 2>/dev/null) |
31 |
+ args=$($GETOPT -o $short_opts -l $long_opts -n $BASENAME -- "$@" 2>/dev/null) |
32 |
if [ $? -ne 0 ]; then |
33 |
quit "invalid command options, run: a2x --help" |
34 |
fi |
35 |
@@ -494,7 +495,7 @@ |
36 |
quit "file not found: $xsl" |
37 |
fi |
38 |
to_docbook |
39 |
- xml=$(readlink -f "$SRC_DIR/$SRC_NAME.xml") |
40 |
+ xml=$(/bin/realpath "$SRC_DIR/$SRC_NAME.xml") |
41 |
html="$SRC_NAME.html" |
42 |
copy_stylesheet_and_icons "$DESTINATION_DIR" |
43 |
execute_command_2 "cd \"$DESTINATION_DIR\"" |
44 |
@@ -527,7 +528,7 @@ |
45 |
quit "file not found: $xsl" |
46 |
fi |
47 |
to_docbook |
48 |
- xml=$(readlink -f "$SRC_DIR/$SRC_NAME.xml") |
49 |
+ xml=$(/bin/realpath "$SRC_DIR/$SRC_NAME.xml") |
50 |
if [ ! -d "$chunkdir" ]; then |
51 |
execute_command_2 "mkdir \"$chunkdir\"" |
52 |
fi |
53 |
@@ -549,7 +550,7 @@ |
54 |
quit "file not found: $xsl" |
55 |
fi |
56 |
to_docbook "-d manpage" |
57 |
- xml=$(readlink -f "$SRC_DIR/$SRC_NAME.xml") |
58 |
+ xml=$(/bin/realpath "$SRC_DIR/$SRC_NAME.xml") |
59 |
execute_command_2 "cd \"$DESTINATION_DIR\"" |
60 |
execute_command_2 "xsltproc $XSLTPROC_OPTS --nonet \ |
61 |
\"$xsl\" \"$xml\"" |