Monthly Archive for May, 2005

Testing Perl ports

FreeBSD

Yesterday I finally found time to wade through some of my outdated p5 ports. It is obvious that the monkey poo job of testing them with all three perls can be automated, but I never got really fed up with the procedure before. So I wrote yet another port-related automation script, which I’d like to describe here.

First, a little about my setup.

I use three jails for testing. There is a port58 jail which has lang/perl5.8 installed. There is a ports56 jail (with lang/perl5). And there is a j4 jail, which is a bit of a strange beast, since it is a 4.11 i386 jail (with system perl 5.005_03), so it took some tinkering to make that work on my 5.4 amd64 host system.

All three jails sit on a private subnet, and I can ssh -l root to them using my ssh key. They get populated with a freshly cvsupped ports collection via cpdup, a nifty little tool by Matt Dillon.

So, the manual procedure is basically:

    make whatever changes are needed to the port
    repeat for every jail:
      ssh to jail, cd to port
      make clean ; make
      if everything’s fine, cd work/portdir; make test
      if everything’s still fine, cd ../..; make install; make deinstall, check for leftover files

    rinse, clean, repeat until the port works

The script to automate this task is called test-port. It is somewhat hackish, being a quick and dirty job, but it is usable. Test-port makes use of other scripts, which I wrote over time and was using extensively, namely

    plist for checking the current file structure against a tree created with build_mtree and generating a plist delta.
    cpdup-port for copying a port or the whole port tree to the jails.
    cpport for listing recently modified files (useful when committing stuff).

If you think you can have a use for those scripts, be my guest. If you make any improvements to them, I would like to hear about it — they do need improvements (in particular, they are not usable without modifications outside of my setup).