doins: avoid die when called as dodoc with no arg
authorZac Medico <zmedico@gentoo.org>
Fri, 25 Feb 2011 20:11:34 +0000 (12:11 -0800)
committerZac Medico <zmedico@gentoo.org>
Tue, 1 Mar 2011 20:52:05 +0000 (12:52 -0800)
bin/ebuild-helpers/doins

index 8055a37a70a2c182f1f92c8316c6dcbae07a1cc2..c549791fcc3dc01b2df2c8c0007c2326353dff39 100755 (executable)
@@ -4,6 +4,17 @@
 
 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 
+if [[ ${0##*/} == dodoc ]] ; then
+       if [ $# -eq 0 ] ; then
+               # default_src_install may call dodoc with no arguments
+               # when DOC is defined but empty, so simply return
+               # sucessfully in this case.
+               exit 0
+       fi
+       export INSOPTIONS=-m0644
+       export INSDESTTREE=usr/share/doc/${PF}/${_E_DOCDESTTREE_}
+fi
+
 if [ $# -lt 1 ] ; then
        helpers_die "${0##*/}: at least one argument needed"
        exit 1
@@ -16,17 +27,6 @@ else
        DOINSRECUR=n
 fi
 
-if [[ ${0##*/} == dodoc ]] ; then
-       if [ $# -eq 0 ] ; then
-               # default_src_install may call dodoc with no arguments
-               # when DOC is defined but empty, so simply return
-               # sucessfully in this case.
-               exit 0
-       fi
-       export INSOPTIONS=-m0644
-       export INSDESTTREE=usr/share/doc/${PF}/${_E_DOCDESTTREE_}
-fi
-
 if [[ ${INSDESTTREE#${D}} != "${INSDESTTREE}" ]]; then
        vecho "-------------------------------------------------------" 1>&2
        vecho "You should not use \${D} with helpers." 1>&2