[112183] trunk/base/src/macports1.0/macports.tcl

Jeremy Huddleston Sequoia jeremyhu at macports.org
Tue Oct 15 08:48:00 PDT 2013


On Oct 15, 2013, at 8:36, Joshua Root <jmr at macports.org> wrote:

> On 2013-10-16 02:21 , James Berry wrote:
>> 
>> On Oct 15, 2013, at 8:02 AM, Jeremy Huddleston Sequoia <jeremyhu at macports.org> wrote:
>>> On Oct 15, 2013, at 3:36, Rainer Müller <raimue at macports.org> wrote:
>>>> The question would be whether we want macosx_version to story "10.X"
>>>> only as it did before or fix the comparisons to use version comparison.
>>> 
>>> We should fix the comparisons.
>>> 
>>>> Writing this condition as
>>>> [vercmp $macosx_version 10.5] >= 0 && [vercmp $macosx_version 10.6] < 0
>>>> seems a bit cumbersome.
>>> 
>>> Cumbersome yet correct.
>> 
>> Maybe we just need to add a new version comparison verb, like vercmp_major_minor that compares only the major and minor segments of the version.This would accomplish both goals I think: simplify the version comparison while still allowing us to keep the full version around for “correctness”.
> 
> It's not a matter of "correct" or "incorrect", we get to define what the
> variable should mean. I can only guess that Jeremy thinks it should
> contain the full version by analogy with os.version?

Yes, exactly.

> If that's the case,
> then we could add a new variable analogous to os.major that works just
> like macosx_version does now and can be directly compared for equality
> (and used in all the places that macosx_version currently is). Or we
> could not break compatibility with everything that uses macosx_version
> and add a new variable that contains the full OS X version.

If you want to define macosx_version to mean just the "10.x" major version, that's fine.  I'm just trying to eliminate the hacky version setting and make things more consistent (and thus more robust).  If you want to keep it the "10.x" major version, then I suggest we still get that data from sw_vers rather than hacky math of the major os version.

Also, macosx_deployment_target is getting set to just the major version because of this and not the full OS dot version.  This can cause some (minor) differences, but I'm not sure if there are any in practice (certainly not any I can think of off the top of my head) ... just something to be aware of.

--Jeremy

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4145 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20131015/c473efe4/attachment-0001.p7s>


More information about the macports-dev mailing list