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

[lintian] 05/05: Remove some unnecessary stats and code paths doing stats



This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository lintian.

commit c4e28ff4718db29ac2345959d0a8509fe95434dc
Author: Niels Thykier <niels@thykier.net>
Date:   Sun Jan 1 12:47:07 2017 +0000

    Remove some unnecessary stats and code paths doing stats
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 collection/changelog-file | 8 +++-----
 collection/file-info      | 4 ----
 collection/java-info      | 4 ----
 collection/strings        | 4 ----
 4 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/collection/changelog-file b/collection/changelog-file
index 738596d..89aecb9 100755
--- a/collection/changelog-file
+++ b/collection/changelog-file
@@ -42,8 +42,8 @@ sub collect {
     # Ignore any symlinks to other packages here; in that case, we
     # just won't check the file.
     unlink("$dir/NEWS.Debian")
-      if -e "$dir/NEWS.Debian"
-      or -l "$dir/NEWS.Debian";
+      if -l "$dir/NEWS.Debian"
+      or -e _;
 
     # Pick the first of these files that exists.
     my @changelogs = (
@@ -66,7 +66,7 @@ sub collect {
     }
 
     for (@changelogs) {
-        if (-l $_ || -f $_) {
+        if (-l $_ || -f _) {
             $chl = $_;
             last;
         }
@@ -132,8 +132,6 @@ sub collect {
             if ($link =~ /\.\./
                 || ($link =~ m%/% && $link !~ m%^[^/]+(?:/+[^/]+)*\z%)) {
                 undef $news;
-            } elsif (!-f $news) {
-                undef $news;
             }
         }
         if ($news) {
diff --git a/collection/file-info b/collection/file-info
index 6b072f3..31e3a96 100755
--- a/collection/file-info
+++ b/collection/file-info
@@ -41,10 +41,6 @@ sub collect {
 
     my $outfile = "$dir/file-info.gz";
 
-    if (-e "$dir/file-info") {
-        unlink("$dir/file-info");
-    }
-
     if (-e $outfile) {
         unlink($outfile);
     }
diff --git a/collection/java-info b/collection/java-info
index 74dcda3..1875ebb 100755
--- a/collection/java-info
+++ b/collection/java-info
@@ -39,14 +39,10 @@ sub collect {
     my ($pkg, $type, $dir) = @_;
     my $info = Lintian::Collect->new($pkg, $type, $dir);
 
-    # Sanity check
     unless (-d "$dir/unpacked/") {
         fail 'java-info called with the wrong dir argument';
     }
 
-    if (-f "$dir/java-info") {
-        unlink("$dir/java-info");
-    }
     if (-f "$dir/java-info.gz") {
         unlink("$dir/java-info.gz");
     }
diff --git a/collection/strings b/collection/strings
index aae38a9..c6977dd 100755
--- a/collection/strings
+++ b/collection/strings
@@ -40,10 +40,6 @@ sub collect {
     my ($pkg, $type, $dir) = @_;
     my ($info, @manual, %opts);
 
-    if (-e "$dir/elf-index") {
-        unlink("$dir/elf-index");
-    }
-
     if (-d "$dir/strings") {
         delete_dir("$dir/strings") or fail "rmdir strings: $!";
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: