Gentoo Archives: gentoo-commits

From: "George Shapovalov (george)" <george@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: gnat.eclass
Date: Thu, 26 Mar 2009 09:56:53
Message-Id: E1LmmKR-0000bb-Ar@stork.gentoo.org
1 george 09/03/26 09:56:51
2
3 Modified: gnat.eclass
4 Log:
5 expanded Ada standard checking to be exact for 1995 also
6
7 Revision Changes Path
8 1.38 eclass/gnat.eclass
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.38&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?rev=1.38&content-type=text/plain
12 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/gnat.eclass?r1=1.37&r2=1.38
13
14 Index: gnat.eclass
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v
17 retrieving revision 1.37
18 retrieving revision 1.38
19 diff -u -r1.37 -r1.38
20 --- gnat.eclass 12 Jan 2009 22:55:53 -0000 1.37
21 +++ gnat.eclass 26 Mar 2009 09:56:51 -0000 1.38
22 @@ -1,6 +1,6 @@
23 # Copyright 1999-2004 Gentoo Foundation
24 # Distributed under the terms of the GNU General Public License v2
25 -# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.37 2009/01/12 22:55:53 maekke Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/gnat.eclass,v 1.38 2009/03/26 09:56:51 george Exp $
27 #
28 # Author: George Shapovalov <george@g.o>
29 # Belongs to: ada herd <ada@g.o>
30 @@ -130,18 +130,32 @@
31 # $1 - the requested gnat profile in usual form (e.g. x86_64-pc-linux-gnu-gnat-gcc-4.1)
32 # $2 - Ada standard specification, as would be specified in DEPEND.
33 # Valid values: ada-1995, ada-2005, ada
34 -# Since standard variants are (mostly) backwards-compatible, ada-1995 and
35 -# simply "ada" produce the same results (at least until ada-1983 is adde,
36 -# which is rather unlikely).
37 +#
38 +# This used to treat ada-1995 and ada alike, but some packages (still
39 +# requested by users) no longer compile with new compilers (not the
40 +# standard issue, but rather compiler becoming stricter most of the time).
41 +# Plus there are some "intermediary versions", not fully 2005 compliant
42 +# but already causing problems. Therefore, now we do exact matching.
43 belongs_to_standard() {
44 # debug-print-function $FUNCNAME $*
45 . ${GnatCommon} || die "failed to source gnat-common lib"
46 - if [[ $2 == 'ada' ]] || [[ $2 == 'ada-1995' ]]; then
47 + local GnatSlot=$(get_gnat_SLOT $1)
48 + local ReducedSlot=${GnatSlot//\./}
49 + #
50 + if [[ $2 == 'ada' ]] ; then
51 # debug-print-function "ada or ada-1995 match"
52 return 0 # no restrictions imposed
53 - elif [[ "$2" == 'ada-2005' ]]; then
54 - local GnatSlot=$(get_gnat_SLOT $1)
55 - local ReducedSlot=${GnatSlot//\./}
56 + elif [[ "$2" == 'ada-1995' ]] ; then
57 + if [[ $(get_gnat_Pkg $1) == "gcc" ]]; then
58 +# debug-print-function "got gcc profile, GnatSlot=${ReducedSlot}"
59 + [[ ${ReducedSlot} -le "42" ]] && return 0 || return 1
60 + elif [[ $(get_gnat_Pkg $1) == "gpl" ]]; then
61 +# debug-print-function "got gpl profile, GnatSlot=${ReducedSlot}"
62 + [[ ${ReducedSlot} -lt "41" ]] && return 0 || return 1
63 + else
64 + return 1 # unknown compiler encountered
65 + fi
66 + elif [[ "$2" == 'ada-2005' ]] ; then
67 if [[ $(get_gnat_Pkg $1) == "gcc" ]]; then
68 # debug-print-function "got gcc profile, GnatSlot=${ReducedSlot}"
69 [[ ${ReducedSlot} -ge "43" ]] && return 0 || return 1