Posts Tagged as ‘perl’

July 15, 2009

Using gettext with Perl

We added gettext support for the Perl code in libguestfs today. We used libintl-perl which is pleasantly simple to use, and works well with our existing C-based i18n infrastructure.
To translate a file, we just add this at the top:

use Locale::TextDomain ‘libguestfs’;

and we mark strings as potentially translatable just by prefixing them with a double [...]

April 27, 2009

Stuck

Somedays I just spend the time going round in circles, and this was one of those days. Not really for lack of work, but lack of knowing the Right Thing to do. Below I’ll describe the problem I had today.
If you look at a virtual machine from the point of view of libvirt, [...]

April 8, 2009

libguestfs perl bindings

You can now use Perl to examine and modify virtual machine disk images through libguestfs, as in this example:

#!/usr/bin/perl -w
use strict;
use Sys::Guestfs;

# Look for LVM LVs, VGs and PVs in a guest image.

die “Usage: lvs.pl guest.img\n” if @ARGV != 1 || ! -f $ARGV[0];

my $h = Sys::Guestfs->new ();
$h->add_drive ($ARGV[0]);

print “Launching, this can take a few [...]

April 7, 2009

libguestfs: LVM support

libguestfs is the library I’m writing that lets you examine and modify any virtual machine disk image, offline or online.
I spent about 18 hours finding a bug in the LVM parsing code, but that bug has now been squashed and as of version 0.4 on the website you can examine PVs, VGs and LVs, as [...]

March 6, 2009

auto-buildrequires

I just pushed a new release of auto-buildrequires, a super little tool for finding the BuildRequires that your package needs automatically. Just replace rpmbuild with auto-br-rpmbuild:

$ auto-br-rpmbuild -ta auto-buildrequires-0.9.tar.gz
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.wphzM5
[ lots of stuff here ... ]
+ exit 0
BuildRequires: bash = 3.2.30.fc10.x86_64
BuildRequires: binutils = 2.18.50.0.9.8.fc10.x86_64
BuildRequires: coreutils = 6.12.19.fc10.x86_64
BuildRequires: cpio = 2.9.90.2.fc10.x86_64
BuildRequires: diffutils = [...]