From: Zac Medico Date: Sun, 6 Apr 2008 17:09:13 +0000 (-0000) Subject: * Use type -P which does not produce messages to stderr. X-Git-Tag: v2.2_pre6~241 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=33e558be9ec5388b72a4eb5d4ec9b8f8598615af;p=portage.git * Use type -P which does not produce messages to stderr. another option is to redirect both stderr and out. * Avoid &> replace with > ... 2>&1 Thanks to Alon Bar-Lev for this patch. svn path=/main/trunk/; revision=9727 --- diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync index 0dd791f3a..8c0f7cd9e 100755 --- a/bin/emerge-webrsync +++ b/bin/emerge-webrsync @@ -28,7 +28,7 @@ wecho() { echo "${argv0}: warning: $*" 1>&2 ; } eecho() { echo "${argv0}: error: $*" 1>&2 ; } argv0=$0 -if ! type portageq > /dev/null ; then +if ! type -P portageq > /dev/null ; then eecho "could not find 'portageq'; aborting" exit 1 fi @@ -150,7 +150,7 @@ check_file_signature() { vecho "Checking signature ..." - if type -p gpg > /dev/null; then + if type -P gpg > /dev/null; then gpg --homedir "${PORTAGE_GPG_DIR}" --verify "$signature" "$file" && r=0 else eecho "cannot check signature: gpg binary not found" @@ -174,7 +174,7 @@ sync_local() { vecho "Syncing local tree ..." # tarsync-0.2.1 doesn't seem to support lzma compression. - if [ "${file##*.}" != "lzma" ] && type -P tarsync &> /dev/null; then + if [ "${file##*.}" != "lzma" ] && type -P tarsync > /dev/null; then if ! tarsync $(vvecho -v) -s 1 -o portage -g portage -e /distfiles -e /packages -e /local "${file}" "${PORTDIR}"; then eecho "tarsync failed; tarball is corrupt? (${file})" return 1 @@ -189,7 +189,7 @@ sync_local() { # Free disk space rm -f "${file}" - chown portage:portage portage &> /dev/null && \ + chown portage:portage portage > /dev/null 2>&1 && \ chown -R portage:portage portage cd portage rsync -av --progress --stats --delete --delete-after \ @@ -221,9 +221,9 @@ do_snapshot() { local mirror local compressions="" - type lzcat > /dev/null && compressions="${compressions} lzma" - type bzcat > /dev/null && compressions="${compressions} bz2" - type zcat > /dev/null && compressions="${compressions} gz" + type -P lzcat > /dev/null && compressions="${compressions} lzma" + type -P bzcat > /dev/null && compressions="${compressions} bz2" + type -P zcat > /dev/null && compressions="${compressions} gz" if [[ -z ${compressions} ]] ; then eecho "unable to locate any decompressors (lzcat or bzcat or zcat)" exit 1