Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create ${expldir}/${robot} directory if it does not exists #421

Merged
merged 1 commit into from
Oct 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/lib/Sympa/List.pm
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,9 @@ sub load {

## Set of initializations ; only performed when the config is first loaded
if ($options->{'first_access'}) {
if ($robot && (! -d "$Conf::Conf{'home'}/$robot")) {
mkdir "$Conf::Conf{'home'}/$robot", 0775
Copy link
Member

@ikedas ikedas Sep 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep compatibility with older style path ${expldir}/${listname}, I think this is better:

        if ($robot && (! -d "$Conf::Conf{'home'}/$robot")
            && $robot ne $Conf::Conf{'domain'}) {
            mkdir ...

in case some lists have already had ${expldir}/${name} directories.

}
if ($robot && (-d "$Conf::Conf{'home'}/$robot")) {
$self->{'dir'} = "$Conf::Conf{'home'}/$robot/$name";
} elsif (lc($robot) eq lc($Conf::Conf{'domain'})) {
Expand Down Expand Up @@ -8045,8 +8048,7 @@ sub get_robots {
}
my $use_default_robot = 1;
foreach $r (sort readdir(DIR)) {
next unless (($r !~ /^\./o) && (-d "$Conf::Conf{'home'}/$r"));
next unless (-r "$Conf::Conf{'etc'}/$r/robot.conf");
next unless (($r !~ /^\./o) && (-r "$Conf::Conf{'etc'}/$r/robot.conf"));
push @robots, $r;
undef $use_default_robot if ($r eq $Conf::Conf{'domain'});
}
Expand Down