From ea7f8214a2583c6d969d79245701b0fd93937c0e Mon Sep 17 00:00:00 2001 From: Raphael Hertzog Date: Sat, 29 Dec 2007 18:46:07 +0100 Subject: [PATCH] Dpkg::ErrorHandling: New syntaxerr function --- ChangeLog | 5 +++++ scripts/Dpkg/ErrorHandling.pm | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) 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; -- 2.39.5