improve handling of jw options in db2html,respect --output (#756928)

This commit is contained in:
Ondřej Vašík 2011-11-25 20:51:10 +01:00
parent e1c4ee3ac3
commit b6ea8c1a38
2 changed files with 28 additions and 5 deletions

27
db2html
View File

@ -5,6 +5,7 @@ ADMON_GRAPHICS=/usr/share/sgml/docbook/dsssl-stylesheets/images/*.gif
output=docbook2html-dir output=docbook2html-dir
skip=0 skip=0
dbdircleanup=1 dbdircleanup=1
outputdone=0
for arg in "$@" for arg in "$@"
do do
if [ $skip -gt 0 ] if [ $skip -gt 0 ]
@ -16,15 +17,33 @@ do
-h|--help|-v|--version) break -h|--help|-v|--version) break
;; ;;
-n|--nostd|-u|--nochunks) ;; -n|--nostd|-u|--nochunks) ;;
-o|--output) outputdone=1
;;
-*) skip=1 -*) skip=1
;; ;;
*) output="$(echo $arg | sed 's,\.sgml$,,;s,\.sgm$,,;s,\.xml,,')" *) dbdircleanup=0
echo "output is $output" if [ ${outputdone} -eq 1 ];
dbdircleanup=0 then
break 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 esac
done done
if [ ${dbdircleanup} -eq 0 ];
then
echo "Output is $output/$outputfile.html"
fi
if [ -d ${output} ] if [ -d ${output} ]
then then
rm -rf ${output}.junk rm -rf ${output}.junk

View File

@ -1,6 +1,6 @@
Name: docbook-utils Name: docbook-utils
Version: 0.6.14 Version: 0.6.14
Release: 28%{?dist} Release: 29%{?dist}
Group: Applications/Text Group: Applications/Text
Summary: Shell scripts for managing DocBook documents Summary: Shell scripts for managing DocBook documents
@ -138,6 +138,10 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/*/docbook2ps.* %{_mandir}/*/docbook2ps.*
%changelog %changelog
* Fri Nov 25 2011 Ondrej Vasik <ovasik@redhat.com> 0.6.14-29
- improve handling of jw options in db2html,respect
--output (#756928)
* Fri Nov 25 2011 Ondrej Vasik <ovasik@redhat.com> 0.6.14-28 * Fri Nov 25 2011 Ondrej Vasik <ovasik@redhat.com> 0.6.14-28
- cleanup output dir for empty db2html input (#756930) - cleanup output dir for empty db2html input (#756930)