From 255cbdb4943e4862ca8790309981d9bebc8750fc Mon Sep 17 00:00:00 2001 From: lars Date: Mon, 26 Dec 2005 15:30:20 +0000 Subject: [PATCH] consider ezmlm-idx5 --- Ezmlm/trunk/Changes | 4 +++- Ezmlm/trunk/Ezmlm.pm | 43 +++++++++++++++++++++++++------------------ 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/Ezmlm/trunk/Changes b/Ezmlm/trunk/Changes index 5cbb85a..3dbb064 100644 --- a/Ezmlm/trunk/Changes +++ b/Ezmlm/trunk/Changes @@ -30,4 +30,6 @@ Revision history for Perl extension Mail::Ezmlm. - fixed some tainting problems (Scott Beck and Matt Simerson ) - fixed order of control/defaulthost and control/me (bug 1515) - fixed a bug in Makefile.PL (bug 11771). does not affect most users, so released as 0.05.1 - + +0.06 Mon Dec 26 18:55:12 CET 2005 + - support for ezmlm-idx-5.0.0 added diff --git a/Ezmlm/trunk/Ezmlm.pm b/Ezmlm/trunk/Ezmlm.pm index ef46a84..4b113e6 100644 --- a/Ezmlm/trunk/Ezmlm.pm +++ b/Ezmlm/trunk/Ezmlm.pm @@ -51,7 +51,7 @@ require Exporter; @EXPORT = qw( ); -$VERSION = '0.05'; +$VERSION = '0.06'; require 5.005; @@ -175,27 +175,34 @@ sub update { # == Get a list of options for the current list == sub getconfig { - my($self) = @_; - my($options, $i); + my($self) = @_; + my($options, $i); - # Read the config file - if(open(CONFIG, "<$self->{'LIST_NAME'}/config")) { - while() { - if (/^F:-(\w+)/) { - $options = $1; - } elsif (/^(\d):(.+)$/) { - $options .= " -$1 '$2'"; - } - } - close CONFIG; - } else { - # Try manually - $options = $self->_getconfigmanual(); - } + # Read the config file + if(open(CONFIG, "<$self->{'LIST_NAME'}/dot")) { + # this file exists since ezmlm-idx-5.0.0 + # 'config' is not authorative anymore since this version + $option = $self->_getconfigmanual_idx5(); + } elsif(open(CONFIG, "<$self->{'LIST_NAME'}/config")) { + # 'config' contains the authorative information + while() { + if (/^F:-(\w+)/) { + $options = $1; + } elsif (/^(\d):(.+)$/) { + $options .= " -$1 '$2'"; + } + } + close CONFIG; + } else { + # Try manually + $options = $self->_getconfigmanual_idx4(); + } ($self->_seterror(-1, 'unable to read configuration in getconfig()') && return undef) unless (defined($options)); # Add the unselected options too + # TODO: this is not especially great, as some options are undefined and cause an + # error, if you use it for update foreach $i ('a' .. 'z') { $options .= uc($i) unless ($options =~ /$i/i) } @@ -508,7 +515,7 @@ sub _checkaddress { } # == Internal function to work out a list configuration == -sub _getconfigmanual { +sub _getconfigmanual_idx4 { my($self) = @_; my ($savedollarslash, $options, $manager, $editor);