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

[lintian] 05/05: c/rules: Use L::Path instead of debfiles



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

nthykier pushed a commit to branch master
in repository lintian.

commit cebf7e3d1f2c546d350f9ec8aed803c5ded60f44
Author: Niels Thykier <niels@thykier.net>
Date:   Thu Sep 25 21:51:00 2014 +0200

    c/rules: Use L::Path instead of debfiles
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 checks/rules.desc |  2 +-
 checks/rules.pm   | 12 ++++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/checks/rules.desc b/checks/rules.desc
index 74def6a..67533dd 100644
--- a/checks/rules.desc
+++ b/checks/rules.desc
@@ -1,7 +1,7 @@
 Check-Script: rules
 Author: Russ Allbery <rra@debian.org>
 Type: source
-Needs-Info: debfiles
+Needs-Info: unpacked
 Info: Check targets and actions in debian/rules.
 Abbrev: rul
 
diff --git a/checks/rules.pm b/checks/rules.pm
index da3c07f..071b5be 100644
--- a/checks/rules.pm
+++ b/checks/rules.pm
@@ -113,16 +113,20 @@ my %debhelper_order = (
 
 sub run {
     my (undef, undef, $info, undef, $group) = @_;
-    my $rules = $info->debfiles('rules');
+    my $debian_dir = $info->index_resolved_path('debian');
+    my $rules;
+    $rules = $debian_dir->child('rules') if $debian_dir;
+
+    return if not $rules;
 
     # Policy could be read as allowing debian/rules to be a symlink to
     # some other file, and in a native Debian package it could be a
     # symlink to a file that we didn't unpack.  Warn if it's a symlink
     # (dpkg-source does as well) and skip all the tests if we then
     # can't read it.
-    if (-l $rules) {
+    if ($rules->is_symlink) {
         tag 'debian-rules-is-symlink';
-        return unless -f $rules and is_ancestor_of($info->debfiles, $rules);
+        return unless $rules->is_open_ok;
     }
 
     my $architecture = $info->field('architecture', '');
@@ -130,7 +134,7 @@ sub run {
     # If the version field is missing, we assume a neutral non-native one.
     $version = '0-1' unless defined $version;
 
-    open(my $rules_fd, '<', $rules);
+    my $rules_fd = $rules->open;
 
     # Check for required #!/usr/bin/make -f opening line.  Allow -r or -e; a
     # strict reading of Policy doesn't allow either, but they seem harmless.

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


Reply to: