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

[SCM] Debian package checker branch, master, updated. 2.5.11-211-g5e35e10



The following commit has been merged in the master branch:
commit 5e35e10393c179268588838025461213a21c080b
Author: Niels Thykier <niels@thykier.net>
Date:   Tue Apr 2 17:19:10 2013 +0200

    private/*: Test with strict.t and critic.t
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/private/generate-lintian-pod b/private/generate-lintian-pod
index 347f406..a1581ca 100755
--- a/private/generate-lintian-pod
+++ b/private/generate-lintian-pod
@@ -75,7 +75,7 @@ sub pretty_print {
 sub extract_data {
     my ($folder, $fname, $abname) = @_;
     print "=over 4\n\n";
-    foreach my $file (<$folder/*.desc>) {
+    foreach my $file (glob ("$folder/*.desc")) {
         my ($header, @ignore) = read_dpkg_control ($file);
         my $name = $header->{$fname};
         my $abbr;
diff --git a/private/generate-profiles.pl b/private/generate-profiles.pl
index df7ef18..387d7a7 100755
--- a/private/generate-profiles.pl
+++ b/private/generate-profiles.pl
@@ -31,7 +31,7 @@ my @checks;
 my @fatal;
 my @nonfatal;
 
-foreach my $check (<$root/checks/*.desc>){
+foreach my $check (glob ("$root/checks/*.desc")){
     my ($header, undef) = read_dpkg_control($check);
     my $cname = $header->{'check-script'};
     fail "$check missing check-script\n" unless defined $cname;
diff --git a/private/graph b/private/graph
index 09ba0c4..c11e2ad 100755
--- a/private/graph
+++ b/private/graph
@@ -183,8 +183,8 @@ sub mark_longest_paths {
     # paths *must* pass through a node in each level.
 
     my $path_marks = {};
-    my @c = @{ $levels[$#levels] };
-    for ( my $i = $#levels ; $i >= 0 ; $i--) {
+    my @c = @{ $levels[-1] };
+    for my $i ($#levels..0) {
         my $next = $i - 1;
         my @nc = ();
         foreach my $node (@c) {
diff --git a/private/refresh-archs b/private/refresh-archs
index eb460be..8590ced 100755
--- a/private/refresh-archs
+++ b/private/refresh-archs
@@ -123,13 +123,13 @@ $ENV{'LC_ALL'} = 'C';
 my $dver = `dpkg-architecture --version | head -n1`;
 chomp $dver;
 
-open my $dlfd, '-|', "dpkg-architecture -L 2>/dev/null" or die "dpkg-architecture -L: $!";
+open my $dlfd, '-|', 'dpkg-architecture', '-L' or die "dpkg-architecture -L: $!";
 while ( my $archstr = <$dlfd> ) {
     my @hardening;
     my @htags;
     delete $ENV{'DEB_HOST_ARCH'};
     chomp $archstr;
-    open my $dafd, '-|', "dpkg-architecture -a$archstr 2>/dev/null" or die "dpkg-architecture -a$archstr: $!";
+    open my $dafd, '-|', 'dpkg-architecture', "-a$archstr" or die "dpkg-architecture -a$archstr: $!";
     while ( my $var = <$dafd> ) {
         chomp $var;
         my ($key, $value) = split /=/, $var, 2;
@@ -138,7 +138,7 @@ while ( my $archstr = <$dlfd> ) {
     close $dafd;
 
     $ENV{'DEB_HOST_ARCH'} = $archstr;
-    open my $dbfd, "-|", "dpkg-buildflags --query-features hardening 2>/dev/null" or die "dpkg-buildflags --query-features hardening: $!";
+    open my $dbfd, '-|', 'dpkg-buildflags', '--query-features', 'hardening' or die "dpkg-buildflags --query-features hardening: $!";
     @hardening = parse_dpkg_control ($dbfd);
     close $dbfd;
 
diff --git a/private/refresh-ftp-master-tags b/private/refresh-ftp-master-tags
index ce7e3fa..6e8f43f 100755
--- a/private/refresh-ftp-master-tags
+++ b/private/refresh-ftp-master-tags
@@ -21,13 +21,15 @@
 use strict;
 use warnings;
 
-use LWP::Simple qw(get);
+# Not a B-D and script is compile tested...
+require LWP::Simple;
+import LWP::Simple qw(get);
 use POSIX qw(strftime);
 
 BEGIN {
     my $LINTIAN_ROOT = $ENV{'LINTIAN_ROOT'};
     if (not $LINTIAN_ROOT) {
-        use Cwd ();
+        require Cwd;
         $ENV{'LINTIAN_ROOT'} = $LINTIAN_ROOT = Cwd::cwd();
     } else {
         chdir $LINTIAN_ROOT or die "Cannot chdir to $LINTIAN_ROOT: $!\n";
diff --git a/private/refresh-locale-codes b/private/refresh-locale-codes
index d59affb..9cd46bb 100755
--- a/private/refresh-locale-codes
+++ b/private/refresh-locale-codes
@@ -120,7 +120,7 @@ sub parse_iso_query {
     while (<$fd>) {
         next unless m/^\w{3}\s+(\w{3})\s+(?:(\w{2})\s+)?/;
         my ($iso1, $iso2) = ($2, $1);
-        next if $iso2 eq "zxx";
+        next if $iso2 eq 'zxx';
         if (!defined $iso1) {
             $iso1 = $iso2;
             $iso2 = undef;
diff --git a/private/refresh-manual-refs b/private/refresh-manual-refs
index ac9e0db..14d77ef 100755
--- a/private/refresh-manual-refs
+++ b/private/refresh-manual-refs
@@ -33,7 +33,7 @@ use POSIX qw(strftime);
 BEGIN {
     my $LINTIAN_ROOT = $ENV{'LINTIAN_ROOT'};
     if (not $LINTIAN_ROOT) {
-        use Cwd ();
+        require Cwd;
         $ENV{'LINTIAN_ROOT'} = $LINTIAN_ROOT = Cwd::cwd();
     } else {
         chdir $LINTIAN_ROOT or die "Cannot chdir to $LINTIAN_ROOT: $!\n";
diff --git a/private/refresh-perl-provides b/private/refresh-perl-provides
index 5465a12..a31d53b 100755
--- a/private/refresh-perl-provides
+++ b/private/refresh-perl-provides
@@ -26,6 +26,8 @@ use warnings;
 use AptPkg::Config '$_config';
 use AptPkg::System '$_system';
 use AptPkg::Cache;
+use List::MoreUtils qw(none);
+
 
 (my $self = $0) =~ s#.*/##;
 
