Archive for January, 2011

CDDBeditor

2011/01/30

I’ve been upset these last monthes by the fact that my usual applications which were allowing me to publish on FreeDB CDs content were not working anymore. I was using kscd from the KDE project, but the latest version with KDE 4.x is just not interesting anymore, with that feature having disappeared.

Same for audex which doesn’t provide it. Grip is Gnome based and doesn’t allow for category edition.

Too bad as it’s an area where a graphical tool is very interesting in general.

So, I decided to write a small tool to help me doing that. So here is CDDBeditor. Not a nice and fancy tool. But it provides to me what I need: CDDB data edition and re-send by mail.

It’s perl based (always a good way to lear), based on the CDDB_get CPAN module for the CDDB features, and also uses Newt, as a way to learn how to use this environment. It could be very seful for future versions of project-builder.org or even MondoRescue.

I use it since August 2009, and to my great surprise, I remarked that I was among the best contributors to Freedb.org with it !! More over, as I’m alone to use it (well I think so at least ;-)) I now know I created 274 entries in FreeDB last year with it. Still far from all the CD for which I got an entry already entered previously by others in FreeDB,but my small stone to the whole wall.

Advertisements

Project-Builder.org: 0.10.1 published and next steps

2011/01/20

So, finally Project-Builder.org 0.10.1 has been published.

A lot has been done in that version, so look at the ChangeLogs files for details. In particular, that version of pb is not backward compatible with the previous one, thus the change of version (from 0.9 to 0.10). Which also means that it is highly recommended to update your VMs/VEs with that new version of pb with the setupvm|ve command.

Another incompatibility is with the cms2* commands which now really take the content of the CMS/VCS not the sandbox status. In order to get the previous behaviour, please use the sbx2* commands instead. man pb is probably helpful 😉 In particular, if you build from files (via http/ftp) and not a VCS, you’ll have to use the new sbx commands to have your package build correctly, as there is no CMS in that case.

This version now supports parallelism during the sbx|cms2build, sbx|cms|build2vm|ve phases which can drastically reduce build time for packages. For this to work, as explained earlier, you need the perl module Parallel::ForkManager installed on your system. The VMs|VEs may benefit from it but it is not required, and only useful if you have lots of cores on your host, to enable multi-cpus VM|VEs.

A small bug has been found post-release for those of you using the announce command. What ? nobody ranted ? Well, as I’m probably the only one using that feature, sounds obvious 😉

I’ll now also work more with my FOSSology colleagues to help them produce packages for their just announced 1.3.0 version with pb.

More interesting is what will come next: As part of our joint work with Intel in our Solution Center, Project-Builder.org is part of a new solution stack we’re developing with their collaboration around RISC/Unix to IA/Linux migration. Continuous packaging was identified as a key aspect, and helping our customers support multiple platforms in parallel is indeed very useful. So it was agreed, also following an internal presentation and some surveys made during it, that our next supported platform had to be HP-UX.

So I’m working with the help of Josh Zhao on adding this, and this is expected for 0.10.2. And another colleague Nicolas Doualot is helping setting up a demo environment to showcase our Continuous Packaging approach.

Signing packages is also high on my list, but is still a problem on RPM based distro. Hopefully I’ll be able to come up with a solution after some FOSDEM discussions !

Using Thunderbird as default mail reader with KDE4

2011/01/13

Just a small hint (this page serves as a reminder for me mainly) for using Thunderbird as default mail reader with KDE4. You may run the systemsettings command (or click on it in the KDE panel), select the mail client entry and type the following line for thunderbird:


/usr/bin/thunderbird -compose "subject=%s,cc=%c,to=%t,attachment=%A"

Works like a charm here. Reference doc is at https://developer.mozilla.org/en/Command_Line_Options and also by letting the mouse over the text box where you have to pass that text.
Typically OpenOffice.org which uses on Mandriva 2010.1 by default the xdg-menu entry for the default mail reader just does the right thing when ask to send by mail the current document.

Migrating from KMail to Thunderbird

2011/01/10

This week-end, after passing too much time to try to understand contact management in KMail (which was working quite well in KDE 3.x but is completely flawed IMHO in KDE 4.x), I decided with my wife it was time after 8+ years to try another mail reader.

Thunderbird was of course the first candidate, due to the familiarity she had with Firefox, Outlook (at school) and the fact it’s not that different from KMail anyway in its behavior and interface. I must say I was impressed to see my wife just say that she didn’t mind changing Mail reader, in order to get lacking features. Probably her familiarity with Open Source has also created an open mind for computing programs, and the fact she already uses multiple tools without major issue, makes her willing to try new ones.

So I started to work migrating her data from KMail to TB. I found a small program in order to help md2mb.pl. However, it was far from being complete, and I decided to rewrite a new one, based on the ideas from the other one, in order to have a better migration support. So here is a new md2mb.pl which hopefully will be useful for others as well.


#!/usr/bin/perl -w
#
# Program to import a maildir kmail environement into a thunderbird one.
# (c) Bruno Cornec under the GPLv2.

