2 # Copyright 1999-2007 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
6 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
9 echo "${0##*/}: at least one argument needed" 1>&2
13 if [[ "$1" == "-r" ]] ; then
19 [[ -z ${INSDEPTH} ]] && declare -i INSDEPTH=0
20 if [[ ${INSDEPTH} -gt 30 ]] ; then
21 echo "${0##*/}: sanity check ... 30 directories is too much :(" 2>&1
25 if [[ ${INSDESTTREE#${D}} != "${INSDESTTREE}" ]]; then
26 vecho "-------------------------------------------------------" 1>&2
27 vecho "You should not use \${D} with helpers." 1>&2
28 vecho " --> ${INSDESTTREE}" 1>&2
29 vecho "-------------------------------------------------------" 1>&2
33 [[ ! -d ${D}${INSDESTTREE} ]] && dodir "${INSDESTTREE}"
38 mysrc="${T}/$(/usr/bin/basename "${x}")"
39 elif [ -d "$x" ] ; then
40 if [ "${DOINSRECUR}" == "n" ] ; then
44 mydir="${INSDESTTREE}/$(basename "${x}")"
45 find "${x}" -mindepth 1 -maxdepth 1 -exec \
47 INSDESTTREE="${mydir}" \
48 INSDEPTH=$((INSDEPTH+1)) \
54 install ${INSOPTIONS} "${mysrc}" "${D}${INSDESTTREE}"