[107013] trunk/dports/devel

Dennis van Dok dennisvd at nikhef.nl
Wed Jun 19 07:35:51 PDT 2013


On 16-06-13 06:58, Ryan Schmidt wrote:
> On Jun 15, 2013, at 23:28, Adam Mercer <ram at macports.org> wrote:
> 
>> On Sat, Jun 15, 2013 at 8:29 PM, Ryan Schmidt <ryandesign at macports.org> wrote:
>>
>>>> Added: trunk/dports/devel/globus-core/Portfile
[...]
>>> At the time this line is run, you cannot assume that perl has already been installed.
>>
>> Is there any way that we can get this information?
> 
> You can run the command yourself on the command line, for the version
> of perl that you want globus-core to use, and then put that value
> into the portfile (modulo using ${prefix} as usual).
> The problem with trying to run it in the portfile is that it's not
> predictable or repeatable: it depends on what "perl" is. Via the
> variants of the perl5 port, that can vary on the user's system, or as
> I mentioned, in the extreme case of not having perl5 installed at
> all, "perl" is "/usr/bin/perl". That's in fact what happens on the
> buildbot, because the buildbot never has any ports installed prior to
> a build. (All ports are uninstalled after every build.) So on the
> buildbot, 'sh -c "eval \"\`perl -V:installvendorlib\`\" ; echo
> \$installvendorlib"' is '/Network/Library/Perl/5.12'. 

Can I use this code from the perl5 portGroup:

in /opt/local/var/macports/sources/rsync.macports.org/release/ports/_resources/port1.0/group/perl5-1.0.tcl:

proc perl5_get_default_branch {} {
    global prefix
    # use whatever ${prefix}/bin/perl5 was chosen, and if none, fall back to 5.12
    if {![catch {set val [lindex [split [exec ${prefix}/bin/perl5 -V:version] {'}] 1]}]} {
        return [join [lrange [split $val .] 0 1] .]
    } else {
        return 5.12
    }
}

This logic seems pretty safe even if perl is not installed. The only thing that bugs me is that
the version returned is 5.12.4 and not 5.12.

Thanks,

Dennis



More information about the macports-dev mailing list