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
06977612
Commit
06977612
authored
May 02, 2018
by
IKEDA Soji
Browse files
Dump owners and moderators of closed lists more precisely during upgrading process.
parent
0bc63ee4
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/Sympa/Upgrade.pm
View file @
06977612
...
...
@@ -1791,19 +1791,21 @@ sub upgrade {
$dir
.
'
/member.dump
';
}
my
(
$fh
,
$fh_config
);
my
$fh
;
next
unless
open
$fh
,
'
<
',
$dir
.
'
/config
';
my
$config
=
do
{
local
$RS
;
<
$fh
>
};
close
$fh
;
# Write out initial permanent owners/editors in <role>.dump files.
$config
=~
s/(\A|\n)[\t ]+(?=\n)/$1/g
;
# normalize empty lines
open
my
$ifh
,
'
<
',
\
$config
;
# open "in memory" file
my
@config
=
do
{
local
$RS
=
'';
<
$ifh
>
};
close
$ifh
;
foreach
my
$role
(
qw(owner editor)
)
{
my
$file
=
$list
->
{'
dir
'}
.
'
/
'
.
$role
.
'
.dump
';
my
$config
=
$list
->
{'
dir
'}
.
'
/config
';
if
(
!-
e
$file
and
open
(
$fh
,
'
>
',
$file
)
and
open
(
$fh_config
,
'
<
',
$config
))
{
local
$RS
=
'';
# read paragraph by each
my
$admins
=
join
'',
grep
{
/\A\s*$role\b/
}
<
$fh_config
>
;
print
$fh
$admins
;
close
$fh
;
close
$fh_config
;
my
$file
=
$dir
.
'
/
'
.
$role
.
'
.dump
';
if
(
!-
e
$file
and
open
my
$ofh
,
'
>
',
$file
)
{
my
$admins
=
join
'',
grep
{
/\A\s*$role\b/
}
@config
;
print
$ofh
$admins
;
close
$ofh
;
}
}
}
...
...
Write
Preview
Supports
Markdown
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