From: Frank Lichtenheld Date: Tue, 4 Dec 2007 19:43:29 +0000 (+0100) Subject: Dpkg::ErrorHandling::usageerr: Support format strings X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5a2d0121bc4ce05960cc8f83ec1774fb2dbc5d0;p=dpkg Dpkg::ErrorHandling::usageerr: Support format strings When changing all error reporting function to support format strings, usageerr was apparently forgotten. --- diff --git a/ChangeLog b/ChangeLog index 16c8bcc7..430503aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2007-12-04 Frank Lichtenheld + * scripts/Dpkg/ErrorHandling.pm (usageerr): + Support format strings like all the other + error reporting functions. + * scripts/Makefile.am (EXTRA_DIST): Add missing files from scripts/t/. diff --git a/scripts/Dpkg/ErrorHandling.pm b/scripts/Dpkg/ErrorHandling.pm index 8297859f..53bd45df 100644 --- a/scripts/Dpkg/ErrorHandling.pm +++ b/scripts/Dpkg/ErrorHandling.pm @@ -80,7 +80,10 @@ sub subprocerr(@) sub usageerr(@) { - printf(STDERR "%s: %s\n\n", $progname, "@_"); + my ($msg) = (shift); + + $msg = sprintf($msg, @_) if (@_); + warn "$progname: $msg\n\n"; # XXX: access to main namespace main::usage(); exit(2);