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

Bug#845201: [Pkg-rust-maintainers] Patch for Lintian updates for Rust packaging in /usr/share/cargo/registry



On Wed, Nov 23, 2016 at 01:47:49PM +0100, Sylvestre Ledru wrote:
> Le 23/11/2016 à 12:58, Josh Triplett a écrit :
> > Control: tags -1 + patch
> > 
> > The attached patch implements these changes.
>  Having a test would be great!
> Thanks for doing that

Done; new patch attached.

- Josh Triplett
>From 138d46ba4520aa54c483d0e334fb1d99c42d4537 Mon Sep 17 00:00:00 2001
From: Josh Triplett <josh@joshtriplett.org>
Date: Wed, 23 Nov 2016 03:48:50 -0800
Subject: [PATCH] Exclude files under /usr/share/cargo/registry/ from a few
 checks

That directory contains unmodified upstream sources.
(Closes: #845201)
---
 checks/files.pm                                        | 5 ++++-
 checks/scripts.pm                                      | 1 +
 debian/changelog                                       | 5 +++++
 t/tests/files-package-contains-foo/debian/debian/rules | 6 ++++++
 4 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/checks/files.pm b/checks/files.pm
index b19b3bf..50b6381 100644
--- a/checks/files.pm
+++ b/checks/files.pm
@@ -1218,6 +1218,8 @@ sub run {
             and not $fname =~ m,^usr/share/man/(?:[^/]+/)?man\d/,o
             # liblicense (again)
             and not $fname =~ m,^usr/share/pyshared-data/,o
+            # Rust crate unmodified upstream sources
+            and not $fname =~ m,^usr/share/cargo/registry/,o
             # Some GNOME/GTK software uses these to show the "license
             # header".
             and not $fname =~ m,
@@ -1365,7 +1367,8 @@ sub run {
             }
 
             # ---------------- vcs control files
-            if ($fname =~ m,$VCS_FILES_OR_ALL,) {
+            if (    $fname =~ m,$VCS_FILES_OR_ALL,
+                and $fname !~ m,^usr/share/cargo/registry/,) {
                 tag 'package-contains-vcs-control-file', $file;
             }
 
diff --git a/checks/scripts.pm b/checks/scripts.pm
index f40fddd..bf1700f 100644
--- a/checks/scripts.pm
+++ b/checks/scripts.pm
@@ -311,6 +311,7 @@ sub run {
             or $filename =~ m,^usr/(?:lib|share)/.*\.pm,
             or $filename =~ m,^usr/(?:lib|share)/.*\.py,
             or $filename =~ m,^usr/(?:lib|share)/ruby/.*\.rb,
+            or $filename =~ m,^usr/share/cargo/registry/,
             or $filename =~ m,^usr/share/debconf/confmodule(?:\.sh)?$,
             or $filename =~ m,\.in$,
             or $filename =~ m,\.erb$,
diff --git a/debian/changelog b/debian/changelog
index eeeaef0..1c87d05 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,6 +20,11 @@ lintian (2.5.50) UNRELEASED; urgency=medium
   * data/files/privacy-breaker-websites:
     + [BR] Detect more logos.
 
+  * checks/{files,scripts}.pm:
+    + [JT] Exclude files under /usr/share/cargo/registry/ from a few checks,
+      as that directory contains unmodified upstream sources.
+      (Closes: #845201)
+
  -- Niels Thykier <niels@thykier.net>  Wed, 26 Oct 2016 20:42:18 +0000
 
 lintian (2.5.49) unstable; urgency=medium
diff --git a/t/tests/files-package-contains-foo/debian/debian/rules b/t/tests/files-package-contains-foo/debian/debian/rules
index e90d722..03bb6b8 100644
--- a/t/tests/files-package-contains-foo/debian/debian/rules
+++ b/t/tests/files-package-contains-foo/debian/debian/rules
@@ -49,3 +49,9 @@ override_dh_install:
 	mkdir -p $(SHARE)/cmake-3.1/Modules
 	touch $(SHARE)/cmake-3.1/FindFoo.cmake
 	touch $(SHARE)/cmake-3.1/Modules/FindVar.cmake
+
+	# Ignored Cargo sources
+	mkdir -p $(SHARE)/cargo/registry/crate-1.0.0
+	touch $(SHARE)/cargo/registry/crate-1.0.0/.gitignore
+	touch $(SHARE)/cargo/registry/crate-1.0.0/LICENSE
+	echo '#!/bin/sh' > $(SHARE)/cargo/registry/crate-1.0.0/test.sh
-- 
2.10.2


Reply to: