simplify the setup of $S and $SRC_URI a bit
authorMike Frysinger <vapier@gentoo.org>
Tue, 6 Dec 2011 05:10:02 +0000 (05:10 +0000)
committerMike Frysinger <vapier@gentoo.org>
Tue, 6 Dec 2011 05:10:02 +0000 (05:10 +0000)
eclass/toolchain.eclass

index 039279da010da3ce07844b93a39fb89774f84643..0759b6adbf8420d45117c18ac38d21cf7ef7afd5 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.500 2011/12/06 05:02:05 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.501 2011/12/06 05:10:02 vapier Exp $
 #
 # Maintainer: Toolchain Ninjas <toolchain@gentoo.org>
 
@@ -170,20 +170,17 @@ PDEPEND=">=sys-devel/gcc-config-1.4"
 
 #---->> S + SRC_URI essentials <<----
 
-# This function sets the source directory depending on whether we're using
+# Set the source directory depending on whether we're using
 # a prerelease, snapshot, or release tarball.
-gcc_get_s_dir() {
-       local GCC_S
+S=$(
        if [[ -n ${PRERELEASE} ]] ; then
-               GCC_S=${WORKDIR}/gcc-${PRERELEASE}
+               echo ${WORKDIR}/gcc-${PRERELEASE}
        elif [[ -n ${SNAPSHOT} ]] ; then
-               GCC_S=${WORKDIR}/gcc-${SNAPSHOT}
+               echo ${WORKDIR}/gcc-${SNAPSHOT}
        else
-               GCC_S=${WORKDIR}/gcc-${GCC_RELEASE_VER}
+               echo ${WORKDIR}/gcc-${GCC_RELEASE_VER}
        fi
-       echo "${GCC_S}"
-}
-S=$(gcc_get_s_dir)
+)
 
 # This function handles the basics of setting the SRC_URI for a gcc ebuild.
 # To use, set SRC_URI with:
@@ -268,49 +265,39 @@ get_gcc_src_uri() {
                GCC_SRC_URI="mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_RELEASE_VER}.tar.bz2"
                # we want all branch updates to be against the main release
                [[ -n ${BRANCH_UPDATE} ]] && \
-                       GCC_SRC_URI="${GCC_SRC_URI} $(gentoo_urls gcc-${GCC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2)"
+                       GCC_SRC_URI+=" $(gentoo_urls gcc-${GCC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2)"
        fi
 
-       # uclibc lovin
-       [[ -n ${UCLIBC_VER} ]] && \
-               GCC_SRC_URI="${GCC_SRC_URI} $(gentoo_urls gcc-${UCLIBC_GCC_VER}-uclibc-patches-${UCLIBC_VER}.tar.bz2)"
-
-       # various gentoo patches
-       [[ -n ${PATCH_VER} ]] && \
-               GCC_SRC_URI="${GCC_SRC_URI} $(gentoo_urls gcc-${PATCH_GCC_VER}-patches-${PATCH_VER}.tar.bz2)"
+       [[ -n ${UCLIBC_VER} ]] && GCC_SRC_URI+=" $(gentoo_urls gcc-${UCLIBC_GCC_VER}-uclibc-patches-${UCLIBC_VER}.tar.bz2)"
+       [[ -n ${PATCH_VER} ]] && GCC_SRC_URI+=" $(gentoo_urls gcc-${PATCH_GCC_VER}-patches-${PATCH_VER}.tar.bz2)"
 
        # strawberry pie, Cappuccino and a Gauloises (it's a good thing)
        [[ -n ${PIE_VER} ]] && \
                PIE_CORE=${PIE_CORE:-gcc-${PIE_GCC_VER}-piepatches-v${PIE_VER}.tar.bz2} && \
-               GCC_SRC_URI="${GCC_SRC_URI} $(gentoo_urls ${PIE_CORE})"
+               GCC_SRC_URI+=" $(gentoo_urls ${PIE_CORE})"
 
        # gcc minispec for the hardened gcc 4 compiler
-       [[ -n ${SPECS_VER} ]] && \
-               GCC_SRC_URI="${GCC_SRC_URI} $(gentoo_urls gcc-${SPECS_GCC_VER}-specs-${SPECS_VER}.tar.bz2)"
+       [[ -n ${SPECS_VER} ]] && GCC_SRC_URI+=" $(gentoo_urls gcc-${SPECS_GCC_VER}-specs-${SPECS_VER}.tar.bz2)"
 
        # gcc bounds checking patch
        if [[ -n ${HTB_VER} ]] ; then
                local HTBFILE="bounds-checking-gcc-${HTB_GCC_VER}-${HTB_VER}.patch.bz2"
-               GCC_SRC_URI="${GCC_SRC_URI}
+               GCC_SRC_URI+="
                        boundschecking? (
                                mirror://sourceforge/boundschecking/${HTBFILE}
                                $(gentoo_urls ${HTBFILE})
                        )"
        fi
 
-       # support for the D language
-       [[ -n ${D_VER} ]] && \
-               GCC_SRC_URI="${GCC_SRC_URI} d? ( mirror://sourceforge/dgcc/gdc-${D_VER}-src.tar.bz2 )"
+       [[ -n ${D_VER} ]] && GCC_SRC_URI+=" d? ( mirror://sourceforge/dgcc/gdc-${D_VER}-src.tar.bz2 )"
 
        # >= gcc-4.3 uses ecj.jar and we only add gcj as a use flag under certain
        # conditions
        if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
                if tc_version_is_at_least "4.5" ; then
-                       GCC_SRC_URI="${GCC_SRC_URI}
-                       gcj? ( ftp://sourceware.org/pub/java/ecj-4.5.jar )"
+                       GCC_SRC_URI+=" gcj? ( ftp://sourceware.org/pub/java/ecj-4.5.jar )"
                elif tc_version_is_at_least "4.3" ; then
-                       GCC_SRC_URI="${GCC_SRC_URI}
-                       gcj? ( ftp://sourceware.org/pub/java/ecj-4.3.jar )"
+                       GCC_SRC_URI+=" gcj? ( ftp://sourceware.org/pub/java/ecj-4.3.jar )"
                fi
        fi