1 |
On 18/07/13 09:12, Michał Górny wrote: |
2 |
>> + |
3 |
>> +# @FUNCTION: fortran-2_pkg_setup |
4 |
>> +# @DESCRIPTION: |
5 |
>> +# Setup functionallity, |
6 |
>> +# checks for a valid fortran compiler and optionally for its openmp |
7 |
>> support. |
8 |
>> +fortran-2_pkg_setup() { |
9 |
>> + if [[ ${EAPI:-0} -lt 4 ]]; then |
10 |
> |
11 |
> Someone else's going to tell you this, so I'll tell you it first hand: |
12 |
> EAPI is not guaranteed to be a number and you shouldn't be using |
13 |
> numerical comparison against it. |
14 |
> |
15 |
> Not that you support any non-numerical EAPI. But then some people who |
16 |
> fork eclasses in overlays will have to patch it more to support their |
17 |
> weird EAPIs. And I'm not pointing my finger at anyone in particular. |
18 |
> |
19 |
|
20 |
Doesn't matter to me who is doing crazy things. If I can support it |
21 |
easily then I will do it. |
22 |
|
23 |
Next try, which is removes one redundant check. |
24 |
|
25 |
Thanks for the suggestion. |
26 |
|
27 |
Index: fortran-2.eclass |
28 |
=================================================================== |
29 |
RCS file: /var/cvsroot/gentoo-x86/eclass/fortran-2.eclass,v |
30 |
retrieving revision 1.18 |
31 |
diff -u -B -b -u -p -r1.18 fortran-2.eclass |
32 |
--- fortran-2.eclass 18 Jul 2013 07:03:33 -0000 1.18 |
33 |
+++ fortran-2.eclass 18 Jul 2013 07:28:12 -0000 |
34 |
@@ -203,11 +203,11 @@ _fortran_test_function() { |
35 |
fi |
36 |
} |
37 |
|
38 |
-# @FUNCTION: fortran-2_pkg_setup |
39 |
+# @FUNCTION: _fortran-2_pkg_setup |
40 |
+# @INTERNAL |
41 |
# @DESCRIPTION: |
42 |
-# Setup functionallity, |
43 |
-# checks for a valid fortran compiler and optionally for its openmp |
44 |
support. |
45 |
-fortran-2_pkg_setup() { |
46 |
+# _The_ fortran-2_pkg_setup() |
47 |
+_fortran-2_pkg_setup() { |
48 |
for _f_use in ${FORTRAN_NEEDED}; do |
49 |
case ${_f_use} in |
50 |
always) |
51 |
@@ -229,6 +229,26 @@ fortran-2_pkg_setup() { |
52 |
done |
53 |
} |
54 |
|
55 |
+ |
56 |
+# @FUNCTION: fortran-2_pkg_setup |
57 |
+# @DESCRIPTION: |
58 |
+# Setup functionallity, |
59 |
+# checks for a valid fortran compiler and optionally for its openmp |
60 |
support. |
61 |
+fortran-2_pkg_setup() { |
62 |
+ case ${EAPI:-0} in |
63 |
+ 0|1|2|3) |
64 |
+ eqawarn "The fortran-2.eclass is going to deprecate support for" |
65 |
+ eqawarn "EAPI < 4. Please migrate your package to a higher EAPI" |
66 |
+ eqawarn "or file a bug at https://bugs.gentoo.org" |
67 |
+ _fortran-2_pkg_setup ;; |
68 |
+ 4|5) |
69 |
+ if [[ ${MERGE_TYPE} != binary ]]; then |
70 |
+ _fortran-2_pkg_setup |
71 |
+ fi |
72 |
+ ;; |
73 |
+ esac |
74 |
+} |
75 |
+ |