@@ -55,7 +57,7 @@ my @core_packages = (qw(perl-base perl perl-modules));
 
 # check we have a cache of Debian sid packages available
 warn('Warning: this list should only be updated on a system with an up to date APT cache of the Debian unstable distribution')
-    if !grep { defined $_->{Origin} &&
+    if none { defined $_->{Origin} &&
                defined $_->{Archive} &&
                $_->{Origin} eq 'Debian' &&
                $_->{Archive} eq 'unstable' }
diff --git a/private/tag-stats b/private/tag-stats
index 8cc6cdc..64e8c46 100755
--- a/private/tag-stats
+++ b/private/tag-stats
@@ -14,7 +14,7 @@ use warnings;
 BEGIN {
     my $LINTIAN_ROOT = $ENV{'LINTIAN_ROOT'};
     if (not $LINTIAN_ROOT) {
-        use Cwd ();
+        require Cwd;
         $ENV{'LINTIAN_ROOT'} = $LINTIAN_ROOT = Cwd::cwd();
     } else {
         chdir $LINTIAN_ROOT or die "Cannot chdir to $LINTIAN_ROOT: $!\n";
diff --git a/private/update-coverage b/private/update-coverage
index f9fe2d6..370ba41 100755
--- a/private/update-coverage
+++ b/private/update-coverage
@@ -16,7 +16,7 @@ use POSIX qw(strftime);
 BEGIN {
     my $LINTIAN_ROOT = $ENV{'LINTIAN_ROOT'};
     if (not $LINTIAN_ROOT) {
-        use Cwd ();
+        require Cwd;
         $ENV{'LINTIAN_ROOT'} = $LINTIAN_ROOT = Cwd::cwd();
     } else {
         chdir $LINTIAN_ROOT or die "Cannot chdir to $LINTIAN_ROOT: $!\n";
@@ -43,7 +43,7 @@ my $total;
 my $check_total;
 my ($tc, $ltc);
 my ($ctc, $cltc);
-for my $desc (<checks/*.desc>) {
+for my $desc (glob ('checks/*.desc')) {
     for my $data (read_dpkg_control($desc)) {
         $desc =~ s,.*/,,;
         $desc =~ s/\.desc$//;
@@ -59,7 +59,7 @@ $check_total = scalar keys %checks;
 
 # Parse all test configuration files from the new test suite looking for
 # Test-For configuration options and remove those from the %tags hash.
-for my $desc (<t/tests/*/desc>, <t/changes/*.desc>, <t/debs/*/desc>, <t/source/*/desc>) {
+for my $desc (glob ('t/tests/*/desc t/changes/*.desc t/debs/*/desc t/source/*/desc')) {
     my ($data) = read_dpkg_control($desc);
     if (exists $data->{'test-for'}) {
         for my $tag (split(' ', $data->{'test-for'})) {
@@ -78,7 +78,7 @@ $ctc = $check_total - scalar keys %checks;
 # Now parse all tags files from the old test suite looking for what tags that
 # test reveals.
 my (%legacy, %legacy_test);
-for my $tagfile (<testset/tags.*>) {
+for my $tagfile (glob ('testset/tags.*')) {
     next if $tagfile =~ /\.sed$/;
     my $case = $tagfile;
     $case =~ s/.*tags\.//;
diff --git a/t/scripts/critic.t b/t/scripts/critic.t
index b4e1930..405143f 100755
--- a/t/scripts/critic.t
+++ b/t/scripts/critic.t
@@ -31,7 +31,7 @@ for my $check (@CHECKS) {
 }
 
 subtest 'All scripts with correct shebang or extension' => sub {
-    all_critic_ok(qw(collection frontend lib));
+    all_critic_ok(qw(collection frontend lib private));
 };
 
 sub should_skip() {
diff --git a/t/scripts/strict.t b/t/scripts/strict.t
index 99d6133..041b1d1 100755
--- a/t/scripts/strict.t
+++ b/t/scripts/strict.t
@@ -7,4 +7,5 @@ use Test::More;
 eval 'use Test::Strict';
 plan skip_all => "Test::Strict required to run this test" if $@;
 
-all_perl_files_ok( "$ENV{'LINTIAN_ROOT'}/lib" );
+my @DIRS = map { "$ENV{'LINTIAN_ROOT'}/$_" } qw(lib private frontend);
+all_perl_files_ok(@DIRS);

-- 
Debian package checker


Reply to: