Merged from trunk 6410:6411
authorFabian Groffen <grobian@gentoo.org>
Sun, 15 Apr 2007 11:06:29 +0000 (11:06 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sun, 15 Apr 2007 11:06:29 +0000 (11:06 -0000)
   +------------------------------------------------------------------------+
   | 6411     | convert `type -p` to `type -P` as noted by grobian          |
   | SpankMan |                                                             |
   +------------------------------------------------------------------------+

svn path=/main/branches/prefix/; revision=6412

bin/ebuild.sh
bin/emerge-webrsync
bin/etc-update
bin/misc-functions.sh
bin/prepall
bin/prepstrip
bin/sed

index 355000eaf9f901093adfd52c9e169779836fd02b..5f0cbec024c3d2b16f1627b08cdebe71c11d9b00 100755 (executable)
@@ -462,7 +462,7 @@ econf() {
 
                local TMP_CONFCACHE_DIR CONFCACHE_ARG
                if hasq confcache $FEATURES && ! hasq confcache $RESTRICT; then
-                       CONFCACHE="$(type -p confcache)"
+                       CONFCACHE="$(type -P confcache)"
                        if [ -z "${CONFCACHE}" ]; then
                                ewarn "disabling confcache, binary cannot be found"
                        else
@@ -703,7 +703,7 @@ dyn_clean() {
                return 1
        fi
 
-       if type -p chflags &>/dev/null; then
+       if type -P chflags > /dev/null ; then
                chflags -R noschg,nouchg,nosappnd,nouappnd "${PORTAGE_BUILDDIR}"
                chflags -R nosunlnk,nouunlnk "${PORTAGE_BUILDDIR}" 2>/dev/null
        fi
@@ -1421,7 +1421,7 @@ QA_INTERCEPTORS="javac java-config python python-config perl grep egrep fgrep se
 # level the QA interceptors if we're in depend
 if hasq "depend" "${EBUILD_SH_ARGS}"; then
        for BIN in ${QA_INTERCEPTORS}; do
-               BIN_PATH=$(type -pf ${BIN})
+               BIN_PATH=$(type -Pf ${BIN})
                if [ "$?" != "0" ]; then
                        BODY="echo \"*** missing command: ${BIN}\" >&2; return 127"
                else
index 91ffa039252795fc15709d441bd649eb9088393e..4ce47ac49986e952d75280787272072e64f8f2f8 100755 (executable)
@@ -38,9 +38,9 @@ else
        fi
 fi
 
-if type -p md5sum > /dev/null; then
+if type -P md5sum > /dev/null; then
        md5_com='md5sum -c "${FILE}.md5sum"'
-elif type -p md5 > /dev/null; then
+elif type -P md5 > /dev/null; then
        md5_com='[ "$(md5 -q ${FILE})" == "$(cut -d \  -f 1 ${FILE}.md5sum)" ]'
 else
        echo "warning, unable to do md5 verification of the snapshot!"
@@ -50,7 +50,7 @@ fi
 
 sync_local() {
        echo Syncing local tree...
-       if type -p tarsync &> /dev/null; then
+       if type -P tarsync &> /dev/null; then
                # tarsync doesn't take numeric uid/gid so we need to convert them.
                local inst_user="$(python -c "import pwd; print pwd.getpwuid(int('${PORTAGE_INST_UID:-0}'))[0]")"
                local inst_group="$(python -c "import grp; print grp.getgrgid(int('${PORTAGE_INST_GID:-0}'))[0]")"
index d1193bd43e285ffb19fc9f7d41f84213d5f58e3a..35720f6a83af3b46722ce8ca01a064173f4cd2ae 100755 (executable)
@@ -10,7 +10,7 @@
 # Leo Lipelis <aeoo@gentoo.org>
 # Karl Trygve Kalleberg <karltk@gentoo.org>
 
-if type -p gsed >/dev/null ; then
+if type -P gsed >/dev/null ; then
        function sed() { gsed "$@"; }
 fi
 
index 991e6fba5352d2bcd7279f5ced8a2dd1f6140dfd..5ede5ffc15a1b07af8e7e1c012ea0a8f73bf1969 100644 (file)
@@ -56,7 +56,7 @@ install_qa_check() {
                sleep 1
        done
 
-       if type -p scanelf > /dev/null && ! hasq binchecks ${RESTRICT}; then
+       if type -P scanelf > /dev/null && ! hasq binchecks ${RESTRICT}; then
                local qa_var insecure_rpath=0 tmp_quiet=${PORTAGE_QUIET}
                
                # display warnings when using stricter because we die afterwards
@@ -433,8 +433,8 @@ install_mask() {
 }
 
 preinst_bsdflags() {
-       type -p chflags &>/dev/null || return 0
-       type -p mtree &>/dev/null || return 1
+       type -P chflags > /dev/null || return 0
+       type -P mtree > /dev/null || return 1
        # Save all the file flags for restoration after installation.
        mtree -c -p "${ED}" -k flags > "${T}/bsdflags.mtree"
        # Remove all the file flags so that the merge phase can do anything
@@ -444,8 +444,8 @@ preinst_bsdflags() {
 }
 
 postinst_bsdflags() {
-       type -p chflags &>/dev/null || return 0
-       type -p mtree &>/dev/null || return 1
+       type -P chflags > /dev/null || return 0
+       type -P mtree > /dev/null || return 1
        # Restore all the file flags that were saved before installation.
        mtree -e -p "${EROOT}" -U -k flags < "${T}/bsdflags.mtree" &> /dev/null
 }
index 269765a96e97ede3088bceebfd0fb4cd441f77f7..95b9998bb9df0abe07b0bf34717ff129e5b7c6b8 100755 (executable)
@@ -3,7 +3,7 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id: prepall 2230 2005-11-01 01:35:59Z vapier $
 
-if type -p chflags &>/dev/null && type -p mtree &>/dev/null; then
+if type -P chflags > /dev/null && type -P mtree > /dev/null ; then
        # Save all the file flags for restoration at the end of prepall.
        mtree -c -p "${ED}" -k flags > "${T}/bsdflags.mtree"
        # Remove all the file flags so that prepall can do anything necessary.
@@ -19,7 +19,7 @@ ecompress --dequeue
 
 prepallstrip
 
-if type -p chflags &>/dev/null && type -p mtree &>/dev/null; then
+if type -P chflags > /dev/null && type -P mtree > /dev/null; then
        # Restore all the file flags that were saved at the beginning of prepall.
        mtree -U -e -p "${ED}" -k flags < "${T}/bsdflags.mtree" &> /dev/null
 fi
index 6666d32023f59a61c38508827d876912575d0eb4..2aeda21610a886411507d31a91ebfa359e860821 100755 (executable)
@@ -14,9 +14,9 @@ then
 fi
 
 STRIP=${STRIP:-${CHOST}-strip}
-type -p -- ${STRIP} > /dev/null || STRIP=strip
+type -P -- ${STRIP} > /dev/null || STRIP=strip
 OBJCOPY=${OBJCOPY:-${CHOST}-objcopy}
-type -p -- ${OBJCOPY} > /dev/null || OBJCOPY=objcopy
+type -P -- ${OBJCOPY} > /dev/null || OBJCOPY=objcopy
 
 export PORTAGE_STRIP_FLAGS=${PORTAGE_STRIP_FLAGS:---strip-unneeded}
 
diff --git a/bin/sed b/bin/sed
index 6996b43a0be167e37643a87410e4cd91e89cdb1a..d0ad70a746d9697ef3fd3e93ea44b593366893f5 100755 (executable)
--- a/bin/sed
+++ b/bin/sed
@@ -6,7 +6,7 @@ scriptpath="${BASH_SOURCE[0]}"
 
 if [[ -n ${ESED} ]]; then
        exec ${ESED} "$@"
-elif type -p gsed > /dev/null ; then
+elif type -P gsed > /dev/null ; then
        exec gsed "$@"
 else
        old_IFS="${IFS}"