2009-05-22

rationalizing perl module versions

versioning sucks. nobody agrees on what version numbers should look like. everybody has some good reasons not to like a given scheme. and i would say that everybody is right - at least from their point of view.

if you throw in the way that perl deals with version (used by cpan and cpanplus), you add more fuzzyness to the whole thing. eg, 1.40 is supposed to be more recent than 1.300 (yes, 1.40 is understood as 1.400). and i won't even talk of digits 3 to 6, or developer releases...

add to that developers who change their versioning scheme every now and then, or the ones who knows the way perl works and use 2 or 3 digits after the dot (yes module::starter, i'm staring at you - but you're not the only one)...

yup, versioning is a nightmare for packagers. this sucks.

so, after some time bugging mandriva admins, we finally have a shiny rpm macro %perl_convert_version that normalizes perl versions to a x.y.z scheme. here is its content for whoever is interested:

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

and we're going to use it on all perl modules packaged by mandriva. yes, this means that the rpm version will potentially be different than the upstream version on cpan. but that's the price to pay to have rpm and other non-perl aware tools to work correctly.

for the migration to be as smooth as possible, the following needs to be done:
  1. push the rpm macro on mandriva build system. done.
  2. fix cpanplus::dist::mdv to use it.
  3. update youri's update check to recognize it.
  4. update mdvsys to recognize it during mdvsys update.
  5. fix our perl packages spec files.
in order to move on, i'm therefore happy to announce that cpanplus::dist::mdv 1.1.0 has been released, which (among other changes), now uses the rpm macro %perl_convert_version. that's one ticked off the list. :-)

No comments:

Post a Comment