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
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

View File

@ -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 <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
- cleanup output dir for empty db2html input (#756930)