2009-11-25

announcing git plugin for dist-zilla

pushing lazyness even further, i released a git plugin for dist-zilla. in fact, there are 4 plugins within the distribution. they are kicking in during dzil release, since i've hacked dzil to provide beforerelease and afterrelease roles.

dzp:git:check - this plugin checks that git is in a clean state before releasing. the following checks are performed before releasing:
  • there should be no files in the index (staged copy)
  • there should be no untracked files in the working copy
  • the working copy should be clean. the changelog and dist.ini can be modified locally, though.
if those conditions are not met, the plugin will die, and the release will thus be aborted. this lets you fix the problems before continuing.

dzp:git:commit - once the release is done, this plugin will commit in git if needed changelog and dist.ini (which is a valid target if you happen to set the version manually in it). the commit message will be taken from the changelog for this release.

dzp:git:tag - once the release is done, this plugin will record this fact in git by creating a tag named v$VERSION.

dzp:git:push - once the release is done, this plugin will push current git branch to remote end, with the associated tags.

if you want to use all those neat plugins, you may want to use the git plugin bundle by writing in your dist.ini:
[@Git]
there, one more thing that dzil is doing for me... no more time lost doing those tedious steps - if you're lazy, you should really try it! as usual, comments and feature requests are welcome.

2009-11-18

sweetening tk

after discovering how to sweeten moose with moosex::has::sugar, i thought the concept could be extended for other modules.

as a tk enthusiast, this was a logical target. especially since i was already kind of doing this with some internal modules exporting variables. so i decided to just extract this piece of code, update it and wrap it in a new module, tk::sugar.

so, where previously you were doing:
you can now write:

which is way better imo.

of course, the module supports lots of other often-used helper subs - check the doc for more information. and if you need some more, either request them or clone the repository and send pull requests! in the meantime, enjoy it...

2009-11-14

sweetening moose

even if moose is nice and allows to prune a lot of code, it can still be seen as cryptic. take the following example, and imagine that you have a lot more attributes to declare:

the first thing that can be done is using moose builtin types instead of their name, with moosex::types::moose. this allows to remove the quotes around the types:

but that's still a bit mouthful. enters moosex::has::sugar, for a nicer code:

your code is now more readable - yet some other modules that i'll now use in my dists...

2009-11-09

cpan activity

with mandriva linux 2010.0 out, it's time to have a look at cpan activity once again.

version freeze happened on october 1st for mandriva, at which point it wasn't possible to upload new version - unless to fix a bug preventing usage. since we know that cpan modules don't have such bugs[0], it means that almost no perl package was updated till cooker[1] reopening (which happened on november 6th).

so, how many dists needed an update after ~40 days? around 150. yes, 150. on 1685 distributions shipped by mandriva. and some of those were updated more than once...

that's ~10%. a bit less than what was reported in april for mandriva 2009.1, but:
  • this time it's for whole mandriva, not only the packages i'm responsible for
  • freeze was a bit longer for 2009.1
yet another proof of perl community's health.

[0] :-)
[1] cooker is mandriva's development version

2009-11-03

the state of perl in mandriva 2010

mandriva linux 2010 is out... this is thus a good time to have a look at the state of perl in this release.

adelie (mdv 2010 codename) ships perl 5.10.1 with threads[0], which allowed me to drop half the patches carried within mandriva[1]. and since perl 5 porters hope to make perl 5 releases more often, it means that (hopefully) i'll be able to trim down those patches even more!

on the modules front, mandriva is shipping plenty of them. padre 0.47 (and lots of plugins), moose, poe framework (and lots of components), devel modules, dbi drivers, gui (tk, wx, gtk) and various lib bindings, you name it... using book's pearl of wisdom, this gives us[2]:
12117 installed modules
including 11016 from cpan (15.65% of cpan)
that is 1685 distributions (8.88% of cpan)
that's not half of cpan, but a good deal nevertheless. chances are that you will find the module you need - and if you don't, drop me a mail or open a request and i'll package it for you.

but the biggest change that you will see in mandriva 2010 regarding perl (well, maybe you won't even notice it), is the new standardized version scheme forced upon all perl modules. for example, dist-zilla version 1.092680 is shipped for mandriva 2010 in rpm perl-Dist-Zilla-1.92.680. yes, i know, it means that the mandriva version might differ from upstream version. yes, i am aware that this sucks. yes, i am also aware that there's no real way to get upstream version back from mandriva rpm version. and no, i don't plan to roll back this change - unless you have another miracle solution that deals with rpm not understanding cpan modules changing their versioning scheme without bumping their major (grrr!).

however, note that previous mandriva version (and fedora too) already mangled some modules version, but not all of them - which is even worse imo. since i agree with david that version numbers should be boring, all modules now have their version mangled. no ifs, no buts, we're mangling it. and it makes life easier for us packagers...

of course, the modules' code is not affected by this change. it's only the packaging that changed a bit. to check which version is installed, just check the $VERSION of this package. that's always been, and remains, the only safe way to be sure. eg:
$ perl -E 'for (@ARGV){eval "require $_"; say "$_\t",$_->VERSION if !$@}' Dist::Zilla
Dist::Zilla 1.092680
on the parrot front, we're shipping 1.6.0 (1.7.0 was too late to be included). and rakudo is still not present, since it cannot use an installed parrot.

all in all, that's a quite a good release on the perl front. if you add all the work that went in all other areas, mandriva 2010 will be quite a solid release. i invite you to test it out - who knows, you might even like it so much that you'll switch to it permanently! :-)

[0] no need to complain, rgs - i know your feelings about it.
[1] yup, i took the ownership of the perl package - silly me...
[2] why, yes, i install all perl modules available as rpm on my box :-)