Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Sympa
Commits
97d893a8
Commit
97d893a8
authored
Jun 05, 2018
by
IKEDA Soji
Browse files
Upgrading process fills wwsympa_url parameters no longer mandatory.
parent
132c9287
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lib/Conf.pm
View file @
97d893a8
...
...
@@ -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
'}
||=
...
...
src/lib/Sympa/Upgrade.pm
View file @
97d893a8
...
...
@@ -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
\t
http://%s/sympa
\n
",
$robot_id
;
close
$ofh
;
}
}
return
1
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment