Browse Source

scripts: Use croak instead of internerr on programming errors in programs

Although these are programs (not modules), we'll use croak here too, as
there's no point in reintroducing the internerr function which got axed
in commit 8c314d6c4cee9b2c5acf078958243fb72af4e3d2, because croak does a
way better job here too.
Guillem Jover 12 years ago
parent
commit
76ff150dd4
2 changed files with 5 additions and 3 deletions
  1. 2 1
      scripts/dpkg-buildpackage.pl
  2. 3 2
      scripts/dpkg-genchanges.pl

+ 2 - 1
scripts/dpkg-buildpackage.pl

@@ -23,6 +23,7 @@
 use strict;
 use warnings;
 
+use Carp;
 use Cwd;
 use File::Basename;
 use POSIX qw(:sys_wait_h);
@@ -154,7 +155,7 @@ sub build_opt {
     } elsif ($include == BUILD_SOURCE) {
         return '-S';
     } else {
-        internerr("build_opt called with include=$include");
+        croak "build_opt called with include=$include";
     }
 }
 

+ 3 - 2
scripts/dpkg-genchanges.pl

@@ -4,7 +4,7 @@
 #
 # Copyright © 1996 Ian Jackson
 # Copyright © 2000,2001 Wichert Akkerman
-# Copyright © 2006-2012 Guillem Jover <guillem@debian.org>
+# Copyright © 2006-2013 Guillem Jover <guillem@debian.org>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -22,6 +22,7 @@
 use strict;
 use warnings;
 
+use Carp;
 use Encode;
 use POSIX qw(:errno_h);
 use Dpkg ();
@@ -102,7 +103,7 @@ sub build_opt {
     } elsif ($include == BUILD_SOURCE) {
         return '-S';
     } else {
-        internerr("build_opt called with include=$include");
+        croak "build_opt called with include=$include";
     }
 }