From ec432987065db7849ddb423e80576b76147cacf4 Mon Sep 17 00:00:00 2001 From: lars Date: Thu, 16 Oct 2008 01:22:44 +0000 Subject: [PATCH] Mail::Ezmlm: * updated version info for v0.08.2 * improved testing script --- Ezmlm/trunk/Changes | 5 ++++- Ezmlm/trunk/Ezmlm.pm | 6 ++++-- Ezmlm/trunk/test.pl | 25 +++++++++++++++++++++++-- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/Ezmlm/trunk/Changes b/Ezmlm/trunk/Changes index 0d7dc64..e82eb6a 100644 --- a/Ezmlm/trunk/Changes +++ b/Ezmlm/trunk/Changes @@ -57,5 +57,8 @@ Revision history for Perl extension Mail::Ezmlm. - add modules Mail::Ezmlm::GpgKeyRing and Mail::Ezmlm::GpgEzmlm 0.08.1 Thu Oct 12 04:37:06 CEST 2008 - - fix issue of Mail::Ezmlm::GpgEzmlm with ezmlm-idx v0.4x lists + - fixed issues of Mail::Ezmlm::GpgEzmlm with ezmlm-idx v0.4x lists + +0.08.2 Wed Oct 15 23:00:12 CEST 2008 + - added check for external dependency to the test script diff --git a/Ezmlm/trunk/Ezmlm.pm b/Ezmlm/trunk/Ezmlm.pm index 2f54120..98b2100 100644 --- a/Ezmlm/trunk/Ezmlm.pm +++ b/Ezmlm/trunk/Ezmlm.pm @@ -1,5 +1,5 @@ # =========================================================================== -# Ezmlm.pm - version 0.08.1 - 10/12/2008 +# Ezmlm.pm - version 0.08.2 - 10/15/2008 # $Id$ # # Object methods for ezmlm mailing lists @@ -53,7 +53,7 @@ require Exporter; @EXPORT = qw( ); -$VERSION = '0.08.1'; +$VERSION = '0.08.2'; require 5.005; @@ -708,6 +708,8 @@ sub errno { } # == Test the compatiblity of the module == +# return 0 for a valid version +# return the version string for an invalid version sub check_version { my $self = shift; my $version = `$EZMLM_BASE/ezmlm-make -V 2>&1`; diff --git a/Ezmlm/trunk/test.pl b/Ezmlm/trunk/test.pl index 4e0d4ee..2b574d2 100644 --- a/Ezmlm/trunk/test.pl +++ b/Ezmlm/trunk/test.pl @@ -31,6 +31,25 @@ print "Loading: ok 1\n"; use Cwd; use File::Find; + +# we need to check, if ezmlm-idx is installed +sub check_external_dependency { + my $ezmlm_bin = $Mail::Ezmlm::EZMLM_BASE . "/ezmlm-make"; + if (-x $ezmlm_bin) { + return (0==0); + } else { + return (0==1); + } +} + +if (!check_external_dependency()) { + # For humans: + warn "You don't have ezmlm-idx installed. Please fetch it from " + . "http://ezmlm.org/ and install it."; + # For the tester scripts: + exit 0; +} + $list = new Mail::Ezmlm; # create a temp directory if necessary @@ -122,8 +141,10 @@ unless(@subscribers) { } print 'Testing installed version of ezmlm: '; -my($version) = $list->check_version(); -if ($version) { +my $version = $list->check_version(); +# "check_version" returns zero for a valid version and the version string for an +# invalid version of ezmlm +if ($version != 0) { $version =~ s/\n//; print 'not ok 9 [Warning: Ezmlm.pm is designed to work with ezmlm-idx > 0.40. Your version reports as: ', $version, "]\n"; } else {