summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2022-12-28 19:03:26 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2022-12-28 20:08:38 +0000
commitd80decbb9e922845486e983c2433347354bc4cd7 (patch)
treeeb0b31b3c282da2c364a1234495bc9c038ef2b9d
parent7c08e628be1febbfd71491ab81e563fab220fb25 (diff)
tainted-objects: Prepare the error message for translation
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rw-r--r--Debian/Dgit.pm24
1 files changed, 15 insertions, 9 deletions
diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm
index 25a149f..7a4d76e 100644
--- a/Debian/Dgit.pm
+++ b/Debian/Dgit.pm
@@ -962,29 +962,35 @@ sub tainted_objects_message ($$) {
my $msg = '';
my $timeshow = defined $ti->{time}
- ? " at time ".strftime("%Y-%m-%d %H:%M:%S Z", gmtime $ti->{time})
+ ? strftime("%Y-%m-%d %H:%M:%S Z", gmtime $ti->{time})
: "";
- my $pkgshow = length $ti->{package}
- ? "package $ti->{package}"
- : "any package";
+ my $infoshow = length $timeshow && length $ti->{package} ?
+ f_ "Taint recorded at time %s for package %s", $timeshow, $ti->{package},
+ : length $timeshow && !length $ti->{package} ?
+ f_ "Taint recorded at time %s for any package", $timeshow,
+ : !length $timeshow && length $ti->{package} ?
+ f_ "Taint recorded for package %s", $ti->{package},
+ : !length $timeshow && !length $ti->{package} ?
+ __ "Taint recorded for any package"
+ : confess;
$msg .= <<END;
History contains tainted $ti->{gitobjtype} $ti->{gitobjid}
-Taint recorded$timeshow for $pkgshow
+$infoshow
Reason: $ti->{comment}
END
$msg .=
- !defined $override_status ? <<END
+ !defined $override_status ? __ <<END
Uncorrectable error. If confused, consult administrator.
END
- : !length $override_status ? <<END
+ : !length $override_status ? __ <<END
Could be forced using --deliberately. Consult documentation.
END
- : <<END;
-Forcing due to $override_status
+ : f_ <<END, $override_status;
+Forcing due to %s
END
return $msg;