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

[lintian] 01/01: lib/Lintian/Collect/{Package, Source}.pm: Don't require that src-orig-index.gz actually contains any files rather than faking an entry.



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

lamby pushed a commit to branch master
in repository lintian.

commit f5a67446fb85eb84dc6753af4cfb6b53903727f4
Author: Chris Lamb <lamby@debian.org>
Date:   Sun Dec 24 16:36:48 2017 +0000

    lib/Lintian/Collect/{Package,Source}.pm: Don't require that src-orig-index.gz actually contains any files rather than faking an entry.
---
 debian/changelog               | 4 ++++
 lib/Lintian/Collect/Package.pm | 3 ++-
 lib/Lintian/Collect/Source.pm  | 1 +
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index fb7f87f..3055ec7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -70,6 +70,10 @@ lintian (2.5.66) UNRELEASED; urgency=medium
     + [CL] Tag relevant build-dependencies with <!nocheck>.
     + [NT] Bump versioned Build-Dependency on debhelper to 11~.
 
+  * lib/Lintian/Collect/{Package,Source}.pm:
+    + [CL] Don't require that src-orig-index.gz actually contains any files
+      rather than faking an entry.
+
   * reporting/templates/maintainer.tmpl:
     + [CL] Correct invalid "else if" syntax with "elsif". Thanks to Uwe
       Kleine-König for the report.
diff --git a/lib/Lintian/Collect/Package.pm b/lib/Lintian/Collect/Package.pm
index b092b8d..740f800 100644
--- a/lib/Lintian/Collect/Package.pm
+++ b/lib/Lintian/Collect/Package.pm
@@ -420,6 +420,7 @@ sub _fetch_index_data {
     my $field = $load_info->{'field'};
     my $index = $load_info->{'index_file'};
     my $indexown = $load_info->{'index_owner_file'};
+    my $allow_empty = $load_info->{'allow_empty'} // 0;
     my $idx = open_gz("$base_dir/${index}.gz");
     my $fs_info = Lintian::Path::FSInfo->new(
         '_collect' => $self,
@@ -537,7 +538,7 @@ sub _fetch_index_data {
             push(@check_dirs, $parent) if not exists($idxh{$parent});
         }
     }
-    if (!exists($idxh{''})) {
+    if (!$allow_empty and !exists($idxh{''})) {
         internal_error('The root dir should be present or have been faked');
     }
     if (%rhlinks) {
diff --git a/lib/Lintian/Collect/Source.pm b/lib/Lintian/Collect/Source.pm
index 518eae2..2c89a97 100644
--- a/lib/Lintian/Collect/Source.pm
+++ b/lib/Lintian/Collect/Source.pm
@@ -299,6 +299,7 @@ sub orig_index {
         # source packages do not have anchored roots as they can be
         # unpacked anywhere...
         'has_anchored_root_dir' => 1,
+        'allow_empty' => 1,
     };
     return $self->_fetch_index_data($load_info, $file);
 }

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


Reply to: