The following commit has been merged in the master branch:
commit 7e1f9c695eab3e57ab679ad80c0637a4071cb632
Author: Guillem Jover <[EMAIL PROTECTED]>
Date:   Sun Dec 7 00:22:40 2008 +0200

    Dpkg::ErrorHandling: Replace failure calls with error or syserr
    
    There's no point in a different failure vs error or syserr function, so
    let's remove it.

diff --git a/ChangeLog b/ChangeLog
index fc5a055..7da93be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
 2008-12-08  Guillem Jover  <[EMAIL PROTECTED]>
 
+       * scripts/Dpkg/ErrorHandling.pm (@EXPORT): Remove 'failure'.
+       (failure): Remove function.
+       (syserr): Rename 'failure' string to 'error'.
+       (subprocerr): Use error instead of failure.
+       * scripts/Dpkg/Checksums.pm (extractchecksum): Likewise.
+       * scripts/Dpkg/Source/Functions.pm (erasedir): Likewise.
+       * scripts/changelog/debian.pl: Likewise.
+       * scripts/dpkg-gencontrol.pl: Likewise.
+       * scripts/dpkg-shlibdeps.pl: Likewise.
+       * scripts/dpkg-buildpackage.pl: Use syserr instead of failure.
+
+2008-12-08  Guillem Jover  <[EMAIL PROTECTED]>
+
        * scripts/Dpkg/ErrorHandling.pm (@EXPORT_OK): Move info, warning,
        warnerror, error, errormsg, failure, syserr, internerr, subprocerr,
        usageerr and syntaxerr to ...
diff --git a/scripts/Dpkg/Checksums.pm b/scripts/Dpkg/Checksums.pm
index a684a9d..a9a26db 100644
--- a/scripts/Dpkg/Checksums.pm
+++ b/scripts/Dpkg/Checksums.pm
@@ -22,7 +22,7 @@ our %check_regex = ( md5 => qr/[0-9a-f]{32}/,
 sub extractchecksum {
     my ($alg, $checksum) = @_;
     ($checksum =~ /^($check_regex{$alg})(\s|$)/m)
-       || failure(_g("checksum program gave bogus output `%s'"), $checksum);
+       || error(_g("checksum program gave bogus output `%s'"), $checksum);
     return $1;
 }
 
diff --git a/scripts/Dpkg/ErrorHandling.pm b/scripts/Dpkg/ErrorHandling.pm
index d8646bc..968ced1 100644
--- a/scripts/Dpkg/ErrorHandling.pm
+++ b/scripts/Dpkg/ErrorHandling.pm
@@ -4,7 +4,7 @@ use Dpkg;
 use Dpkg::Gettext;
 
 use base qw(Exporter);
-our @EXPORT = qw(info warning warnerror error errormsg failure
+our @EXPORT = qw(info warning warnerror error errormsg
                  syserr internerr subprocerr usageerr syntaxerr);
 our @EXPORT_OK = qw(report unknown $warnable_error $quiet_warnings);
 
@@ -38,15 +38,10 @@ sub warnerror(@)
     }
 }
 
-sub failure($;@)
-{
-    die report(_g("failure"), @_);
-}
-
 sub syserr($;@)
 {
     my $msg = shift;
-    die report(_g("failure"), "$msg: $!", @_);
+    die report(_g("error"), "$msg: $!", @_);
 }
 
 sub error($;@)
@@ -81,11 +76,11 @@ sub subprocerr(@)
     require POSIX;
 
     if (POSIX::WIFEXITED($?)) {
-       failure(_g("%s gave error exit status %s"), $p, POSIX::WEXITSTATUS($?));
+       error(_g("%s gave error exit status %s"), $p, POSIX::WEXITSTATUS($?));
     } elsif (POSIX::WIFSIGNALED($?)) {
-       failure(_g("%s died from signal %s"), $p, POSIX::WTERMSIG($?));
+       error(_g("%s died from signal %s"), $p, POSIX::WTERMSIG($?));
     } else {
-       failure(_g("%s failed with unknown exit code %d"), $p, $?);
+       error(_g("%s failed with unknown exit code %d"), $p, $?);
     }
 }
 
