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

Issue #159 #161

Merged
merged 1 commit into from
Jan 19, 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
53 changes: 30 additions & 23 deletions src/sbin/sympa.pl.in
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ if ($main::options{'upgrade_config_location'}) {
}
}

printf "Sympa configuration moved to $dir\n";
printf "Sympa configuration moved to %s\n", $dir;
exit 0;
} elsif ($main::options{'health_check'}) {
## Health check
Expand Down Expand Up @@ -385,7 +385,7 @@ if ($main::options{'dump'}) {
exit 0;
} elsif ($main::options{'md5_digest'}) {
my $md5 = Digest::MD5::md5_hex($main::options{'md5_digest'});
printf "md5 digest : $md5 \n";
printf "md5 digest : %s \n", $md5;

exit 0;
} elsif ($main::options{'import'}) {
Expand Down Expand Up @@ -420,7 +420,7 @@ if ($main::options{'dump'}) {
exit($status ? 0 : 1);

} elsif ($main::options{'md5_encode_password'}) {
printf STDERR "Obsoleted. Use upgrade_sympa_password.pl.\n";
print STDERR "Obsoleted. Use upgrade_sympa_password.pl.\n";

exit 0;
} elsif ($main::options{'lowercase'}) {
Expand Down Expand Up @@ -491,7 +491,8 @@ if ($main::options{'dump'}) {
my ($listname, $robot_id) = split /\@/, $main::options{'purge_list'}, 2;
my $current_list = Sympa::List->new($listname, $robot_id);
unless ($current_list) {
print STDERR "Incorrect list name $main::options{'purge_list'}\n";
printf STDERR
"Incorrect list name %s\n", $main::options{'purge_list'};
exit 1;
}

Expand Down Expand Up @@ -529,7 +530,7 @@ if ($main::options{'dump'}) {
$robot_id = $current_list->{'domain'};
} else {
unless (length $robot_id and Conf::valid_robot($robot_id)) {
print STDERR "Unknown robot \"%s\"\n";
printf STDERR "Unknown robot \"%s\"\n", $robot_id;
exit 1;
}
}
Expand All @@ -543,14 +544,14 @@ if ($main::options{'dump'}) {
scenario_context => {skip => 1},
);
unless ($spindle and $spindle->spin and _report($spindle)) {
printf STDERR "Could not rename list %s to %s%s\n",
printf STDERR "Could not rename list %s to %s\@%s\n",
$current_list->get_id, $listname, $robot_id;
exit 1;
}
exit 0;

} elsif ($main::options{'test_database_message_buffer'}) {
printf
print
"Deprecated. Size of messages no longer limited by database packet size.\n";
exit 1;
} elsif ($main::options{'conf_2_db'}) {
Expand All @@ -574,7 +575,7 @@ if ($main::options{'dump'}) {
}
my $fh;
unless (open $fh, '<', $main::options{'input_file'}) {
print STDERR "Unable to open %s: %s\n", $main::options{'input_file'},
printf STDERR "Unable to open %s: %s\n", $main::options{'input_file'},
$ERRNO;
exit 1;
}
Expand Down Expand Up @@ -610,8 +611,9 @@ if ($main::options{'dump'}) {
}
my $family;
unless ($family = Sympa::Family->new($family_name, $robot)) {
print STDERR
"The family $family_name does not exist, impossible instantiation\n";
printf STDERR
"The family %s does not exist, impossible instantiation\n",
$family_name;
exit 1;
}

Expand All @@ -621,7 +623,8 @@ if ($main::options{'dump'}) {
}

unless (-r $main::options{'input_file'}) {
print STDERR "Unable to read $main::options{'input_file'} file";
printf STDERR
"Unable to read %s file\n", $main::options{'input_file'};
exit 1;
}

Expand Down Expand Up @@ -660,7 +663,7 @@ if ($main::options{'dump'}) {

my $family;
unless ($family = Sympa::Family->new($family_name, $robot)) {
print STDERR
printf STDERR
"The family %s does not exist, impossible to add a list\n",
$family_name;
exit 1;
Expand Down Expand Up @@ -693,7 +696,7 @@ if ($main::options{'dump'}) {
scenario_context => {skip => 1},
);
unless ($spindle and $spindle->spin and _report($spindle)) {
print STDERR "Impossible to add a list %s to the family %s\n",
printf STDERR "Impossible to add a list %s to the family %s\n",
$hash->{config}{listname}, $family_name;
exit 1;
}
Expand All @@ -712,7 +715,8 @@ if ($main::options{'dump'}) {
my $list = Sympa::List->new($main::options{'sync_include'});

unless (defined $list) {
print STDERR "Incorrect list name $main::options{'sync_include'}\n";
printf STDERR
"Incorrect list name %s\n", $main::options{'sync_include'};
exit 1;
}

Expand Down Expand Up @@ -755,7 +759,7 @@ if ($main::options{'dump'}) {
exit 0;

} elsif ($main::options{'upgrade_shared'}) {
printf STDERR "Obsoleted. Use upgrade_shared_repository.pl.\n";
print STDERR "Obsoleted. Use upgrade_shared_repository.pl.\n";

exit 0;
} elsif ($main::options{'reload_list_config'}) {
Expand All @@ -765,8 +769,8 @@ if ($main::options{'dump'}) {
Sympa::List->new($main::options{'list'}, '',
{'reload_config' => 1, 'force_sync_admin' => 1});
unless (defined $list) {
print STDERR
"Error : incorrect list name '$main::options{'list'}'\n";
printf STDERR
"Error : incorrect list name '%s'\n", $main::options{'list'};
exit 1;
}
} else {
Expand Down Expand Up @@ -794,8 +798,9 @@ elsif ($main::options{'modify_list'}) {

my $family;
unless ($family = Sympa::Family->new($family_name, $robot)) {
print STDERR
"The family $family_name does not exist, impossible to modify the list.\n";
printf STDERR
"The family %s does not exist, impossible to modify the list.\n",
$family_name;
exit 1;
}

Expand All @@ -805,7 +810,8 @@ elsif ($main::options{'modify_list'}) {
}

unless (open INFILE, $main::options{'input_file'}) {
print STDERR "Unable to open $main::options{'input_file'}) file";
printf STDERR
"Unable to open %s file\n", $main::options{'input_file'};
exit 1;
}

Expand Down Expand Up @@ -843,8 +849,9 @@ elsif ($main::options{'close_family'}) {
}
my $family;
unless ($family = Sympa::Family->new($family_name, $robot)) {
print STDERR
"The family $family_name does not exist, impossible family closure\n";
printf STDERR
"The family %s does not exist, impossible family closure\n",
$family_name;
exit 1;
}

Expand All @@ -863,7 +870,7 @@ elsif ($main::options{'sync_list_db'}) {
if (length($listname) > 1) {
my $list = Sympa::List->new($listname);
unless (defined $list) {
print STDOUT "\nList '$listname' does not exist. \n";
printf STDOUT "\nList '%s' does not exist. \n", $listname;
exit 1;
}
$list->_update_list_db;
Expand Down