Blame SOURCES/db2html

c49e6c
#! /bin/sh
c49e6c
c49e6c
ADMON_GRAPHICS=/usr/share/sgml/docbook/dsssl-stylesheets/images/*.gif
c49e6c
c49e6c
output=docbook2html-dir
c49e6c
skip=0
c49e6c
dbdircleanup=1
c49e6c
outputdone=0
c49e6c
for arg in "$@"
c49e6c
do
c49e6c
  if [ $skip -gt 0 ]
c49e6c
  then
c49e6c
    skip=$(($skip - 1))
c49e6c
    continue
c49e6c
  fi
c49e6c
  case $arg in
c49e6c
  -h|--help|-v|--version)	break
c49e6c
				;;
c49e6c
  -n|--nostd|-u|--nochunks)	;;
c49e6c
  -o|--output)   outputdone=1
c49e6c
	         ;;
c49e6c
c49e6c
  -*)				skip=1
c49e6c
				;;
c49e6c
  *)    dbdircleanup=0
c49e6c
        if [ ${outputdone} -eq 1 ];
c49e6c
        then
c49e6c
          output="$(echo $arg | sed 's,\.sgml$,,;s,\.sgm$,,;s,\.xml,,')"
c49e6c
          outputfile="$basename "$output""
c49e6c
          outputdone=2
c49e6c
        elif [ ${outputdone} -eq 2 ];
c49e6c
        then
c49e6c
          outputfile="$(echo $arg | sed 's,\.sgml$,,;s,\.sgm$,,;s,\.xml,,' | \
c49e6c
                      rev | cut -d'/' -f1 | rev)"
c49e6c
        else
c49e6c
          output="$(echo $arg | sed 's,\.sgml$,,;s,\.sgm$,,;s,\.xml,,')"
c49e6c
          outputfile=$(basename "$output")
c49e6c
        fi
c49e6c
	;;
c49e6c
  esac
c49e6c
done
c49e6c
c49e6c
if [ ${dbdircleanup} -eq 0 ];
c49e6c
then
c49e6c
  echo "Output is $output/$outputfile.html"
c49e6c
fi
c49e6c
if [ -d ${output} ]
c49e6c
then
c49e6c
  rm -rf ${output}.junk
c49e6c
  mv ${output} ${output}.junk
c49e6c
fi
c49e6c
mkdir ${output}
c49e6c
mkdir ${output}/stylesheet-images
c49e6c
cp ${ADMON_GRAPHICS} ${output}/stylesheet-images
c49e6c
jw -f docbook -b html -o ${output} "$@"
c49e6c
if [ ${dbdircleanup} -eq 1 ];
c49e6c
then
c49e6c
  rm -rf ${output}
c49e6c
fi