Commit 503bed85 authored by Ian Jackson's avatar Ian Jackson

i18n: Dgit.pm: mark some of messages (1)

Signed-off-by: Ian Jackson's avatarIan Jackson <ijackson@chiark.greenend.org.uk>
parent d947ba40
......@@ -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";
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment