]> err.no Git - dpkg/commitdiff
Dpkg::ErrorHandling::usageerr: Support format strings
authorFrank Lichtenheld <djpig@debian.org>
Tue, 4 Dec 2007 19:43:29 +0000 (20:43 +0100)
committerFrank Lichtenheld <djpig@debian.org>
Tue, 4 Dec 2007 19:43:29 +0000 (20:43 +0100)
When changing all error reporting function to support
format strings, usageerr was apparently forgotten.

ChangeLog
scripts/Dpkg/ErrorHandling.pm

index 16c8bcc77456ec2abd524d438f4e5ba1470ad81b..430503aa97e1d14b2eecc79c6d6e69c149c19894 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2007-12-04  Frank Lichtenheld  <djpig@debian.org>
 
+       * 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/.
 
index 8297859f4936127437a371aa2f1f4cd2421f0976..53bd45dfe26c080ca49bfbda6229c742b369c4b6 100644 (file)
@@ -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);