diff --git a/db2html b/db2html
index 506433a..ca94b82 100755
--- a/db2html
+++ b/db2html
@@ -5,6 +5,7 @@ ADMON_GRAPHICS=/usr/share/sgml/docbook/dsssl-stylesheets/images/*.gif
output=docbook2html-dir
skip=0
dbdircleanup=1
+outputdone=0
for arg in "$@"
do
if [ $skip -gt 0 ]
@@ -16,15 +17,33 @@ do
-h|--help|-v|--version) break
;;
-n|--nostd|-u|--nochunks) ;;
+ -o|--output) outputdone=1
+ ;;
+
-*) skip=1
;;
- *) output="$(echo $arg | sed 's,\.sgml$,,;s,\.sgm$,,;s,\.xml,,')"
- echo "output is $output"
- dbdircleanup=0
- break
+ *) dbdircleanup=0
+ if [ ${outputdone} -eq 1 ];
+ then
+ output="$(echo $arg | sed 's,\.sgml$,,;s,\.sgm$,,;s,\.xml,,')"
+ outputfile="$basename "$output""
+ outputdone=2
+ elif [ ${outputdone} -eq 2 ];
+ then
+ outputfile="$(echo $arg | sed 's,\.sgml$,,;s,\.sgm$,,;s,\.xml,,' | \
+ rev | cut -d'/' -f1 | rev)"
+ else
+ output="$(echo $arg | sed 's,\.sgml$,,;s,\.sgm$,,;s,\.xml,,')"
+ outputfile=$(basename "$output")
+ fi
;;
esac
done
+
+if [ ${dbdircleanup} -eq 0 ];
+then
+ echo "Output is $output/$outputfile.html"
+fi
if [ -d ${output} ]
then
rm -rf ${output}.junk
diff --git a/docbook-utils.spec b/docbook-utils.spec
index e55b2cb..36791d1 100644
--- a/docbook-utils.spec
+++ b/docbook-utils.spec
@@ -1,6 +1,6 @@
Name: docbook-utils
Version: 0.6.14
-Release: 28%{?dist}
+Release: 29%{?dist}
Group: Applications/Text
Summary: Shell scripts for managing DocBook documents
@@ -138,6 +138,10 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/*/docbook2ps.*
%changelog
+* Fri Nov 25 2011 Ondrej Vasik 0.6.14-29
+- improve handling of jw options in db2html,respect
+ --output (#756928)
+
* Fri Nov 25 2011 Ondrej Vasik 0.6.14-28
- cleanup output dir for empty db2html input (#756930)