From 628ae053fc59c6ab72be61f010e0cbd3b9353767 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 7 Jun 2005 00:39:09 +0000 Subject: Cleanup the CHOST-GCCVER parsing so it isnt so fragile (and works with BSD hosts). (Portage version: 2.0.51.22-r1) --- sys-devel/gcc-config/ChangeLog | 9 +++- .../gcc-config/files/digest-gcc-config-1.3.11 | 0 .../gcc-config/files/digest-gcc-config-1.3.11-r1 | 0 sys-devel/gcc-config/files/gcc-config-1.3.11 | 28 ++++++++++--- sys-devel/gcc-config/gcc-config-1.3.11-r1.ebuild | 48 ++++++++++++++++++++++ sys-devel/gcc-config/gcc-config-1.3.11.ebuild | 48 ---------------------- 6 files changed, 78 insertions(+), 55 deletions(-) delete mode 100644 sys-devel/gcc-config/files/digest-gcc-config-1.3.11 create mode 100644 sys-devel/gcc-config/files/digest-gcc-config-1.3.11-r1 create mode 100644 sys-devel/gcc-config/gcc-config-1.3.11-r1.ebuild delete mode 100644 sys-devel/gcc-config/gcc-config-1.3.11.ebuild (limited to 'sys-devel') diff --git a/sys-devel/gcc-config/ChangeLog b/sys-devel/gcc-config/ChangeLog index 43571bda2fef..f4333183c8c7 100644 --- a/sys-devel/gcc-config/ChangeLog +++ b/sys-devel/gcc-config/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sys-devel/gcc-config # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/ChangeLog,v 1.90 2005/06/06 03:58:39 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/ChangeLog,v 1.91 2005/06/07 00:39:09 vapier Exp $ + +*gcc-config-1.3.11-r1 (07 Jun 2005) + + 07 Jun 2005; Mike Frysinger files/gcc-config-1.3.11, + -gcc-config-1.3.11.ebuild, +gcc-config-1.3.11-r1.ebuild: + Cleanup the CHOST-GCCVER parsing so it isnt so fragile (and works with BSD + hosts). *gcc-config-1.3.11 (06 Jun 2005) diff --git a/sys-devel/gcc-config/files/digest-gcc-config-1.3.11 b/sys-devel/gcc-config/files/digest-gcc-config-1.3.11 deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/sys-devel/gcc-config/files/digest-gcc-config-1.3.11-r1 b/sys-devel/gcc-config/files/digest-gcc-config-1.3.11-r1 new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sys-devel/gcc-config/files/gcc-config-1.3.11 b/sys-devel/gcc-config/files/gcc-config-1.3.11 index b94f9887e52e..b7ae23697117 100755 --- a/sys-devel/gcc-config/files/gcc-config-1.3.11 +++ b/sys-devel/gcc-config/files/gcc-config-1.3.11 @@ -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/gcc-config/files/gcc-config-1.3.11,v 1.1 2005/06/06 03:58:40 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc-config/files/gcc-config-1.3.11,v 1.2 2005/06/07 00:39:09 vapier Exp $ trap ":" INT QUIT TSTP @@ -514,13 +514,28 @@ if [[ -z ${CC_COMP} ]] ; then fi fi +chop_gcc_ver() { + echo "$@" | awk -F- '{ + gccver="" + for (i=NF; i > 0; --i) { + if ($i ~ /^[[:digit:].]+$/) + gccver=$i"-"gccver + else + break + } + print substr(gccver,0,length(gccver)-1) + }' +} + if [[ ${DOIT} != "get_current_profile" ]] ; then - GCC_LIB=$(source "${GCC_ENV_D}/${CC_COMP}" + GCC_LIB=$( + source "${GCC_ENV_D}/${CC_COMP}" cmd_setup - echo ${LDPATH} | ${AWK} -F/ '{ print "/"$2"/"$3"/"$4"/" }') + echo ${LDPATH} | ${AWK} -F/ '{ print "/"$2"/"$3"/"$4"/" }' + ) - CC_COMP_TARGET=$(echo ${CC_COMP} | awk -F- '{ print $1"-"$2"-"$3"-"$4 }') - CC_COMP_VERSION=${CC_COMP/${CC_COMP_TARGET}-/} + CC_COMP_VERSION=$(chop_gcc_ver ${CC_COMP}) + CC_COMP_TARGET=${CC_COMP:0:${#CC_COMP}-${#CC_COMP_VERSION}-1} if [[ ! -d ${ROOT}/${GCC_LIB}/${CC_COMP_TARGET}/${CC_COMP_VERSION} ]]; then CC_COMP_VERSION=${CC_COMP_VERSION%-*} @@ -538,7 +553,8 @@ if [[ ${CHECK_CHOST} == "yes" ]] ; then # Chosen CHOST are not the same as the real CHOST according to # make.conf, and --use-portage-chost option was given, so do nothing get_real_chost - CC_COMP_TARGET=$(echo ${CC_COMP} | awk -F- '{ print $1"-"$2"-"$3"-"$4 }') + CC_COMP_VERSION=$(chop_gcc_ver ${CC_COMP}) + CC_COMP_TARGET=${CC_COMP:0:${#CC_COMP}-${#CC_COMP_VERSION}-1} [[ ${CC_COMP_TARGET} != ${REAL_CHOST} ]] && exit 0 fi diff --git a/sys-devel/gcc-config/gcc-config-1.3.11-r1.ebuild b/sys-devel/gcc-config/gcc-config-1.3.11-r1.ebuild new file mode 100644 index 000000000000..9e5c9c8f021f --- /dev/null +++ b/sys-devel/gcc-config/gcc-config-1.3.11-r1.ebuild @@ -0,0 +1,48 @@ +# Copyright 1999-2005 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.11-r1.ebuild,v 1.1 2005/06/07 00:39:09 vapier Exp $ + +inherit toolchain-funcs + +# Version of .c wrapper to use +W_VER="1.4.6" + +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" +IUSE="" + +DEPEND=">=sys-apps/portage-2.0.47-r10" # We need portageq ... + +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" + dosed "s:PORTAGE-VERSION:${PVR}:" /usr/bin/${PN} + + exeinto /usr/lib/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 +} diff --git a/sys-devel/gcc-config/gcc-config-1.3.11.ebuild b/sys-devel/gcc-config/gcc-config-1.3.11.ebuild deleted file mode 100644 index ea39eed07493..000000000000 --- a/sys-devel/gcc-config/gcc-config-1.3.11.ebuild +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright 1999-2005 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.11.ebuild,v 1.1 2005/06/06 03:58:40 vapier Exp $ - -inherit toolchain-funcs - -# Version of .c wrapper to use -W_VER="1.4.6" - -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" -IUSE="" - -DEPEND=">=sys-apps/portage-2.0.47-r10" # We need portageq ... - -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" - dosed "s:PORTAGE-VERSION:${PVR}:" /usr/bin/${PN} - - exeinto /usr/lib/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 -} -- cgit v1.2.3-65-gdbad