--- dodoc 2005-11-01 13:34:08.000000000 +0000 +++ /tmp/dodoc 2005-11-01 13:33:44.808741273 +0000 @@ -9,15 +9,26 @@ fi dir="${D}usr/share/doc/${PF}/${DOCDESTTREE}" -if [ ! -d "${dir}" ] ; then - install -d "${dir}" -fi -for x in "$@" ; do - if [ -s "${x}" ] ; then - install -m0644 "${x}" "${dir}" - gzip -f -9 "${dir}/${x##*/}" - elif [ ! -e "${x}" ] ; then - echo "dodoc: ${x} does not exist" 1>&2 +_dodoc() { + if [ ! -d "${dir}" ] ; then + install -d "${dir}" fi -done + + local x + for x in "$@" ; do + if [ -d "${x}" ] ; then + local sdir="${dir}" + dir="${dir}/${x}" + _dodoc "${x}"/* + dir="${sdir}" + elif [ -s "${x}" ] ; then + install -m0644 "${x}" "${dir}" + gzip -f -9 "${dir}/${x##*/}" + elif [ ! -e "${x}" ] ; then + echo "dodoc: ${x} does not exist" 1>&2 + fi + done +} + +_dodoc "$@"