fixed handling of the 'owner' setting for ezmlm-idx > v5 (Closes: #24)
improved ezmlm-idx version detection (5.0 / 5.1 / 6.x)
This commit is contained in:
parent
3b9e364756
commit
8dd9f5b755
1 changed files with 29 additions and 18 deletions
|
@ -724,7 +724,9 @@ sub check_version {
|
|||
# 0 => unknown version
|
||||
# 3 => ezmlm v0.53
|
||||
# 4 => ezmlm-idx v0.4*
|
||||
# 5 => ezmlm-idx v5.*
|
||||
# 5 => ezmlm-idx v5.0
|
||||
# 5.1 => ezmlm-idx v5.1
|
||||
# 6 => ezmlm-idx v6.*
|
||||
sub get_version {
|
||||
my ($ezmlm, $idx);
|
||||
my $version = `$EZMLM_BASE/ezmlm-make -V 2>&1`;
|
||||
|
@ -733,14 +735,20 @@ sub get_version {
|
|||
$ezmlm = $1 if ($version =~ m/ezmlm-([\d\.]+)$/);
|
||||
$idx = $1 if ($version =~ m/ezmlm-idx-([\d\.]+)$/);
|
||||
|
||||
if(defined($ezmlm)) {
|
||||
if (defined($ezmlm)) {
|
||||
return 3;
|
||||
} elsif (defined($idx)) {
|
||||
if (($idx =~ m/^(\d)/) && ($1 >= 5)) {
|
||||
# version 5.0 or higher
|
||||
if (($idx =~ m/^(\d)/) && ($1 >= 6)) {
|
||||
# version 6.0 or higher
|
||||
return 6;
|
||||
} elsif (($idx =~ m/^(\d)\.(\d)/) && ($1 >= 5) && ($2 == 1)) {
|
||||
# version 5.1
|
||||
return 5.1;
|
||||
} elsif (($idx =~ m/^(\d)/) && ($1 >= 5)) {
|
||||
# version 5.0
|
||||
return 5;
|
||||
} elsif (($idx =~ m/^0\.(\d)/) && ($1 >= 0)) {
|
||||
# version 0.4 or higher
|
||||
# version 0.4xx
|
||||
return 4;
|
||||
} else {
|
||||
return 0;
|
||||
|
@ -822,22 +830,25 @@ sub _getconfig_idx5 {
|
|||
# values from different files
|
||||
# first: preset a array with "filename" and "option_number"
|
||||
%optionfiles = (
|
||||
'sublist', '0',
|
||||
'fromheader', '3',
|
||||
'tstdigopts', '4',
|
||||
'owner', '5',
|
||||
'sql', '6',
|
||||
'modpost', '7',
|
||||
'modsub', '8',
|
||||
'remote', '9');
|
||||
'sublist', 0,
|
||||
'fromheader', 3,
|
||||
'tstdigopts', 4,
|
||||
'owner', 5,
|
||||
'sql', 6,
|
||||
'modpost', 7,
|
||||
'modsub', 8,
|
||||
'remote', 9);
|
||||
while (($file, $opt_num) = each(%optionfiles)) {
|
||||
if (-e "$self->{'LIST_NAME'}/$file") {
|
||||
chomp($temp = $self->getpart($file));
|
||||
$temp =~ m/^(.*)$/m; # take only the first line
|
||||
$temp = $1;
|
||||
# the 'owner' setting can be ignored if it is a path (starts with '/')
|
||||
unless (($opt_num == 5) && ($temp =~ m#^/#)) {
|
||||
$options .= " -$opt_num '$temp'" if ($temp =~ /\S/);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue