From 8c478b4f1f1bc933793439c8920271ca52770224 Mon Sep 17 00:00:00 2001 From: Diego Elio Pettenò Date: Wed, 21 Mar 2012 17:12:01 +0000 Subject: Go back to use a variable rather than an array for _LATEST_AUTOMAKE, use versionator eclass to go back to the full version instead, so that it's clear what's going on and other developers don't misread the code. It's only perfect for EAPI >= 0 but it's not broken on EAPI=0 anyway. --- eclass/autotools.eclass | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'eclass/autotools.eclass') diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass index e84474c07f28..7f417ee5321e 100644 --- a/eclass/autotools.eclass +++ b/eclass/autotools.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/autotools.eclass,v 1.126 2012/03/21 08:19:22 ssuominen Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/autotools.eclass,v 1.127 2012/03/21 17:12:01 flameeyes Exp $ # @ECLASS: autotools.eclass # @MAINTAINER: @@ -16,7 +16,7 @@ if [[ ${___ECLASS_ONCE_AUTOTOOLS} != "recur -_+^+_- spank" ]] ; then ___ECLASS_ONCE_AUTOTOOLS="recur -_+^+_- spank" -inherit eutils libtool +inherit eutils libtool versionator # @ECLASS-VARIABLE: WANT_AUTOCONF # @DESCRIPTION: @@ -37,13 +37,11 @@ inherit eutils libtool # @INTERNAL # @DESCRIPTION: # CONSTANT! -# The latest major version/slot of automake available on each arch. #312315 -# If a newer version is stable on any arch, and is NOT reflected in this list, +# The latest major-minor version/slot of automake available on each arch. #312315 +# If a newer slot is stable on any arch, and is NOT reflected in this list, # then circular dependencies may arise during emerge @system bootstraps. -# If you want to force a newer minor version, you can specify the correct -# WANT value by using a colon: [:] # Do NOT change this variable in your ebuilds! -_LATEST_AUTOMAKE=( 1.11.1:1.11 ) +_LATEST_AUTOMAKE=1.11.1 _automake_atom="sys-devel/automake" _autoconf_atom="sys-devel/autoconf" @@ -52,8 +50,15 @@ if [[ -n ${WANT_AUTOMAKE} ]]; then none) _automake_atom="" ;; # some packages don't require automake at all # if you change the "latest" version here, change also autotools_run_tool # this MUST reflect the latest stable major version for each arch! - latest) _automake_atom="|| ( `printf '>=sys-devel/automake-%s ' ${_LATEST_AUTOMAKE[@]/%:*}` )" ;; - *) _automake_atom="=sys-devel/automake-${WANT_AUTOMAKE}*" ;; + latest) + if [[ ${EAPI:-0} != 0 ]]; then + _automake_atom=">=sys-devel/automake-${_LATEST_AUTOMAKE}:$(get_version_component_range 1-2 ${_LATEST_AUTOMAKE})" + else + _automake_atom=">=sys-devel/automake-${_LATEST_AUTOMAKE} =sys-devel/automake-$(get_version_component_range 1-2 ${_LATEST_AUTOMAKE})*" + fi + ;; + *) + _automake_atom="=sys-devel/automake-${WANT_AUTOMAKE}*" ;; esac export WANT_AUTOMAKE fi @@ -346,12 +351,10 @@ autotools_env_setup() { # We do the "latest" → version switch here because it solves # possible order problems, see bug #270010 as an example. if [[ ${WANT_AUTOMAKE} == "latest" ]]; then - local pv - for pv in ${_LATEST_AUTOMAKE[@]/#*:} ; do - # has_version respects ROOT, but in this case, we don't want it to, - # thus "ROOT=/" prefix: - ROOT=/ has_version "=sys-devel/automake-${pv}*" && export WANT_AUTOMAKE="${pv}" - done + # has_version respects ROOT, but in this case, we don't want it to, + # thus "ROOT=/" prefix: + ROOT=/ has_version "=sys-devel/automake-$(get_version_component_range 1-2 ${_LATEST_AUTOMAKE})*" && export WANT_AUTOMAKE="$(get_version_component_range 1-2 ${_LATEST_AUTOMAKE})" + [[ ${WANT_AUTOMAKE} == "latest" ]] && \ die "Cannot find the latest automake! Tried ${_LATEST_AUTOMAKE}" fi -- cgit v1.2.3-65-gdbad