Ignore:
Timestamp:
Jan 19, 2014, 3:21:21 AM (5 years ago)
Author:
jmr@…
Message:

perl5 portgroup: default to 5.16 when perl5 is not installed, remove default perl5.branches value (it needs to be set in the portfile), ensure that perl5.default_branch is a supported value as listed in perl5.branches

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/_resources/port1.0/group/perl5-1.0.tcl

    r112102 r116112  
    3636# perl5.branches: the major perl versions supported by this module. A
    3737#   subport will be created for each. e.g. p5.12-foo, p5.10-foo, ...
     38# perl5.branches must be set in the portfile
    3839# perl5.default_branch: the branch used when you request p5-foo
    3940options perl5.default_branch perl5.branches
    4041default perl5.default_branch {[perl5_get_default_branch]}
    41 # perl5.branches exists here for backward compatibility with old p5 portfiles.
    42 # You should still set it in the portfile.
    43 default perl5.branches {"5.8 5.10 5.12 5.14"}
     42
    4443proc perl5_get_default_branch {} {
    45     global prefix
    46     # use whatever ${prefix}/bin/perl5 was chosen, and if none, fall back to 5.12
     44    global prefix perl5.branches
     45    # use whatever ${prefix}/bin/perl5 was chosen, and if none, fall back to 5.16
    4746    if {![catch {set val [lindex [split [exec ${prefix}/bin/perl5 -V:version] {'}] 1]}]} {
    48         return [join [lrange [split $val .] 0 1] .]
     47        set ret [join [lrange [split $val .] 0 1] .]
    4948    } else {
    50         return 5.12
    51     }
     49        set ret 5.16
     50    }
     51    # if the above default is not supported by this module, use the latest it does support
     52    if {[info exists perl5.branches] && [lsearch -exact ${perl5.branches} $ret] == -1} {
     53        set ret [lindex ${perl5.branches} end]
     54    }
     55    return $ret
    5256}
    5357
Note: See TracChangeset for help on using the changeset viewer.