The following commit has been merged in the master branch:
commit 1dbf8daf1837273e296a25a480f542da1122d7d4
Author: Niels Thykier <[email protected]>
Date:   Thu Apr 25 18:25:00 2013 +0200

    lib: Bump the style of the Perl lib code
    
    Signed-off-by: Niels Thykier <[email protected]>

diff --git a/lib/Debian/Javahelper/Eclipse.pm b/lib/Debian/Javahelper/Eclipse.pm
index 80f453c..f7f7c1f 100644
--- a/lib/Debian/Javahelper/Eclipse.pm
+++ b/lib/Debian/Javahelper/Eclipse.pm
@@ -8,12 +8,12 @@ Debian::Javahelper::Eclipse - Eclipse Helper Library.
 
 use strict;
 use warnings;
-use Debian::Debhelper::Dh_Lib('error', 'doit');
+use autodie;
 
-use Exporter;
-use vars qw(@ISA @EXPORT);
-@ISA = qw(Exporter);
-@EXPORT = qw(EOB_SYM_NAME EOB_BUNDLE_VERSION EOB_SYS_JAR 
&install_zipped_feature);
+use Exporter qw(import);
+use Debian::Debhelper::Dh_Lib qw(doit error);
+
+our @EXPORT = qw(EOB_SYM_NAME EOB_BUNDLE_VERSION EOB_SYS_JAR 
&install_zipped_feature);
 
 =head1 SYNOPSIS
 
