perl5 portgroup

Bradley Giesbrecht pixilla at macports.org
Tue Sep 4 18:05:55 PDT 2012


This perl5 portgroup proc does not handle this version correctly:

# convert a floating point version to an dotted-integer one
proc perl5_convert_version {vers} {
    set index [string first . $vers]
    set other_dot [string first . [string range $vers [expr $index + 1] end]]
    if {$index == -1 || $other_dot != -1} {
        return $vers
    }
    set ret [string range $vers 0 [expr $index - 1]]
    incr index
    set fractional [string range $vers $index end]
    set index 0
    while {$index < [string length $fractional] || $index < 6} {
        set sub [string range $fractional $index [expr $index + 2]]
        if {[string length $sub] < 3} {
            append sub [string repeat "0" [expr 3 - [string length $sub]]]
        }
        append ret ".[scan $sub %u]"
        incr index 3
    }
    return $ret
}
set perl5.moduleversion 1.03ii
puts [perl5_convert_version ${perl5.moduleversion}]
1.3.{}


Manually setting the version after "perl5.setup" fixes the problem.

I was wondering if there is any code in base or another portgroup that might handle this better.

Would simply shifting a run of alpha characters off the right at the beginning and adding them back the result at the end work?


Regards,
Bradley Giesbrecht (pixilla)

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


More information about the macports-dev mailing list