use strict;
use File::Find;
use File::Copy;
use File::Basename;
use File::Path;

my $cmd="formail";
# CHANGE AS YOU WISH
my $oldroot = "/beatrice/.Mail.sav";
my $newroot = "/beatrice/.thunderbird/30cq2rn3.default/Mail/Local Folders/";
# Is the newroot a file (1) or a dir (0)
my $nrisfile = 0;
my $debug = 0;
# END CHANGE

$debug++ if ((defined $ARGV[0]) && ($ARGV[0] eq "-v"));
print "DEBUG MODE, not doing anything, just printing\n" if ($debug);
if ($debug) {
print "CMD1: mkdir -p $newroot\n" if ((not -d "$newroot") && (not $nrisfile));
} else {
mkpath("$newroot",0, 0755) if ((not -d "$newroot") && (not $nrisfile));
}
system("$cmd /dev/null 2>/dev/null") == 0 or die "cannot find formail on your \$PATH!\nAborting";

find(\&md2mb,($oldroot));

sub md2mb {

if (-f $File::Find::name) {
return if (
($File::Find::name =~ /\.ids$/) ||
($File::Find::name =~ /\.sorted$/) ||
($File::Find::name =~ /\.index$/) ||
($File::Find::name =~ /\/cur\//) ||
($File::Find::name =~ /\/new\//) ||
($File::Find::name =~ /\/tmp\//));
}
if (-d $File::Find::name) {
return if (
($File::Find::name =~ /\/cur$/) ||
($File::Find::name =~ /\/new$/) ||
($File::Find::name =~ /\/tmp$/));
}
if ($debug) {
print "CURR: $File::Find::name\n";
}
my $destname = $File::Find::name;
$destname =~ s|^$oldroot||;
$destname =~ s|\.([[:alnum:]éèçàù\s]*)\.directory|$1.sbd|g;
if ($debug) {
print "DEST: $destname\n";
}
my $cdir = dirname("$newroot/$destname");
my $outputfile="$newroot/$destname";
$outputfile="$newroot" if ($destname =~ /^\s*$/);
if (-d $File::Find::name) {

my @files = (,);

if (@files) {
if ($debug) {
print "CMD2: mkdir -p $cdir\n" if (not -d "$cdir");
} else {
mkpath("$cdir",0, 0755) if (not -d "$cdir");
}
}
foreach my $file (@files) {
next unless -f $file; # skip non-regular files
next unless -s $file; # skip empty files
next unless -r $file; # skip unreadable files
$file =~ s/'/'"'"'/; # escape ' (single quote)
# NOTE! The output file must not contain single quotes (')!
my $run = "cat '$file' | $cmd >> '$outputfile'";
if ($debug) {
print "CMD3: $run\n";
} else {
print "Copying maildir content from $File::Find::name to $outputfile\n";
system($run) == 0 or warn "cannot run \"$run\".";
}
}
}
if (-f $File::Find::name) {
if ($debug) {
print "CMD2: mkdir -p $cdir\n" if (not -d "$cdir");
print "CMD3: cp $File::Find::name $cdir\n";
} else {
mkpath("$cdir",0, 0755) if (not -d "$cdir");
copy($File::Find::name,$cdir);
print "Copying mailbox content from $File::Find::name to $outputfile\n";
}
}
}

Warning: this code doesn’t work from the blog as wordpress makes some modifications, so download it from here

Run it first with a -v option in order to see what will be done. Be careful as I’ve just fixed the problems I had on my side, but probably not all of them. Especially, take care of file names with “‘” in them. they won’t work well.

So migration has been done, and of course more re-organization of the mailboxes. But now everything works fine, including contact management (that were imported using the LDIF exchange format).

And my wife has already sent a couple of mails, so I guess it will not take her long to be very familiar with TB.

Once again this shows all the power of FLOSS: freedom of choice, no info hidden, open format, and voilà.

project-builder.org: nearly ready for 0.10.1

2011/01/08

Next version of project-builder.org won’t be 0.9.11 as expected ! This is due first to the incompatibilities introduced with 0.9.10. a pb 0.9.10 cannot work in a VE|VM with the current devel version of pb, and the VE|VM will have to be updated with setupve|vm.

Also on top of that quite a new set of features have been added since last version, in particular the parallelism of tasks. After the work on sbx|cms2build, I’ve done now build2pkg and also build2ve. It implied more modifications in order to have each script file generated during the preparation phase unique so that each VE could get it correctly. I’ve tested this night with 2 VEs to build pb packages, and it is now working quite well, and that’s where having a multi-core, multi-thread machine such as min base on a Core i7 Xeon helps a lot aand makes a difference.

The last remaining part is to also add that feature to VMs. I’m very near from it, I just need to handle the fact that communication based on SSH with each VM has to use a different port, whereas now it’s the same for a given project. Hopefully this will be done over the week-end, which will allow publication of the new stable version of pb in sequence.

This feature is also useful for my colleagues working on the FOSSology project to generate packages for their 1.3.0 version on their side.