diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-11-20 17:48:48 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-11-20 17:48:48 +0000 |
commit | ac0769a165aba83b0e864da92cbf93fb8d269ed9 (patch) | |
tree | be23a007df7d1d6f73ceeec14fce21e3732534cc /sys-devel/binutils-config/files/binutils-config-1.8 | |
parent | Added lighttpd support. Closes #107300. (diff) | |
download | gentoo-2-ac0769a165aba83b0e864da92cbf93fb8d269ed9.tar.gz gentoo-2-ac0769a165aba83b0e864da92cbf93fb8d269ed9.tar.bz2 gentoo-2-ac0769a165aba83b0e864da92cbf93fb8d269ed9.zip |
Allow people to select profiles via version only.
(Portage version: 2.0.53_rc7)
Diffstat (limited to 'sys-devel/binutils-config/files/binutils-config-1.8')
-rwxr-xr-x | sys-devel/binutils-config/files/binutils-config-1.8 | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/sys-devel/binutils-config/files/binutils-config-1.8 b/sys-devel/binutils-config/files/binutils-config-1.8 index 8b10117a5941..f5e396f7ac1d 100755 --- a/sys-devel/binutils-config/files/binutils-config-1.8 +++ b/sys-devel/binutils-config/files/binutils-config-1.8 @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/binutils-config/files/binutils-config-1.8,v 1.6 2005/08/27 05:34:12 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/binutils-config/files/binutils-config-1.8,v 1.7 2005/11/20 17:48:48 vapier Exp $ # Format of /etc/env.d/binutils/: # config-TARGET: CURRENT=version for TARGET @@ -249,6 +249,16 @@ list_profiles() { done } +set_HOST() { + [[ -n ${HOST} ]] && return 0 + + if [[ -z ${CHOST} ]] ; then + HOST=$(portageq envvar CHOST) + else + HOST=${CHOST} + fi +} + [[ -z ${ROOT} ]] && ROOT="/" ENV_D="${ROOT}etc/env.d/binutils" @@ -257,6 +267,7 @@ NEED_ACTION="yes" DOIT="switch_profile" PROFILE="" FAKE_TARGETS_USER="" +HOST="" while [[ $# -gt 0 ]] ; do x=$1 @@ -290,7 +301,7 @@ while [[ $# -gt 0 ]] ; do exit 0 ;; -v|--version) - cvsver="$Header: /var/cvsroot/gentoo-x86/sys-devel/binutils-config/files/binutils-config-1.8,v 1.6 2005/08/27 05:34:12 vapier Exp $" + cvsver="$Header: /var/cvsroot/gentoo-x86/sys-devel/binutils-config/files/binutils-config-1.8,v 1.7 2005/11/20 17:48:48 vapier Exp $" cvsver=${cvsver##*binutils-config-} echo "binutils-config-${cvsver%%,v *}" exit 0 @@ -335,8 +346,14 @@ while [[ $# -gt 0 ]] ; do # User gave us a full HOST-ver x=${x##*/} if [[ ! -f ${ENV_D}/${x} ]] && [[ ! -f ${ENV_D}/config-${x} ]] ; then - eerror "$0: Could not locate '$x' in '${ENV_D}/'!" - exit 1 + # Maybe they just gave us a ver ... + set_HOST + if [[ -f ${ENV_D}/${HOST}-${x} ]] ; then + x=${HOST}-${x} + else + eerror "$0: Could not locate '$x' in '${ENV_D}/'!" + exit 1 + fi fi PROFILE=${x} NEED_ACTION="no" @@ -348,13 +365,7 @@ done [[ ${NEED_ACTION} == "yes" ]] && usage && exit 1 [[ ${DEBUG} == "yes" ]] && set -x -if [[ ${DOIT} != "list_profiles" ]] ; then - if [[ -z ${CHOST} ]] ; then - HOST=$(portageq envvar CHOST) - else - HOST=${CHOST} - fi -fi +[[ ${DOIT} != "list_profiles" ]] && set_HOST [[ -z ${PROFILE} ]] && PROFILE=${HOST} [[ ${PROFILE} == "current" ]] && PROFILE=$(PROFILE=${HOST} get_current_profile) eval ${DOIT} |