Skip to content

Commit 6e4d15d

Browse files
committed
Fixes issue several typos on print/printf including case of issue sympa-community#159
1 parent 3b6a6c2 commit 6e4d15d

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
}
@@ -610,8 +611,9 @@ if ($main::options{'dump'}) {
610611
}
611612
my $family;
612613
unless ($family = Sympa::Family->new($family_name, $robot)) {
613-
print STDERR
614-
"The family $family_name does not exist, impossible instantiation\n";
614+
printf STDERR
615+
"The family %s does not exist, impossible instantiation\n",
616+
$family_name;
615617
exit 1;
616618
}
617619

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

623625
unless (-r $main::options{'input_file'}) {
624-
print STDERR "Unable to read $main::options{'input_file'} file";
626+
printf STDERR
627+
"Unable to read %s file\n", $main::options{'input_file'};
625628
exit 1;
626629
}
627630

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

661664
my $family;
662665
unless ($family = Sympa::Family->new($family_name, $robot)) {
663-
print STDERR
666+
printf STDERR
664667
"The family %s does not exist, impossible to add a list\n",
665668
$family_name;
666669
exit 1;
@@ -693,7 +696,7 @@ if ($main::options{'dump'}) {
693696
scenario_context => {skip => 1},
694697
);
695698
unless ($spindle and $spindle->spin and _report($spindle)) {
696-
print STDERR "Impossible to add a list %s to the family %s\n",
699+
printf STDERR "Impossible to add a list %s to the family %s\n",
697700
$hash->{config}{listname}, $family_name;
698701
exit 1;
699702
}
@@ -712,7 +715,8 @@ if ($main::options{'dump'}) {
712715
my $list = Sympa::List->new($main::options{'sync_include'});
713716

714717
unless (defined $list) {
715-
print STDERR "Incorrect list name $main::options{'sync_include'}\n";
718+
printf STDERR
719+
"Incorrect list name %s\n", $main::options{'sync_include'};
716720
exit 1;
717721
}
718722

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

757761
} elsif ($main::options{'upgrade_shared'}) {
758-
printf STDERR "Obsoleted. Use upgrade_shared_repository.pl.\n";
762+
print STDERR "Obsoleted. Use upgrade_shared_repository.pl.\n";
759763

760764
exit 0;
761765
} elsif ($main::options{'reload_list_config'}) {
@@ -765,8 +769,8 @@ if ($main::options{'dump'}) {
765769
Sympa::List->new($main::options{'list'}, '',
766770
{'reload_config' => 1, 'force_sync_admin' => 1});
767771
unless (defined $list) {
768-
print STDERR
769-
"Error : incorrect list name '$main::options{'list'}'\n";
772+
printf STDERR
773+
"Error : incorrect list name '%s'\n", $main::options{'list'};
770774
exit 1;
771775
}
772776
} else {
@@ -794,8 +798,9 @@ elsif ($main::options{'modify_list'}) {
794798

795799
my $family;
796800
unless ($family = Sympa::Family->new($family_name, $robot)) {
797-
print STDERR
798-
"The family $family_name does not exist, impossible to modify the list.\n";
801+
printf STDERR
802+
"The family %s does not exist, impossible to modify the list.\n",
803+
$family_name;
799804
exit 1;
800805
}
801806

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

807812
unless (open INFILE, $main::options{'input_file'}) {
808-
print STDERR "Unable to open $main::options{'input_file'}) file";
813+
printf STDERR
814+
"Unable to open %s file\n", $main::options{'input_file'};
809815
exit 1;
810816
}
811817

@@ -843,8 +849,9 @@ elsif ($main::options{'close_family'}) {
843849
}
844850
my $family;
845851
unless ($family = Sympa::Family->new($family_name, $robot)) {
846-
print STDERR
847-
"The family $family_name does not exist, impossible family closure\n";
852+
printf STDERR
853+
"The family %s does not exist, impossible family closure\n",
854+
$family_name;
848855
exit 1;
849856
}
850857

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

0 commit comments

Comments
 (0)