Ignore:
Timestamp:
Aug 17, 2011, 4:35:05 PM (8 years ago)
Author:
jmr@…
Message:

perl5 portgroup: fix perl5.default_branch for strange ports that use the portgroup but don't call perl5.setup

File:
1 edited

Legend:

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

    r82617 r82654  
    4141options perl5.default_branch perl5.branches
    4242default perl5.branches {"5.8 5.10 5.12 5.14"}
     43default perl5.default_branch {[perl5_get_default_branch]}
     44proc perl5_get_default_branch {} {
     45    # use whatever ${prefix}/bin/perl5 was chosen, and if none, fall back to 5.12
     46    if {![catch {set val [lindex [split [exec ${prefix}/bin/perl5 -V:version] {'}] 1]}]} {
     47        return [join [lrange [split $val .] 0 1] .]
     48    } else {
     49        return 5.12
     50    }
     51}
    4352
    4453proc perl5.extract_config {var {default ""}} {
     
    5564options perl5.version perl5.major perl5.arch perl5.lib perl5.archlib perl5.bin
    5665default perl5.version {[perl5.extract_config version]}
     66default perl5.major {${perl5.default_branch}}
    5767default perl5.arch {[perl5.extract_config archname ${os.platform}]}
    5868default perl5.bin {${prefix}/bin/perl${perl5.major}}
     
    8090    set perl5.module ${module}
    8191    set perl5.moduleversion $vers
    82 
    83     # check if a default version was set, otherwise use whatever
    84     # ${prefix}/bin/perl was chosen, and if none, fall back to 5.12
    85     if {![info exists perl5.default_branch]} {
    86         if {[catch {set val [lindex [split [exec ${prefix}/bin/perl -V:version] {'}] 1]}]} {
    87             perl5.default_branch 5.12
    88         } else {
    89             perl5.default_branch [join [lrange [split $val .] 0 1] .]
    90         }
    91     }
    9292
    9393    # define perl5.cpandir
     
    137137        }
    138138    } else {
    139         perl5.major ${perl5.default_branch}
    140139        depends_lib port:perl${perl5.default_branch}
    141140    }
Note: See TracChangeset for help on using the changeset viewer.