public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Justin <jlec@gentoo.org>
To: "Michał Górny" <mgorny@gentoo.org>
Cc: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] RFC: fortran-2.eclass - Support for bin package system without compiler
Date: Thu, 18 Jul 2013 09:28:49 +0200	[thread overview]
Message-ID: <51E79931.5040206@gentoo.org> (raw)
In-Reply-To: <20130718091255.594be68a@gentoo.org>

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

On 18/07/13 09:12, Michał Górny wrote:
>> +
>> +# @FUNCTION: fortran-2_pkg_setup
>> +# @DESCRIPTION:
>> +# Setup functionallity,
>> +# checks for a valid fortran compiler and optionally for its openmp
>> support.
>> +fortran-2_pkg_setup() {
>> + if [[ ${EAPI:-0} -lt 4 ]]; then
> 
> Someone else's going to tell you this, so I'll tell you it first hand:
> EAPI is not guaranteed to be a number and you shouldn't be using
> numerical comparison against it.
> 
> Not that you support any non-numerical EAPI. But then some people who
> fork eclasses in overlays will have to patch it more to support their
> weird EAPIs. And I'm not pointing my finger at anyone in particular.
> 

Doesn't matter to me who is doing crazy things. If I can support it
easily then I will do it.

Next try, which is removes one redundant check.

Thanks for the suggestion.

Index: fortran-2.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/fortran-2.eclass,v
retrieving revision 1.18
diff -u -B -b -u -p -r1.18 fortran-2.eclass
--- fortran-2.eclass  18 Jul 2013 07:03:33 -0000  1.18
+++ fortran-2.eclass  18 Jul 2013 07:28:12 -0000
@@ -203,11 +203,11 @@ _fortran_test_function() {
   fi
 }

-# @FUNCTION: fortran-2_pkg_setup
+# @FUNCTION: _fortran-2_pkg_setup
+# @INTERNAL
 # @DESCRIPTION:
-# Setup functionallity,
-# checks for a valid fortran compiler and optionally for its openmp
support.
-fortran-2_pkg_setup() {
+# _The_ fortran-2_pkg_setup()
+_fortran-2_pkg_setup() {
   for _f_use in ${FORTRAN_NEEDED}; do
       case ${_f_use} in
           always)
@@ -229,6 +229,26 @@ fortran-2_pkg_setup() {
   done
 }

+
+# @FUNCTION: fortran-2_pkg_setup
+# @DESCRIPTION:
+# Setup functionallity,
+# checks for a valid fortran compiler and optionally for its openmp
support.
+fortran-2_pkg_setup() {
+ case ${EAPI:-0} in
+     0|1|2|3)
+         eqawarn "The fortran-2.eclass is going to deprecate support for"
+         eqawarn "EAPI < 4. Please migrate your package to a higher EAPI"
+         eqawarn "or file a bug at https://bugs.gentoo.org"
+         _fortran-2_pkg_setup ;;
+     4|5)
+         if [[ ${MERGE_TYPE} != binary ]]; then
+             _fortran-2_pkg_setup
+         fi
+         ;;
+ esac
+}
+



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

  reply	other threads:[~2013-07-18  7:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-18  7:07 [gentoo-dev] RFC: fortran-2.eclass - Support for bin package system without compiler Justin
2013-07-18  7:12 ` Michał Górny
2013-07-18  7:28   ` Justin [this message]
2013-07-18  8:25     ` [gentoo-dev] " Duncan
2013-07-18  8:44       ` Justin
2013-07-18 15:39         ` Donnie Berkholz
2013-07-18 15:50           ` Justin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51E79931.5040206@gentoo.org \
    --to=jlec@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=mgorny@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox