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

lamby pushed a commit to branch master
in repository lintian.

commit a75f3edcb099bd4b8794e2ecb7fd19e129e77f03
Author: Chris Lamb <la...@debian.org>
Date:   Sun Apr 8 22:36:13 2018 +0100

    Allow spaces within the ownership field of tar -tvf output whilst still 
allowing spaces in filenames. (Closes: #895175)
---
 debian/changelog               |  4 ++++
 lib/Lintian/Collect/Package.pm | 11 ++++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index ca970eb..d284aa9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,10 @@ lintian (2.5.82) UNRELEASED; urgency=medium
       some currently-problematic packages such as gcc-8-cross-ports
       preventing the update of https://lintian.debian.org/.  (See #890873)
 
+  * lib/Lintian/Collect/Package.pm:
+    + [CL] Allow spaces within the ownership field of tar -tvf output
+      whilst still allowing spaces in filenames.  (Closes: #895175)
+
  -- Chris Lamb <la...@debian.org>  Sat, 07 Apr 2018 10:14:46 +0100
 
 lintian (2.5.81) unstable; urgency=medium
diff --git a/lib/Lintian/Collect/Package.pm b/lib/Lintian/Collect/Package.pm
index 5b95f60..cb31a22 100644
--- a/lib/Lintian/Collect/Package.pm
+++ b/lib/Lintian/Collect/Package.pm
@@ -437,7 +437,16 @@ sub _fetch_index_data {
 
         my (%file, $perm, $operm, $ownership, $name, $raw_type, $size);
         my ($date, $time);
-        ($perm,$ownership,$size,$date,$time,$name)=split(' ', $line, 6);
+
+        # Parse line from output of "tar -tvf" allowing for spaces within the
+        # ownership field whilst still allowing spaces in filenames. (#895175)
+        #
+        # Note this cannot ever be 100% reliable as the filename might contain
+        # "fake" dates.
+        ($perm,$ownership,$size,$date,$time,$name)
+          = $line
+          =~ /^([-drwx]{10}) (.*?) (\d+) (\d{4}-\d\d-\d\d) (\d\d:\d\d) (.*)$/;
+        $ownership =~ s/\s+$//;
 
         $file{'date_time'} = "${date} ${time}";
         $raw_type = substr($perm, 0, 1);

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

Reply via email to