diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-05-04 00:52:42 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-05-04 00:52:42 +0000 |
commit | c2dda7eb1c666245e1483d64ea1fcd95aa3ae0ab (patch) | |
tree | 969ca0c64a5b62951ebb5606f84f8b53c897eae6 /bin | |
parent | cleanup and remove unused/old options (diff) | |
download | portage-cvs-c2dda7eb1c666245e1483d64ea1fcd95aa3ae0ab.tar.gz portage-cvs-c2dda7eb1c666245e1483d64ea1fcd95aa3ae0ab.tar.bz2 portage-cvs-c2dda7eb1c666245e1483d64ea1fcd95aa3ae0ab.zip |
make the code prettier and simpler
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/dodoc | 30 | ||||
-rwxr-xr-x | bin/doinfo | 18 | ||||
-rwxr-xr-x | bin/newdoc | 8 | ||||
-rwxr-xr-x | bin/newman | 6 | ||||
-rwxr-xr-x | bin/prepallinfo | 6 | ||||
-rwxr-xr-x | bin/prepallman | 7 |
6 files changed, 39 insertions, 36 deletions
@@ -1,21 +1,23 @@ #!/bin/bash -# Copyright 1999-2004 Gentoo Foundation +# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/dodoc,v 1.6 2004/10/04 13:56:50 vapier Exp $ +# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/dodoc,v 1.7 2005/05/04 00:52:42 vapier Exp $ + +if [ ${#} -lt 1 ] ; then + echo "dodoc: at least one argument needed" 1>&2 + exit 1 +fi + +dir="${D}/usr/share/doc/${PF}/${DOCDESTTREE}" +if [ ! -d "${dir}" ] ; then + install -d "${dir}" +fi for x in "$@" ; do if [ -s "${x}" ] ; then - if [ ! -d "${D}usr/share/doc/${PF}" ] ; then - install -d "${D}usr/share/doc/${PF}" - fi - if [ -z "${DOCDESTTREE}" ] ; then - install -m0644 "${x}" "${D}usr/share/doc/${PF}" - gzip -f -9 "${D}usr/share/doc/${PF}/${x##*/}" - else - install -m0644 "${x}" "${D}usr/share/doc/${PF}/${DOCDESTTREE}" - gzip -f -9 "${D}usr/share/doc/${PF}/${DOCDESTTREE}/${x##*/}" - fi - else - echo "${0}: ${x} does not exist." + install -m0644 "${x}" "${dir}" + gzip -f -9 "${dir}/${x##*/}" + elif [ ! -e "${x}" ] ; then + echo "dodoc: ${x} does not exist" 1>&2 fi done @@ -1,21 +1,23 @@ #!/bin/bash -# Copyright 1999-2004 Gentoo Foundation +# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/doinfo,v 1.7 2004/10/04 13:56:50 vapier Exp $ +# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/doinfo,v 1.8 2005/05/04 00:52:42 vapier Exp $ if [ ${#} -lt 1 ] ; then - echo "doinfo: at least one argument needed" + echo "doinfo: at least one argument needed" 1>&2 exit 1 fi -if [ ! -d "${D}usr/share/info" ] ; then - install -d "${D}usr/share/info" + +dir="${D}/usr/share/info" +if [ ! -d "${dir}" ] ; then + install -d "${dir}" fi for x in "$@" ; do if [ -e "${x}" ] ; then - install -m0644 "${x}" "${D}usr/share/info" - gzip -f -9 "${D}usr/share/info/${x##*/}" + install -m0644 "${x}" "${dir}" + gzip -f -9 "${dir}/${x##*/}" else - echo "doinfo: ${x} does not exist" + echo "doinfo: ${x} does not exist" 1>&2 fi done @@ -1,13 +1,13 @@ #!/bin/bash -# Copyright 1999-2004 Gentoo Foundation +# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/newdoc,v 1.7 2004/10/04 13:56:50 vapier Exp $ +# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/newdoc,v 1.8 2005/05/04 00:52:42 vapier Exp $ if [ -z "${T}" ] || [ -z "${2}" ] ; then - echo "Nothing defined to do." + echo "newdoc: Nothing defined to do" 1>&2 exit 1 fi rm -rf "${T}/${2}" cp "${1}" "${T}/${2}" -dodoc "${T}/${2}" +exec dodoc "${T}/${2}" @@ -1,13 +1,13 @@ #!/bin/bash # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/newman,v 1.7 2004/10/04 13:56:50 vapier Exp $ +# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/newman,v 1.8 2005/05/04 00:52:42 vapier Exp $ if [ -z "${T}" ] || [ -z "${2}" ] ; then - echo "Nothing defined to do." + echo "newman: Nothing defined to do" 1>&2 exit 1 fi rm -rf "${T}/${2}" cp "${1}" "${T}/${2}" -doman "${T}/${2}" +exec doman "${T}/${2}" diff --git a/bin/prepallinfo b/bin/prepallinfo index 7baccd6..a205df7 100755 --- a/bin/prepallinfo +++ b/bin/prepallinfo @@ -1,9 +1,9 @@ #!/bin/bash -# Copyright 1999-2004 Gentoo Foundation +# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/prepallinfo,v 1.6 2004/10/04 13:56:50 vapier Exp $ +# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/prepallinfo,v 1.7 2005/05/04 00:52:42 vapier Exp $ [ ! -d "${D}usr/share/info" ] && exit 0 echo "info:" -prepinfo +exec prepinfo diff --git a/bin/prepallman b/bin/prepallman index 9669878..61aea7c 100755 --- a/bin/prepallman +++ b/bin/prepallman @@ -1,12 +1,11 @@ #!/bin/bash -# Copyright 1999-2004 Gentoo Foundation +# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/prepallman,v 1.10 2004/10/04 13:56:50 vapier Exp $ +# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/prepallman,v 1.11 2005/05/04 00:52:42 vapier Exp $ echo "man:" for x in "${D}"opt/*/man "${D}"usr/share/man "${D}"usr/local/man "${D}"usr/X11R6/man ; do - if [ -d "${x}" ] - then + if [ -d "${x}" ] ; then prepman "`echo "${x}" | sed -e "s:${D}::" -e "s:/man[/]*$::"`" fi done |