From: Raphael Hertzog Date: Sat, 29 Dec 2007 17:46:07 +0000 (+0100) Subject: Dpkg::ErrorHandling: New syntaxerr function X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea7f8214a2583c6d969d79245701b0fd93937c0e;p=dpkg Dpkg::ErrorHandling: New syntaxerr function --- diff --git a/ChangeLog b/ChangeLog index 4243fd9a..f810fc13 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,6 +23,11 @@ * dselect/baselist.cc (baselist::startdisplay): Set helpscreen_attr on monochrome terminals. +2007-12-28 Raphael Hertzog + + * scripts/Dpkg/ErrorHandling.pm (syntaxerr): New function to + replace the syntax() function in controllib.pl. + 2007-12-28 Raphael Hertzog * scripts/Dpkg.pm: Add a warning to avoid adding unnecessary stuff diff --git a/scripts/Dpkg/ErrorHandling.pm b/scripts/Dpkg/ErrorHandling.pm index 53bd45df..9d79f283 100644 --- a/scripts/Dpkg/ErrorHandling.pm +++ b/scripts/Dpkg/ErrorHandling.pm @@ -5,7 +5,7 @@ use Dpkg::Gettext; use base qw(Exporter); our @EXPORT_OK = qw(warning warnerror error failure unknown syserr internerr - subprocerr usageerr $warnable_error $quiet_warnings); + subprocerr usageerr syntaxerr $warnable_error $quiet_warnings); our $warnable_error = 1; our $quiet_warnings = 0; @@ -89,4 +89,9 @@ sub usageerr(@) exit(2); } +sub syntaxerr { + my ($file, $msg) = @_; + error(_g("syntax error in %s at line %d: %s"), $file, $., $msg); +} + 1;