docbook-toys/docbook-toys-outdir.diff

73 lines
2.1 KiB
Diff

--- db2x.sh.in 2004-01-14 12:54:14.000000000 +0100
+++ db2x.sh.in 2004-01-14 12:51:37.000000000 +0100
@@ -13,6 +13,7 @@
SGML_CATALOG_FILES=
# SP_ENCODING=
[ -z "$SP_CHARSET_FIXED" ] || SP_CHARSET_FIXED=YES
+DIR=.
jade_prefix=o
@@ -51,6 +52,7 @@
-S, --strict use the SGML declaration coming with the DocBook DTDs
(no minimizations are allowed)
-j, --jade VAR... set \"jade\" variables; e.g., \"-V %shade-verbatim%\"
+ -o, --output DIR set output DIR
-J, --use-jade use jade instead of openjade
-c, --catalog FILE use FILE as the catalog
-s, --style FILE use FILE as driver style
@@ -89,7 +91,9 @@
-j | --jade) if test $# -gt 2; then JADEVARS=$2; shift 2;
else echo "$usage"; exit 1; fi ;;
# for compatibility
- -o | --use-open*) true; shift ;;
+ #-o | --use-open*) true; shift ;;
+ -o | --out*) if test $# -gt 2; then [ -n "$2" ] && DIR="$2"; shift 2;
+ else echo "$usage"; exit 1; fi ;;
# --nochunks ) nochunks=yes; verbose="" ; JADEHTML='-V nochunks'; shift;;
--noc* ) nochunks=yes; quiet=yes ; JADEHTML='-V nochunks'; shift;;
# --catalog) if test $# -gt 2; then MYSTYLE=$2; shift 2;
@@ -134,7 +138,19 @@
WHICH='type -p'
-file=$1
+case "$1" in
+/*) file="$1" ;;
+*) file="$PWD/$1" ;;
+esac
+
+if [ $mode != db2html ]; then
+ # echo $mode
+ if ! cd "$DIR"; then
+ echo "Cannot change to directory \"$DIR\". Exiting." >&2
+ exit 1
+ fi
+fi
+
# echo $file
if [ ! -r "$file" ]; then
echo Cannot read \"$file\". Exiting. >&2
@@ -145,7 +161,8 @@
quiet=""
fi
-basefile=${file%\.*}
+dirbasefile="${file%\.*}"
+basefile="${dirbasefile##*/}"
suffix=${file##*\.}
SGML_DECL_SLOPPY=$sgmldir/docbook/$package/docbook-sloppy.dcl
@@ -359,7 +376,8 @@
do_html(){
#if echo "$file" | egrep -i '\.sgml$|\.sgm$|\.xml$' >/dev/null 2>&1; then
end=
- gen_outfile
+ [ "$DIR" = "." ] && gen_outfile || output="$DIR"
+ #echo $output
#else
#output="${file}-html"
# input_file=${file##*/}
Diff finished at Wed Jan 14 12:54:48