PaulHowarth/Blog/2008-04-11

Friday 11th April 2008

Local Packages

  • Updated libidn to 1.7

  • Patched weblint to fix some issues it had building on perl 5.10.0 on Rawhide; I've been looking at this on and off for a few weeks now because I don't know perl well and the errors were IMHO quote obscure:

  • + /usr/bin/make test
    PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
    t/font.........
    Bareword "MF_DEFAULT" not allowed while "strict subs" in use at /builddir/build/BUILD/weblint-1.9.3/blib/lib/Weblint/Messages.pm line 438.
    Bareword "MC_ERROR" not allowed while "strict subs" in use at /builddir/build/BUILD/weblint-1.9.3/blib/lib/Weblint/Messages.pm line 12.
    Bareword "MC_WARNING" not allowed while "strict subs" in use at /builddir/build/BUILD/weblint-1.9.3/blib/lib/Weblint/Messages.pm line 12.
    Bareword "MC_STYLE" not allowed while "strict subs" in use at /builddir/build/BUILD/weblint-1.9.3/blib/lib/Weblint/Messages.pm line 12.
    Bareword "MC_INTERNAL" not allowed while "strict subs" in use at /builddir/build/BUILD/weblint-1.9.3/blib/lib/Weblint/Messages.pm line 12.
    Bareword "DISABLED" not allowed while "strict subs" in use at /builddir/build/BUILD/weblint-1.9.3/blib/lib/Weblint/Messages.pm line 20.
    Bareword "MC_STYLE" not allowed while "strict subs" in use at /builddir/build/BUILD/weblint-1.9.3/blib/lib/Weblint/Messages.pm line 20.
    Bareword "DISABLED" not allowed while "strict subs" in use at /builddir/build/BUILD/weblint-1.9.3/blib/lib/Weblint/Messages.pm line 20.
    Bareword "MC_STYLE" not allowed while "strict subs" in use at /builddir/build/BUILD/weblint-1.9.3/blib/lib/Weblint/Messages.pm line 20.
    Bareword "ENABLED" not allowed while "strict subs" in use at /builddir/build/BUILD/weblint-1.9.3/blib/lib/Weblint/Messages.pm line 20.
    ... many more like those ...
  • and having fixed that one, there was this:
  • + /usr/bin/make test
    PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
    t/font.........
    ok
    t/form.........
    Can't use string ("3") as an ARRAY ref while "strict refs" in use at /builddir/build/BUILD/weblint-1.9.3/blib/lib/Weblint.pm line 530, <DATA> chunk 1.
    dubious
            Test returned status 255 (wstat 65280, 0xff00)
    DIED. FAILED tests 1-24
            Failed 24/24 tests, 0.00% okay
  • The fixes were quite simple in the end. The "bareword" problem was due to a missing require Exporter in the package defining the complained-about constants, and the "ARRAY ref" problem was due to using the wrong idiom for dereferencing an array reference:

  • --- weblint-1.9.3/lib/Weblint.pm        1999-04-08 12:46:24.000000000 +0100
    +++ weblint-1.9.3/lib/Weblint.pm        2008-04-11 14:42:48.000000000 +0100
    @@ -525,7 +525,7 @@
         {
            my $i;
     
    -       for ($i=$#{@{ $self->{tags}}}; $self->{tags}->[$i] ne $tag; --$i)
    +       for ($i=$#{ $self->{tags} }; $self->{tags}->[$i] ne $tag; --$i)
            {
            }
            $self->whine('nested-element', $tag, $self->{taglines}->[$i]);
    --- weblint-1.9.3/lib/Weblint/Constants.pm      2008-03-12 18:41:14.000000000 +0000
    +++ weblint-1.9.3/lib/Weblint/Constants.pm      2008-03-12 18:41:55.000000000 +0000
    @@ -12,6 +12,7 @@
     package Weblint::Constants;
     use 5.004;
     use strict;
    +require Exporter;
     
     use vars qw( $VERSION @ISA @EXPORT );
     $VERSION = '';

Testing GUI Applications in Mock

mock is the standard tool for building Fedora packages these days, and provides a convenient way to build RPMs for older or newer distribution releases than the machines you have available. For instance, all of my machines are running Fedora 8 at the moment but by using mock I can build packages for distributions as old as Red Hat Linux 7.3, and also for CentOS 3,4,5. However, what's not as obvious is that mock can also be used to run applications for these distributions so as to test them in their target environments.

For instance, earlier this week I applied a bunch of patches to my bittorrent package and wanted to make sure that the GUI still worked on Fedora Core 4 (basically checking that I hadn't introduced something that relied on newer versions of dependent packages). I used two machines to do this test, the build server (let's call it buildhost) where I built the package, and the display server (let's call it displayhost) where I wanted to view the GUI window.

The first task is to install the package to be tested (and any necessary infrastructure) into the mock chroot on the build server:

$ mock -r fedora-4-x86_64-core init
$ mock -r fedora-4-x86_64-core --install bittorrent-gui bitmap-fonts dejavu-fonts xorg-x11-fonts-base  xorg-x11-fonts-misc xorg-x11-fonts-Type1

Then set up an X display to view the application. I use Xnest (from the xorg-x11-server-Xnest package) on the display host for this, to set up a clean new display with no authentication aggravation.

$ Xnest -ac :2

Then, back on the build server, I point the DISPLAY variable at my target display and start the application.

$ mock -r fedora-4-x86_64-core shell
mock-chroot> export DISPLAY=displayhost:2
mock-chroot> bittorrent

The application appears on the Xnest display and I can test it to my heart's content.


Recent