diff options
author | Mike Frysinger <vapier@gentoo.org> | 2006-04-25 00:20:17 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2006-04-25 00:20:17 +0000 |
commit | a7d332c84ab27a8dcd981ade07a132586618a8a7 (patch) | |
tree | e80fc76bb3932d157be7038415e8b21f15536204 /sys-devel | |
parent | old (diff) | |
download | gentoo-2-a7d332c84ab27a8dcd981ade07a132586618a8a7.tar.gz gentoo-2-a7d332c84ab27a8dcd981ade07a132586618a8a7.tar.bz2 gentoo-2-a7d332c84ab27a8dcd981ade07a132586618a8a7.zip |
If active profile no longer exists, make sure -c spits out an error message.
(Portage version: 2.1_pre9-r4)
Diffstat (limited to 'sys-devel')
-rw-r--r-- | sys-devel/gcc-config/ChangeLog | 8 | ||||
-rw-r--r-- | sys-devel/gcc-config/files/digest-gcc-config-1.3.13-r2 | 1 | ||||
-rwxr-xr-x | sys-devel/gcc-config/files/gcc-config-1.3.13 | 40 | ||||
-rw-r--r-- | sys-devel/gcc-config/gcc-config-1.3.13-r2.ebuild | 51 |
4 files changed, 81 insertions, 19 deletions
diff --git a/sys-devel/gcc-config/ChangeLog b/sys-devel/gcc-config/ChangeLog index c4ea561a0333..1ca397e0b44d 100644 --- a/sys-devel/gcc-config/ChangeLog +++ b/sys-devel/gcc-config/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sys-devel/gcc-config # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/ChangeLog,v 1.126 2006/04/24 01:10:11 kumba Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/ChangeLog,v 1.127 2006/04/25 00:20:17 vapier Exp $ + +*gcc-config-1.3.13-r2 (25 Apr 2006) + + 25 Apr 2006; Mike Frysinger <vapier@gentoo.org> files/gcc-config-1.3.13, + +gcc-config-1.3.13-r2.ebuild: + If active profile no longer exists, make sure -c spits out an error message. 29 Apr 2006; Joshua Kinard <kumba@gentoo.org> gcc-config-1.3.13-r1.ebuild: Marked stable on mips. diff --git a/sys-devel/gcc-config/files/digest-gcc-config-1.3.13-r2 b/sys-devel/gcc-config/files/digest-gcc-config-1.3.13-r2 new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/sys-devel/gcc-config/files/digest-gcc-config-1.3.13-r2 @@ -0,0 +1 @@ + diff --git a/sys-devel/gcc-config/files/gcc-config-1.3.13 b/sys-devel/gcc-config/files/gcc-config-1.3.13 index 3121c2c3a339..1b32bcaf0cc8 100755 --- a/sys-devel/gcc-config/files/gcc-config-1.3.13 +++ b/sys-devel/gcc-config/files/gcc-config-1.3.13 @@ -1,12 +1,13 @@ #!/bin/bash -# Copyright 1999-2005 Gentoo Foundation +# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/files/gcc-config-1.3.13,v 1.6 2006/04/21 23:50:31 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/files/gcc-config-1.3.13,v 1.7 2006/04/25 00:20:17 vapier Exp $ trap ":" INT QUIT TSTP +argv0=${0##*/} source /sbin/functions.sh || { - echo "$0: Could not source /sbin/functions.sh!" + echo "${argv0}: Could not source /sbin/functions.sh!" exit 1 } umask 022 @@ -116,10 +117,10 @@ get_real_chost() { fi if [[ -z ${REAL_CHOST} ]] ; then - eerror "$0: Could not get portage CHOST!" - eerror "$0: You should verify that CHOST is set in one of these places:" - eerror "$0: - ${ROOT}/etc/make.conf" - eerror "$0: - active environment" + eerror "${argv0}: Could not get portage CHOST!" + eerror "${argv0}: You should verify that CHOST is set in one of these places:" + eerror "${argv0}: - ${ROOT}/etc/make.conf" + eerror "${argv0}: - active environment" exit 1 fi } @@ -136,7 +137,7 @@ switch_profile() { local GCC_BIN_PATH= if [[ "$(id -u)" -ne 0 ]] ; then - eerror "$0: Must be root." + eerror "${argv0}: Must be root." exit 1 fi @@ -345,14 +346,17 @@ get_current_profile() { fi if [[ ! -f ${conf} ]] ; then - eerror "$0: No gcc profile is active!" + eerror "${argv0}: No gcc profile is active!" return 1 fi source "${conf}" if [[ -z ${CURRENT} ]] ; then - eerror "$0: No gcc profile is active!" + eerror "${argv0}: No gcc profile is active!" + return 1 + elif [[ ! -f ${GCC_ENV_D}/${CURRENT} ]] ; then + eerror "${argv0}: Active gcc profile is invalid!" return 1 fi @@ -369,7 +373,7 @@ list_profiles() { fi if [[ ! -f ${GCC_ENV_D}/config ]] ; then - eerror "$0: No gcc profile is active; please select one!" + eerror "${argv0}: No gcc profile is active; please select one!" fi eval $(grep -s ^CURRENT= "${GCC_ENV_D}"/config) @@ -595,7 +599,7 @@ for x in "$@" ; do exit 0 ;; -*) - eerror "$0: Invalid switch! Run $0 without parameters for help." + eerror "${argv0}: Invalid switch! Run ${argv0} without parameters for help." exit 1 ;; *) @@ -624,14 +628,14 @@ for x in "$@" ; do if [[ -f ${GCC_ENV_D}/${REAL_CHOST}-${x} ]] ; then x=${REAL_CHOST}-${x} else - eerror "$0: Could not locate '$x' in '${GCC_ENV_D}/' !" + eerror "${argv0}: Could not locate '$x' in '${GCC_ENV_D}/' !" exit 1 fi fi CC_COMP=${x} fi else - eerror "$0: Too many arguments! Run $0 without parameters for help." + eerror "${argv0}: Too many arguments! Run ${argv0} without parameters for help." exit 1 fi ;; @@ -645,9 +649,9 @@ fi cmd_setup if [[ -z ${CC_COMP} ]] ; then - if get_current_profile &>/dev/null ; then - CC_COMP="$(get_current_profile)" - else + CC_COMP=$(get_current_profile) + if [[ $? -ne 0 ]] ; then + echo "${CC_COMP}" list_profiles exit 1 fi @@ -669,7 +673,7 @@ if [[ ${DOIT} != "get_current_profile" ]] ; then if [[ ! -d ${ROOT}/${GCC_LIB}/${CC_COMP_TARGET}/${CC_COMP_VERSION} ]] || \ [[ ! -f ${GCC_ENV_D}/${CC_COMP} ]] then - eerror "$0: Profile does not exist or invalid setting for ${GCC_ENV_D}/${CC_COMP}" 1>&2 + eerror "${argv0}: Profile does not exist or invalid setting for ${GCC_ENV_D}/${CC_COMP}" 1>&2 #exit 1 fi fi diff --git a/sys-devel/gcc-config/gcc-config-1.3.13-r2.ebuild b/sys-devel/gcc-config/gcc-config-1.3.13-r2.ebuild new file mode 100644 index 000000000000..e7169eb503c2 --- /dev/null +++ b/sys-devel/gcc-config/gcc-config-1.3.13-r2.ebuild @@ -0,0 +1,51 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/gcc-config-1.3.13-r2.ebuild,v 1.1 2006/04/25 00:20:17 vapier Exp $ + +inherit toolchain-funcs multilib + +# Version of .c wrapper to use +W_VER="1.4.7" + +DESCRIPTION="Utility to change the gcc compiler being used" +HOMEPAGE="http://www.gentoo.org/" +SRC_URI="" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="alpha amd64 arm hppa ia64 m68k mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd" +IUSE="" + +DEPEND="" + +S=${WORKDIR} + +src_compile() { + $(tc-getCC) -O2 -Wall -o wrapper \ + "${FILESDIR}"/wrapper-${W_VER}.c || die "compile wrapper" +} + +src_install() { + newbin "${FILESDIR}"/${PN}-${PV} ${PN} || die "install gcc-config" + sed -i \ + -e "s:PORTAGE-VERSION:${PVR}:g" \ + -e "s:GENTOO_LIBDIR:$(get_libdir):g" \ + "${D}"/usr/bin/${PN} + + exeinto /usr/$(get_libdir)/misc + newexe wrapper gcc-config || die "install wrapper" +} + +pkg_postinst() { + # Do we have a valid multi ver setup ? + if gcc-config --get-current-profile &>/dev/null ; then + # We not longer use the /usr/include/g++-v3 hacks, as + # it is not needed ... + [[ -L ${ROOT}/usr/include/g++ ]] && rm -f "${ROOT}"/usr/include/g++ + [[ -L ${ROOT}/usr/include/g++-v3 ]] && rm -f "${ROOT}"/usr/include/g++-v3 + [[ ${ROOT} = "/" ]] && gcc-config $(/usr/bin/gcc-config --get-current-profile) + fi + + # Make sure old versions dont exist #79062 + rm -f "${ROOT}"/usr/sbin/gcc-config +} |