[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.5.5-11-ge94cee4



The following commit has been merged in the master branch:
commit 9c67edf592ba007cf2b0bdaf1fad10685c239ae3
Author: Niels Thykier <niels@thykier.net>
Date:   Wed Mar 7 14:14:20 2012 +0100

    Use fail from Util.pm in coll/java-info and coll/scripts
    
    This fixes use of "undefined" function in coll/java-info and removes
    an embedded copy of "fail" in coll/scripts.  Also fixed some error
    messages in java-info.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/collection/java-info b/collection/java-info
index d03632e..e3a85bb 100755
--- a/collection/java-info
+++ b/collection/java-info
@@ -22,20 +22,22 @@
 use strict;
 use warnings;
 
+use lib "$ENV{'LINTIAN_ROOT'}/lib/";
+use Util qw(fail);
+
 # Sanity check
 unless (-d 'unpacked/') {
-    print STDERR 'error: collection script called in wrong directory!\n';
-    exit 2;
+    fail "java-info called in wrong directory!";
 }
 
 open (INDEX, '<', 'index')
-    or fail("cannot open index: $!\n");
+    or fail "cannot open index: $!\n";
 
 open (OUT, '>', 'java-info')
-    or fail("cannot open java-info: $!\n");
+    or fail "cannot open java-info: $!";
 
 chdir ('unpacked')
-    or fail ("unable to chdir to unpacked: $!\n");
+    or fail "unable to chdir to unpacked: $!";
 
 while (<INDEX>) {
     chomp;
diff --git a/collection/scripts b/collection/scripts
index 0fd12ab..437506d 100755
--- a/collection/scripts
+++ b/collection/scripts
@@ -22,6 +22,9 @@
 use strict;
 use warnings;
 
+use lib "$ENV{'LINTIAN_ROOT'}/lib/";
+use Util qw(fail);
+
 open(SCRIPTS, '>', 'scripts') or fail("cannot open scripts output file: $!");
 open(INDEX, '<', 'index') or fail("cannot open index file: $!");
 
@@ -88,19 +91,6 @@ close(SCRIPTS) or fail("cannot write control-scripts file: $!");
 
 exit 0;
 
-# -----------------------------------
-
-sub fail {
-    if ($_[0]) {
-        print STDERR "internal error: $_[0]\n";
-    } elsif ($!) {
-        print STDERR "internal error: $!\n";
-    } else {
-        print STDERR "internal error.\n";
-    }
-    exit 1;
-}
-
 # Local Variables:
 # indent-tabs-mode: nil
 # cperl-indent-level: 4
diff --git a/debian/changelog b/debian/changelog
index c22fd3f..7e56eb1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -19,6 +19,12 @@ lintian (2.5.6) UNRELEASED; urgency=low
     + [NT] Added trailing slash to copyright-format URLs in tag
       descriptions for consistency with the policy.
 
+  * collection/java-info:
+    + [NT] Added missing "use Util".
+  * collection/scripts:
+    + [NT] Use "fail" from Util.pm rather than using an embedded
+      copy.
+
   * lib/Lintian/Tag/Info.pm:
     + [NT] Fixed issue where "Experimental: no" was handled as a
       "yes" when generating a tag description.

-- 
Debian package checker


Reply to: