Release Tools

February 28, 2008

I’ve added some more functionality to the new LCFG release tools, in particular you can now use lcfg-reltool via a Makefile with ease.

Here are the setup details:

/* dependencies */

#include <ed/options/moose.h>
!profile.packages     mEXTRA(perl-Data-Structure-Util-0.12-2.fc6\
                                               perl-YAML-Syck-0.82-2.fc6\
                                               perl-UNIVERSAL-require-0.11-1.fc6/noarch\
                                               perl-Devel-Cover-0.61-1.fc6\
                                               perl-Test-Differences-0.47-2.fc6/noarch)

/* the buildtools packages */

!profile.packages     mEXTRA(perl-LCFG-Build-PkgSpec-0.0.4-1/noarch\
                                                perl-LCFG-Build-VCS-0.0.5-1/noarch)

Once you have that installed you just need this in your Makefile:

include lcfg/release.mk

and you can do the usual make release, make majorversion, make minorversion with everything driven from lcfg.yml.

There is still lots more stuff to add to the buildtools suite for LCFG components but this should be quite useful for other software. There have also been changes to the LCFG-Build-PkgSpec toolset, the lcfg-pkgcfg script is now much more useful, here’s a synopsis:

           lcfg-pkgcfg --get=name

           lcfg-pkgcfg --get=name --in ~/cvs/lcfg-foo

           lcfg-pkgcfg --get=name --in ~/cvs/lcfg-foo/lcfg.yml

           lcfg-pkgcfg --set schema=2 --set license=gpl

           lcfg-pkgcfg --skeleton

           lcfg-pkgcfg --skeleton --set name=foo --set version=1.0.0

           lcfg-pkgcfg --in META.yml --out lcfg.yml

First release

February 19, 2008

As part of the buildtools project I’ve now tested and documented LCFG::Build::PkgSpec, here is the RPM and the SRPM. If you want to have a play you will need some extra packages installed on your machine. On DICE FC6 you can use ed/options/moose.h to pull in most of the stuff. You will then need to add these as well:

!profile.packages     mEXTRA(perl-Data-Structure-Util-0.12-2.fc6\
                                       perl-YAML-Syck-0.82-2.fc6\
                                       perl-UNIVERSAL-require-0.11-1.fc6/noarch\
                                       perl-Devel-Cover-0.61-1.fc6\
                                       perl-Test-Differences-0.47-2.fc6/noarch)

At this point the main two useful things to look at are the scripts lcfg-cfg2meta and lcfg-pkgcfg. If you are interested in how to use Moose take a look at LCFG/Build/PkgSpec.pm, hopefully it is fairly clear and not too scary!

One cool thing I have just discovered is that because the lcfg.yml is similar to the META.yml used for Perl modules on CPAN, you can do this to generate a basic LCFG metadata file:

perl -MLCFG::Build::PkgSpec -e '$spec = LCFG::Build::PkgSpec->new_from_metafile("META.yml"); $spec->save_metafile("./lcfg.yml")'

Testing, testing…

February 19, 2008

I’ve been adding tests to one of the Perl modules I have written for the buildtools project. This is for two reasons, firstly, it’s good to have tests for the code as it helps spot bugs and makes it easier to add further functionality safe in the knowledge that none of the earlier work has been broken. Secondly, I wanted to try out a few testing strategies which might be useful when it comes to the LCFG core refactoring project. I have been playing with Devel::Cover which measures how much of the code is covered by the test suite – here’s some results. My initial trials suggest this is quite a good strategy as it encouraged me to think about all the different pathways through the code and it did find one rather nasty bug.


buildtools

February 11, 2008

I’ve now put together a first attempt at the “release tool” part of the LCFG buildtools project. This should allow developers to use a CVS repository and “standard” LCFG/DICE release version practices without being tied into all the other parts of buildtools. This also helps show that switching to a new meta-data file (lcfg.yml) as a replacement for parts of config.mk works rather well.

There is currently a Perl module, LCFG::Build::PkgSpec, which can be used to load and write out the meta-data file, this provides a reasonably nice interface to this specification. For example:

my $spec = LCFG::Build::PkgSpec->new_from_metafile('./lcfg.yml');
print 'Package name is: ' . $spec->name . "\n";
print 'Version Control System is: ' . $spec->get_vcsinfo('type') . "\n";

There is also an interface class for VCS handlers, LCFG::Build::VCS, this specifies what attributes and methods must be implemented. There is currently one Perl module, which supports CVS, which implements all the required functionality, LCFG::Build::VCS::CVS. Hopefully, with a bit of documentation, it will be relatively easy for developers to code a module to support their VCS of choice.

The release tool is used to carry out the three version altering functions previously done via the buildtools Makefile: release, majorversion, minorversion. It supports checking for uncommitted files and generating the ChangeLog file from the VCS log. For example:

lcfg-reltool --release ~/cvs/lcfg-foo
lcfg-reltool --majorversion .

None of this is documented or packaged yet, that’s the next stage, after that I will be looking for early adopters to give it a whirl. To ease adoption I intend to create a tool which will take the config.mk and generate the lcfg.yml meta-file.

Just to note, these modules are written using Moose it’s great!