Support FEATURES=force-prefix.
[portage.git] / bin / ebuild-helpers / doinfo
1 #!/bin/bash
2 # Copyright 1999-2011 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4
5 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
6
7 if [[ -z $1 ]] ; then
8         helpers_die "${0##*/}: at least one argument needed"
9         exit 1  
10 fi
11
12 [[ " ${FEATURES} " == *" force-prefix "* ]] || \
13         case "$EAPI" in 0|1|2) ED=${D} ;; esac
14
15 if [[ ! -d ${ED}usr/share/info ]] ; then
16         install -d "${ED}usr/share/info" || { helpers_die "${0##*/}: failed to install ${ED}usr/share/info"; exit 1; }
17 fi
18
19 install -m0644 "$@" "${ED}usr/share/info"
20 rval=$?
21 if [ $rval -ne 0 ] ; then
22         for x in "$@" ; do
23                 [ -e "$x" ] || echo "!!! ${0##*/}: $x does not exist" 1>&2
24         done
25         helpers_die "${0##*/} failed"
26 fi
27 exit $rval