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

[lintian] 01/01: cruft: Use ->field's default parameter



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

nthykier pushed a commit to branch master
in repository lintian.

commit b6cc0c6b3ee4b75a4819d9337fcb98eac93c0158
Author: Niels Thykier <niels@thykier.net>
Date:   Sun Jun 18 11:53:37 2017 +0000

    cruft: Use ->field's default parameter
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 checks/cruft.pm | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/checks/cruft.pm b/checks/cruft.pm
index 449f6e1..a008406 100644
--- a/checks/cruft.pm
+++ b/checks/cruft.pm
@@ -350,13 +350,12 @@ sub run {
     # or libtool.
     my $ltinbd  = $info->relation('build-depends-all')->implies($LIBTOOL);
     my %warned;
-    my $format = $info->field('format');
-
     # Assume the package to be non-native if the field is not present.
     # - while 1.0 is more likely in this case, Lintian will probably get
     #   better results by checking debfiles/ rather than looking for a diffstat
     #   that may not be present.
-    $format = '3.0 (quilt)' unless defined $format;
+    my $format = $info->field('format', '3.0 (quilt)');
+
     if ($format =~ /^\s*2\.0\s*\z/ or $format =~ /^\s*3\.0\s*\(quilt\)/) {
         check_debian_dir($info, \%warned);
     }elsif (not $info->native) {

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


Reply to: