summaryrefslogtreecommitdiff
path: root/bin/doins
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-04-14 11:40:59 +0000
committerMike Frysinger <vapier@gentoo.org>2007-04-14 11:40:59 +0000
commit185aba8283dd3306ca24e306c19f94f53f4c3fa8 (patch)
tree81160b753e11ad4547c22aaed0e4e12cb7abea0a /bin/doins
parentPrefix the hardlink source with ${D} like we always have. (diff)
downloadportage-multirepo-185aba8283dd3306ca24e306c19f94f53f4c3fa8.tar.gz
portage-multirepo-185aba8283dd3306ca24e306c19f94f53f4c3fa8.tar.bz2
portage-multirepo-185aba8283dd3306ca24e306c19f94f53f4c3fa8.zip
revise tests so that `insinto /` does not trigger an error
svn path=/main/trunk/; revision=6401
Diffstat (limited to 'bin/doins')
-rwxr-xr-xbin/doins18
1 files changed, 9 insertions, 9 deletions
diff --git a/bin/doins b/bin/doins
index 43df6dd2..c0a495ae 100755
--- a/bin/doins
+++ b/bin/doins
@@ -1,36 +1,36 @@
#!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
if [ $# -lt 1 ] ; then
- echo "${0}: at least one argument needed"
+ echo "${0##*/}: at least one argument needed" 1>&2
exit 1
fi
-if [ "${1}" == "-r" ] ; then
+if [[ "$1" == "-r" ]] ; then
DOINSRECUR=y
shift
else
DOINSRECUR=n
fi
-[ -z "${INSDEPTH}" ] && declare -i INSDEPTH=0
-if [ ${INSDEPTH} -gt 30 ] ; then
- echo "${0}: sanity check ... 30 directories is too much :("
+[[ -z ${INSDEPTH} ]] && declare -i INSDEPTH=0
+if [[ ${INSDEPTH} -gt 30 ]] ; then
+ echo "${0##*/}: sanity check ... 30 directories is too much :(" 2>&1
exit 1
fi
-if [ "${INSDESTTREE%${D}*}" == "" ]; then
+if [[ ${INSDESTTREE#${D}} != "${INSDESTTREE}" ]]; then
vecho "-------------------------------------------------------" 1>&2
vecho "You should not use \${D} with helpers." 1>&2
vecho " --> ${INSDESTTREE}" 1>&2
vecho "-------------------------------------------------------" 1>&2
- #exit 1
+ exit 1
fi
-[ ! -d "${D}${INSDESTTREE}" ] && dodir "${INSDESTTREE}"
+[[ ! -d ${D}${INSDESTTREE} ]] && dodir "${INSDESTTREE}"
for x in "$@" ; do
if [ -L "$x" ] ; then