Commit 97d893a8 authored by IKEDA Soji's avatar IKEDA Soji
Browse files

Upgrading process fills wwsympa_url parameters no longer mandatory.

parent 132c9287
......@@ -1971,9 +1971,6 @@ sub _infer_robot_parameter_values {
if not defined $param->{'config_hash'}{'domain'}
and defined $param->{'config_hash'}{'host'};
#XXX$param->{'config_hash'}{'wwsympa_url'} ||= sprintf 'http://%s/sympa',
#XXX $param->{'config_hash'}{'domain'};
$param->{'config_hash'}{'static_content_url'} ||=
$Conf{'static_content_url'};
$param->{'config_hash'}{'static_content_path'} ||=
......
......@@ -1831,6 +1831,34 @@ sub upgrade {
}
}
# GH #330: wwsympa_url would be optional. http://domain/sympa is
# assigned to robot.conf for compatibility.
if (lower_version($previous_version, '6.2.33b.2')) {
my @robot_ids = Sympa::List::get_robots();
foreach my $robot_id (@robot_ids) {
next if $robot_id eq $Conf::Conf{'domain'}; # Primary domain
my $config_file =
sprintf '%s/%s/robot.conf', $Conf::Conf{'etc'}, $robot_id;
my $ifh;
next unless open $ifh, '<', $config_file;
my ($parameter) = grep {/\Awwsympa_url\s+\S+/} <$ifh>;
close $ifh;
next if $parameter;
$log->syslog('info', 'Updating wwsympa_url for %s', $robot_id);
my $ofh;
unless (open $ofh, '>>', $config_file) {
$log->syslog('err', 'Cannot write to %s: %m', $config_file);
next;
}
printf $ofh "\n\n# Added by upgrade from %s\n", $previous_version;
printf $ofh "wwsympa_url\thttp://%s/sympa\n", $robot_id;
close $ofh;
}
}
return 1;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment