[MacPorts] #11873: Need alternate floating point version comparison function for perl5 portgroup ports

MacPorts noreply at macports.org
Tue Apr 6 15:42:54 PDT 2010


#11873: Need alternate floating point version comparison function for perl5
portgroup ports
---------------------------------+------------------------------------------
 Reporter:  vinc17@…             |       Owner:  macports-tickets@…                   
     Type:  defect               |      Status:  new                                  
 Priority:  Normal               |   Milestone:  MacPorts 1.9.0                       
Component:  base                 |     Version:                                       
 Keywords:                       |        Port:                                       
---------------------------------+------------------------------------------
Changes (by raimue@…):

 * cc: raimue@… (added)


Comment:

 Instead of inventing a different comparison function, we should just
 convert the version number to something compatible. The rpm-based Linux
 distribution Mandriva does this as of 2009. As we are using the same rpm
 version comparison algorithm, this would be compatible. They are using a
 macro %perl_convert_version which would be equivalent to:

 {{{
 $ perl -Mversion -le '$v=version->new(1.337)->normal; $v=~s/^v//; print
 $v'
 }}}

 For more information refer to `perldoc version`.

 I propose that `perl5.setup` in the perl5 PortGroup should convert the
 version and set the `version` option converted. Additionally there could
 be a `perl5.module_version` variable local to the Portfile for use at
 other places in the Portfile (`perl5.version` is already in use).
 {{{
 perl5.setup Foo-Bar 1.337
 # => name p5-foo-bar
 # => version 1.337.0
 # => perl5.module_version 1.337
 }}}

 {{{
 perl5.setup Foo-Bar 1.4
 # => name p5-foo-bar
 # => version 1.400.0
 # => perl5.module_version 1.4
 }}}

 There needs to be a decision if we want to call out to the perl binary for
 this conversion or if we should implement the same in Tcl or C.

-- 
Ticket URL: <http://trac.macports.org/ticket/11873#comment:19>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list