Skip to content

Commit 51021b1

Browse files
authored
Merge pull request #161 from ikedas/issue-159
Fixing issue #159 by ikedas
2 parents 4a586c7 + 6e4d15d commit 51021b1

File tree

1 file changed

+30
-23
lines changed

1 file changed

+30
-23
lines changed

src/sbin/sympa.pl.in

+30-23
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ if ($main::options{'upgrade_config_location'}) {
162162
}
163163
}
164164

165-
printf "Sympa configuration moved to $dir\n";
165+
printf "Sympa configuration moved to %s\n", $dir;
166166
exit 0;
167167
} elsif ($main::options{'health_check'}) {
168168
## Health check
@@ -385,7 +385,7 @@ if ($main::options{'dump'}) {
385385
exit 0;
386386
} elsif ($main::options{'md5_digest'}) {
387387
my $md5 = Digest::MD5::md5_hex($main::options{'md5_digest'});
388-
printf "md5 digest : $md5 \n";
388+
printf "md5 digest : %s \n", $md5;
389389

390390
exit 0;
391391
} elsif ($main::options{'import'}) {
@@ -420,7 +420,7 @@ if ($main::options{'dump'}) {
420420
exit($status ? 0 : 1);
421421

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

425425
exit 0;
426426
} elsif ($main::options{'lowercase'}) {
@@ -491,7 +491,8 @@ if ($main::options{'dump'}) {
491491
my ($listname, $robot_id) = split /\@/, $main::options{'purge_list'}, 2;
492492
my $current_list = Sympa::List->new($listname, $robot_id);
493493
unless ($current_list) {
494-
print STDERR "Incorrect list name $main::options{'purge_list'}\n";
494+
printf STDERR
495+
"Incorrect list name %s\n", $main::options{'purge_list'};
495496
exit 1;
496497
}
497498

@@ -529,7 +530,7 @@ if ($main::options{'dump'}) {
529530
$robot_id = $current_list->{'domain'};
530531
} else {
531532
unless (length $robot_id and Conf::valid_robot($robot_id)) {
532-
print STDERR "Unknown robot \"%s\"\n";
533+
printf STDERR "Unknown robot \"%s\"\n", $robot_id;
533534
exit 1;
534535
}
535536
}
@@ -543,14 +544,14 @@ if ($main::options{'dump'}) {
543544
scenario_context => {skip => 1},
544545
);
545546
unless ($spindle and $spindle->spin and _report($spindle)) {
546-
printf STDERR "Could not rename list %s to %s%s\n",
547+
printf STDERR "Could not rename list %s to %s\@%s\n",
547548
$current_list->get_id, $listname, $robot_id;
548549
exit 1;
549550
}
550551
exit 0;
551552

552553
} elsif ($main::options{'test_database_message_buffer'}) {
553-
printf
554+
print
554555
"Deprecated. Size of messages no longer limited by database packet size.\n";
555556
exit 1;
556557
} elsif ($main::options{'conf_2_db'}) {
@@ -574,7 +575,7 @@ if ($main::options{'dump'}) {
574575
}
575576
my $fh;
576577
unless (open $fh, '<', $main::options{'input_file'}) {
577-
print STDERR "Unable to open %s: %s\n", $main::options{'input_file'},
578+
printf STDERR "Unable to open %s: %s\n", $main::options{'input_file'},
578579
$ERRNO;
579580
exit 1;
580581
}
@@ -616,8 +617,9 @@ if ($main::options{'dump'}) {
616617
}
617618
my $family;
618619
unless ($family = Sympa::Family->new($family_name, $robot)) {
619-
print STDERR
620-
"The family $family_name does not exist, impossible instantiation\n";
620+
printf STDERR
621+
"The family %s does not exist, impossible instantiation\n",
622+
$family_name;
621623
exit 1;
622624
}
623625

@@ -627,7 +629,8 @@ if ($main::options{'dump'}) {
627629
}
628630

629631
unless (-r $main::options{'input_file'}) {
630-
print STDERR "Unable to read $main::options{'input_file'} file";
632+
printf STDERR
633+
"Unable to read %s file\n", $main::options{'input_file'};
631634
exit 1;
632635
}
633636

@@ -666,7 +669,7 @@ if ($main::options{'dump'}) {
666669

667670
my $family;
668671
unless ($family = Sympa::Family->new($family_name, $robot)) {
669-
print STDERR
672+
printf STDERR
670673
"The family %s does not exist, impossible to add a list\n",
671674
$family_name;
672675
exit 1;
@@ -705,7 +708,7 @@ if ($main::options{'dump'}) {
705708
scenario_context => {skip => 1},
706709
);
707710
unless ($spindle and $spindle->spin and _report($spindle)) {
708-
print STDERR "Impossible to add a list %s to the family %s\n",
711+
printf STDERR "Impossible to add a list %s to the family %s\n",
709712
$hash->{config}{listname}, $family_name;
710713
exit 1;
711714
}
@@ -724,7 +727,8 @@ if ($main::options{'dump'}) {
724727
my $list = Sympa::List->new($main::options{'sync_include'});
725728

726729
unless (defined $list) {
727-
print STDERR "Incorrect list name $main::options{'sync_include'}\n";
730+
printf STDERR
731+
"Incorrect list name %s\n", $main::options{'sync_include'};
728732
exit 1;
729733
}
730734

@@ -767,7 +771,7 @@ if ($main::options{'dump'}) {
767771
exit 0;
768772

769773
} elsif ($main::options{'upgrade_shared'}) {
770-
printf STDERR "Obsoleted. Use upgrade_shared_repository.pl.\n";
774+
print STDERR "Obsoleted. Use upgrade_shared_repository.pl.\n";
771775

772776
exit 0;
773777
} elsif ($main::options{'reload_list_config'}) {
@@ -777,8 +781,8 @@ if ($main::options{'dump'}) {
777781
Sympa::List->new($main::options{'list'}, '',
778782
{'reload_config' => 1, 'force_sync_admin' => 1});
779783
unless (defined $list) {
780-
print STDERR
781-
"Error : incorrect list name '$main::options{'list'}'\n";
784+
printf STDERR
785+
"Error : incorrect list name '%s'\n", $main::options{'list'};
782786
exit 1;
783787
}
784788
} else {
@@ -806,8 +810,9 @@ elsif ($main::options{'modify_list'}) {
806810

807811
my $family;
808812
unless ($family = Sympa::Family->new($family_name, $robot)) {
809-
print STDERR
810-
"The family $family_name does not exist, impossible to modify the list.\n";
813+
printf STDERR
814+
"The family %s does not exist, impossible to modify the list.\n",
815+
$family_name;
811816
exit 1;
812817
}
813818

@@ -817,7 +822,8 @@ elsif ($main::options{'modify_list'}) {
817822
}
818823

819824
unless (open INFILE, $main::options{'input_file'}) {
820-
print STDERR "Unable to open $main::options{'input_file'}) file";
825+
printf STDERR
826+
"Unable to open %s file\n", $main::options{'input_file'};
821827
exit 1;
822828
}
823829

@@ -855,8 +861,9 @@ elsif ($main::options{'close_family'}) {
855861
}
856862
my $family;
857863
unless ($family = Sympa::Family->new($family_name, $robot)) {
858-
print STDERR
859-
"The family $family_name does not exist, impossible family closure\n";
864+
printf STDERR
865+
"The family %s does not exist, impossible family closure\n",
866+
$family_name;
860867
exit 1;
861868
}
862869

@@ -875,7 +882,7 @@ elsif ($main::options{'sync_list_db'}) {
875882
if (length($listname) > 1) {
876883
my $list = Sympa::List->new($listname);
877884
unless (defined $list) {
878-
print STDOUT "\nList '$listname' does not exist. \n";
885+
printf STDOUT "\nList '%s' does not exist. \n", $listname;
879886
exit 1;
880887
}
881888
$list->_update_list_db;

0 commit comments

Comments
 (0)