diff --git a/scripts/Dpkg/Source/Functions.pm b/scripts/Dpkg/Source/Functions.pm
index 8a29389..0f4196a 100644
--- a/scripts/Dpkg/Source/Functions.pm
+++ b/scripts/Dpkg/Source/Functions.pm
@@ -25,7 +25,7 @@ sub erasedir {
         return if $! == ENOENT;
         syserr(_g("unable to check for removal of dir `%s'"), $dir);
     }
-    failure(_g("rm -rf failed to remove `%s'"), $dir);
+    error(_g("rm -rf failed to remove `%s'"), $dir);
 }
 
 sub fixperms {
diff --git a/scripts/changelog/debian.pl b/scripts/changelog/debian.pl
index 3a5392f..caa0e74 100755
--- a/scripts/changelog/debian.pl
+++ b/scripts/changelog/debian.pl
@@ -115,15 +115,14 @@ my $opts = { since => $since, until => $until,
 
 if ($file eq '-') {
     $changes->parse({ inhandle => \*STDIN, %$opts })
-       or failure(_g('fatal error occured while parsing input'));
+       or error(_g('fatal error occured while parsing input'));
 } else {
     $changes->parse({ infile => $file, %$opts })
-       or failure(_g('fatal error occured while parsing %s'),
-                  $file );
+       or error(_g('fatal error occured while parsing %s'), $file);
 }
 
 
 eval("print \$changes->${format}_str(\$opts)");
 if ($@) {
-    failure("%s",$@);
+    error("%s", $@);
 }
diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl
index 975bda8..9184d72 100755
--- a/scripts/dpkg-buildpackage.pl
+++ b/scripts/dpkg-buildpackage.pl
@@ -360,12 +360,12 @@ unless ($noclean) {
     withecho(@rootcommand, @debian_rules, 'clean');
 }
 unless ($binaryonly) {
-    chdir('..') or failure('chdir ..');
+    chdir('..') or syserr('chdir ..');
     my @opts = @passopts;
     if ($diffignore) { push @opts, $diffignore }
     push @opts, @tarignore;
     withecho('dpkg-source', @opts, '-b', $dir);
-    chdir($dir) or failure("chdir $dir");
+    chdir($dir) or syserr("chdir $dir");
 }
 unless ($sourceonly) {
     withecho(@debian_rules, 'build');
diff --git a/scripts/dpkg-gencontrol.pl b/scripts/dpkg-gencontrol.pl
index 0fba3d1..ed96413 100755
--- a/scripts/dpkg-gencontrol.pl
+++ b/scripts/dpkg-gencontrol.pl
@@ -298,7 +298,7 @@ if (!defined($substvars->get('Installed-Size'))) {
     close(DU);
     $? && subprocerr(_g("du in \`%s'"), $packagebuilddir);
     $duo =~ m/^(\d+)\s+\.$/ ||
-        failure(_g("du gave unexpected output \`%s'"), $duo);
+        error(_g("du gave unexpected output \`%s'"), $duo);
     $substvars->set('Installed-Size', $1);
 }
 if (defined($substvars->get('Extra-Size'))) {
diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl
index 2ec4644..23065a9 100755
--- a/scripts/dpkg-shlibdeps.pl
+++ b/scripts/dpkg-shlibdeps.pl
@@ -159,7 +159,7 @@ foreach my $file (keys %exec) {
                         "that do not have any shlibs or symbols file.\nTo help 
dpkg-shlibdeps " .
                         "find private libraries, you might need to set 
LD_LIBRARY_PATH.");
            if (scalar(split_soname($soname))) {
-               failure($msg, $soname, $file, $obj->{format}, join(":", 
@{$obj->{RPATH}}));
+               error($msg, $soname, $file, $obj->{format}, join(":", 
@{$obj->{RPATH}}));
            } else {
                warning($msg, $soname, $file, $obj->{format}, join(":", 
@{$obj->{RPATH}}));
            }
@@ -254,8 +254,8 @@ foreach my $file (keys %exec) {
                    $ignore++ unless scalar(split_soname($soname));
                    # 3/ when we have been asked to do so
                    $ignore++ if $ignore_missing_info;
-                   failure(_g("no dependency information found for %s " .
-                              "(used by %s)."), $lib, $file)
+                   error(_g("no dependency information found for %s " .
+                            "(used by %s)."), $lib, $file)
                        unless $ignore;
                }
            }

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to