aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-02-25 12:11:34 -0800
committerZac Medico <zmedico@gentoo.org>2011-02-25 12:11:34 -0800
commit6271cfe43dcf0cb42d4c2c0b772a7be17be78d2f (patch)
treeba113fffe7bfe93159c1f23011670b461eb2fae3 /bin
parentdodoc: call doins, to reuse recursion code (diff)
downloadportage-6271cfe43dcf0cb42d4c2c0b772a7be17be78d2f.tar.gz
portage-6271cfe43dcf0cb42d4c2c0b772a7be17be78d2f.tar.bz2
portage-6271cfe43dcf0cb42d4c2c0b772a7be17be78d2f.zip
doins: avoid die when called as dodoc with no arg
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ebuild-helpers/doins22
1 files changed, 11 insertions, 11 deletions
diff --git a/bin/ebuild-helpers/doins b/bin/ebuild-helpers/doins
index 8055a37a7..c549791fc 100755
--- a/bin/ebuild-helpers/doins
+++ b/bin/ebuild-helpers/doins
@@ -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