@@ -104,7 +104,6 @@ use constant {
     EOB_SYM_NAME => 'Bundle-SymbolicName',
     EOB_BUNDLE_VERSION => 'Bundle-Version',
     EOB_SYS_JAR => '!!EOB_SYS_JAR',
-    
 };
 
 sub install_zipped_feature{
@@ -113,20 +112,20 @@ sub install_zipped_feature{
     my $orbitdeps = shift//[];
     my $package = shift;
     my $needs = shift;
-    doit("mkdir", "-p", $loc);
-    doit("unzip", "-qq", "-n", "-d", $loc, $fzip);
+    doit('mkdir', '-p', $loc);
+    doit('unzip', '-qq', '-n', '-d', $loc, $fzip);
     foreach my $orbitdep (@$orbitdeps){
        my $symname = $orbitdep->{${\EOB_SYM_NAME}};
        my $sysjar = $orbitdep->{${\EOB_SYS_JAR}};
        my @matches = glob("$loc/eclipse/plugins/${symname}_*.jar");
        if(scalar(@matches) > 1){
            error("${symname}_*.jar unexpected matched more than one jar; ".
-                 "please assert whether this is intended and report a bug ".
-                 "against javahelper.");
+                 'please assert whether this is intended and report a bug '.
+                 'against javahelper.');
        }
        foreach my $match (@matches){
-           doit("rm", "-f", $match);
-           doit("ln", "-s", $sysjar, $match);
+           doit('rm', '-f', $match);
+           doit('ln', '-s', $sysjar, $match);
            if(defined($needs) && $sysjar =~ m@^/usr/share/java/@o){
                $needs->{$sysjar} = {} unless(exists($needs->{$sysjar}));
                $needs->{$sysjar}{$package} = 1;
diff --git a/lib/Debian/Javahelper/Java.pm b/lib/Debian/Javahelper/Java.pm
index 785dac7..35c344c 100644
--- a/lib/Debian/Javahelper/Java.pm
+++ b/lib/Debian/Javahelper/Java.pm
@@ -8,14 +8,15 @@ Debian::Javahelper::Java - Javahelper core library.
 
 use strict;
 use warnings;
+use autodie;
 
 use Cwd 'abs_path';
+use Exporter qw(import);
 use File::Spec;
-use Exporter;
+
 use Debian::Javahelper::Manifest();
-use vars qw(@ISA @EXPORT);
-@ISA = qw(Exporter);
-@EXPORT = qw(&scan_javadoc &find_package_for_existing_files &write_manifest_fd 
&parse_manifest_fd);
+
+our @EXPORT = qw(&scan_javadoc &find_package_for_existing_files 
&write_manifest_fd &parse_manifest_fd);
 
 =head1 SYNOPSIS
 
@@ -107,11 +108,10 @@ sub scan_javadoc{
     my @packages = slurp_file("$docloc/package-list");
     # For each package in package-list (replacing "." with "/")
     foreach my $pack ( map { s@\.@/@go; $_; } @packages) {
-       opendir(my $dir, "$docloc/$pack") or die("$docloc/$pack: $!");
+       opendir(my $dir, "$docloc/$pack");
        # For each html file in $dir
        foreach my $file ( grep { m/\.html$/iox } readdir($dir)){
-           open(my $htfile, "<", "$docloc/$pack/$file") or
-               die("$docloc/$pack/$file: $!");
+           open(my $htfile, '<', "$docloc/$pack/$file");
            while( my $line = <$htfile> ){
                my $target;
                my $packname;
@@ -127,6 +127,7 @@ sub scan_javadoc{
                }
                $phash{"/usr/share/doc/$packname/$apif"} = 1;
            }
+            close($htfile);
        }
        closedir($dir);
     }
@@ -136,7 +137,7 @@ sub scan_javadoc{
 sub slurp_file{
     my $file = shift;
     my @data;
-    open(my $handle, "<", $file) or die("$file: $!");
+    open(my $handle, '<', $file);
     while(my $line = <$handle> ){
        chomp($line);
         $line =~ s/\r$//o;
@@ -156,7 +157,7 @@ sub find_package_for_existing_files{
        $file =~ s@[/]+$@@og;
        $files{$file} = 1;
     }
-    open(my $dpkg, "-|", "dpkg -S " . join(" ", @_)) or die("Cannot run dpkg 
-S: $!");
+    open(my $dpkg, '-|', 'dpkg', '-S',  @_);
     while( my $line = <$dpkg> ){
        my ($pkg, $file) = split(/:\s++/ox, $line);
        chomp($file);
@@ -222,7 +223,7 @@ sub write_manifest_section_fd{
     my $name = shift;
     # return manifest-version and name first
     foreach my $entry ($sec->get_values()) {
-       my $line = join(": ", @$entry);
+       my $line = join(': ', @$entry);
        # Extend long lines.  Technically this is incorrect since the
        # rules says "bytes" and not "characters".
        #
@@ -232,7 +233,7 @@ sub write_manifest_section_fd{
        # If you change this, remember to change jh_build as well,
        # which also have this.
        $line =~ s/(.{72})(?=.)/$1\n /go;
-       print $fd "$line\n";
+       print {$fd} $line, "\n";
     }
     print $fd "\n";
     1;
diff --git a/lib/Debian/Javahelper/Manifest.pm 
b/lib/Debian/Javahelper/Manifest.pm
index 29ece66..34603b9 100644
--- a/lib/Debian/Javahelper/Manifest.pm
+++ b/lib/Debian/Javahelper/Manifest.pm
@@ -8,9 +8,12 @@ Debian::Javahelper::Manifest - Javahelper representation of a 
Jar Manifest
 
 use strict;
 use warnings;
+use autodie;
+
+use Exporter qw(import);
 
 use Debian::Javahelper::ManifestSection;
-use base qw(Exporter);
+
 # pass it on to others.
 our @EXPORT = qw(MAIN_SECTION);
 
@@ -101,7 +104,7 @@ sub get_section {
     my $this = shift;
     my $sname = shift;
     my $create = shift//0;
-    my $sec = $this->{$sname}; 
+    my $sec = $this->{$sname};
     if(!defined($sec) && $create){
        $sec = Debian::Javahelper::ManifestSection->new($sname);
        $this->{$sname} = $sec;
diff --git a/lib/Debian/Javahelper/ManifestSection.pm 
b/lib/Debian/Javahelper/ManifestSection.pm
index 35416af..2247bb5 100644
--- a/lib/Debian/Javahelper/ManifestSection.pm
+++ b/lib/Debian/Javahelper/ManifestSection.pm
@@ -9,7 +9,9 @@ Debian::Javahelper::ManifestSection - Javahelper representation 
of a section in
 
 use strict;
 use warnings;
-use base qw(Exporter);
+use autodie;
+
+use Exporter qw(import);
 our @EXPORT = qw(MAIN_SECTION);
 
 use constant {
@@ -127,7 +129,7 @@ sub get_value {
        return $val->[1];
     }
     return '' if($empty);
-    return undef;
+    return;
 }
 
 sub get_values {

-- 
UNNAMED PROJECT

_______________________________________________
pkg-java-commits mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-java-commits

Reply via email to