public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [RFC] Update toolchain.eclass to deal with .xz compressed tarball for gcc-6.4.0
@ 2017-08-02 20:52 Anthony G. Basile
  2017-08-02 21:00 ` Mike Gilbert
  0 siblings, 1 reply; 3+ messages in thread
From: Anthony G. Basile @ 2017-08-02 20:52 UTC (permalink / raw)
  To: Gentoo Development

[-- Attachment #1: Type: text/plain, Size: 559 bytes --]

Hi everyone,

Upstream gnu.org used to provide .gz and .bz2 compressed tarballs for
gcc's source code.  With gcc-6.4.0 however, they only provide .gz and
.xz.  Our toolchain.eclass is written only for .bz2.  I'd like to commit
the attached patch to deal with this change.  A better fix would
autodetect whether upstream has .bz2 or .xz but I'm not sure how to
proceed with that.

-- 
Anthony G. Basile, Ph.D.
Gentoo Linux Developer [Hardened]
E-Mail    : blueness@gentoo.org
GnuPG FP  : 1FED FAD9 D82C 52A5 3BAB  DC79 9384 FA6E F52D 4BBA
GnuPG ID  : F52D4BBA

[-- Attachment #2: update-toolchain.patch --]
[-- Type: text/plain, Size: 1607 bytes --]

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index db6e643148c..3114bd85832 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -320,7 +320,11 @@ get_gcc_src_uri() {
        elif [[ -n ${SNAPSHOT} ]] ; then
                GCC_SRC_URI="ftp://gcc.gnu.org/pub/gcc/snapshots/${SNAPSHOT}/gcc-${SNAPSHOT}.tar.bz2"
        else
-               GCC_SRC_URI="mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_RELEASE_VER}.tar.bz2"
+               if tc_version_is_between 6.4.0 7 ;  then
+                       GCC_SRC_URI="mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_RELEASE_VER}.tar.xz"
+               else
+                       GCC_SRC_URI="mirror://gnu/gcc/gcc-${GCC_PV}/gcc-${GCC_RELEASE_VER}.tar.bz2"
+               fi
                # we want all branch updates to be against the main release
                [[ -n ${BRANCH_UPDATE} ]] && \
                        GCC_SRC_URI+=" $(gentoo_urls gcc-${GCC_RELEASE_VER}-branch-update-${BRANCH_UPDATE}.patch.bz2)"
@@ -424,7 +428,11 @@ gcc_quick_unpack() {
        elif [[ -n ${SNAPSHOT} ]] ; then
                unpack gcc-${SNAPSHOT}.tar.bz2
        elif [[ ${PV} != *9999* ]] ; then
-               unpack gcc-${GCC_RELEASE_VER}.tar.bz2
+               if tc_version_is_between 6.4.0 7 ;  then
+                       unpack gcc-${GCC_RELEASE_VER}.tar.xz
+               else
+                       unpack gcc-${GCC_RELEASE_VER}.tar.bz2
+               fi
                # We want branch updates to be against a release tarball
                if [[ -n ${BRANCH_UPDATE} ]] ; then
                        pushd "${S}" > /dev/null

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] [RFC] Update toolchain.eclass to deal with .xz compressed tarball for gcc-6.4.0
  2017-08-02 20:52 [gentoo-dev] [RFC] Update toolchain.eclass to deal with .xz compressed tarball for gcc-6.4.0 Anthony G. Basile
@ 2017-08-02 21:00 ` Mike Gilbert
  2017-08-02 21:09   ` Anthony G. Basile
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Gilbert @ 2017-08-02 21:00 UTC (permalink / raw)
  To: Gentoo Dev

On Wed, Aug 2, 2017 at 4:52 PM, Anthony G. Basile <blueness@gentoo.org> wrote:
> Hi everyone,
>
> Upstream gnu.org used to provide .gz and .bz2 compressed tarballs for
> gcc's source code.  With gcc-6.4.0 however, they only provide .gz and
> .xz.  Our toolchain.eclass is written only for .bz2.  I'd like to commit
> the attached patch to deal with this change.  A better fix would
> autodetect whether upstream has .bz2 or .xz but I'm not sure how to
> proceed with that.

Another option would be to move the SRC_URI setting code into the
individual ebuilds, instead of setting it in the eclass.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] [RFC] Update toolchain.eclass to deal with .xz compressed tarball for gcc-6.4.0
  2017-08-02 21:00 ` Mike Gilbert
@ 2017-08-02 21:09   ` Anthony G. Basile
  0 siblings, 0 replies; 3+ messages in thread
From: Anthony G. Basile @ 2017-08-02 21:09 UTC (permalink / raw)
  To: gentoo-dev

On 8/2/17 5:00 PM, Mike Gilbert wrote:
> On Wed, Aug 2, 2017 at 4:52 PM, Anthony G. Basile <blueness@gentoo.org> wrote:
>> Hi everyone,
>>
>> Upstream gnu.org used to provide .gz and .bz2 compressed tarballs for
>> gcc's source code.  With gcc-6.4.0 however, they only provide .gz and
>> .xz.  Our toolchain.eclass is written only for .bz2.  I'd like to commit
>> the attached patch to deal with this change.  A better fix would
>> autodetect whether upstream has .bz2 or .xz but I'm not sure how to
>> proceed with that.
> 
> Another option would be to move the SRC_URI setting code into the
> individual ebuilds, instead of setting it in the eclass.
> 

I would still have problems with the unpack which I can't override.



Also, [Arfrever] on IRC suggested that instead of

if tc_version_is_between 6.4.0 7 ;  then

I use

if tc_version_is_between 5.5 6 || tc_version_is_between 6.4 7 ||
tc_version_is_at_least 7.2 ; then

to better future proof the code.  The assumption here being that gnu.org
will continue using .xz instead of .bz2 going forward which seems
reasonable.

-- 
Anthony G. Basile, Ph.D.
Gentoo Linux Developer [Hardened]
E-Mail    : blueness@gentoo.org
GnuPG FP  : 1FED FAD9 D82C 52A5 3BAB  DC79 9384 FA6E F52D 4BBA
GnuPG ID  : F52D4BBA


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-02 21:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-02 20:52 [gentoo-dev] [RFC] Update toolchain.eclass to deal with .xz compressed tarball for gcc-6.4.0 Anthony G. Basile
2017-08-02 21:00 ` Mike Gilbert
2017-08-02 21:09   ` Anthony G. Basile

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox