chiark / gitweb /
i18n: Dgit.pm: mark some of messages (1)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 1 Oct 2018 14:19:19 +0000 (15:19 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 1 Oct 2018 14:20:30 +0000 (15:20 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Debian/Dgit.pm

index 2e9fa647d7934b8e7f553cd101f37d9a05add6b1..8260e9f44862048a8009fe13ee7f7b25c555bb5e 100644 (file)
@@ -198,7 +198,7 @@ sub messagequote ($) {
 sub shellquote {
     my @out;
     local $_;
-    defined or confess 'internal error' foreach @_;
+    defined or confess __ 'internal error' foreach @_;
     foreach my $a (@_) {
        $_ = $a;
        if (!length || m{[^-=_./:0-9a-z]}i) {
@@ -292,7 +292,7 @@ sub _us () {
 }
 
 sub failmsg {
-    my $s = "error: @_\n";
+    my $s = f_ "error: %s\n", "@_";
     $s =~ s/\n\n$/\n/g;
     my $prefix = _us().": ";
     $s =~ s/^/$prefix/gm;
@@ -312,7 +312,7 @@ sub ensuredir ($) {
 
 sub must_getcwd () {
     my $d = getcwd();
-    defined $d or fail "getcwd failed: $!\n";
+    defined $d or fail f_ "getcwd failed: %s\n", $!;
     return $d;
 }
 
@@ -331,32 +331,32 @@ our @signames = split / /, $Config{sig_name};
 
 sub waitstatusmsg () {
     if (!$?) {
-       return "terminated, reporting successful completion";
+       return __ "terminated, reporting successful completion";
     } elsif (!($? & 255)) {
-       return "failed with error exit status ".WEXITSTATUS($?);
+       return f_ "failed with error exit status %s", WEXITSTATUS($?);
     } elsif (WIFSIGNALED($?)) {
        my $signum=WTERMSIG($?);
-       return "died due to fatal signal ".
+       return f_ "died due to fatal signal %s",
            ($signames[$signum] // "number $signum").
            ($? & 128 ? " (core dumped)" : ""); # POSIX(3pm) has no WCOREDUMP
     } else {
-       return "failed with unknown wait status ".$?;
+       return f_ "failed with unknown wait status %s", $?;
     }
 }
 
 sub failedcmd_report_cmd {
     my $intro = shift @_;
-    $intro //= "failed command";
+    $intro //= __ "failed command";
     { local ($!); printcmd \*STDERR, _us().": $intro:", @_ or die $!; };
 }
 
 sub failedcmd_waitstatus {
     if ($? < 0) {
-       return "failed to fork/exec: $!";
+       return f_ "failed to fork/exec: %s", $!;
     } elsif ($?) {
-       return "subprocess ".waitstatusmsg();
+       return f_ "subprocess %s", waitstatusmsg();
     } else {
-       return "subprocess produced invalid output";
+       return __ "subprocess produced invalid output";
     }
 }