Bug#845201: [Pkg-rust-maintainers] Patch for Lintian updates for Rust packaging in /usr/share/cargo/registry
On Wed, 23 Nov 2016 15:17:52 -0800 Josh Triplett <josh@joshtriplett.org> wrote:
> 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.
Just updated the patch again to cover another case (including a test for
it). Please use the attached version.
- Josh Triplett
>From 578bd1155cc2297d514da5b783c047cc0a924bbd 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 | 4 ++++
debian/changelog | 5 +++++
t/tests/files-package-contains-foo/debian/debian/rules | 8 ++++++++
4 files changed, 21 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..67a1743 100644
--- a/checks/scripts.pm
+++ b/checks/scripts.pm
@@ -298,6 +298,10 @@ sub run {
&& !$is_absolute
&& $in_examples);
+ # Skip upstream source code shipped in /usr/share/cargo/registry/
+ next
+ if ( $filename =~ m,usr/share/cargo/registry/, );
+
if ($interpreter eq '') {
script_tag('script-without-interpreter', $filename);
next;
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..a29fc66 100644
--- a/t/tests/files-package-contains-foo/debian/debian/rules
+++ b/t/tests/files-package-contains-foo/debian/debian/rules
@@ -49,3 +49,11 @@ 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
+ echo '#!/usr/bin/python' > $(SHARE)/cargo/registry/crate-1.0.0/test.py
+ chmod a+x $(SHARE)/cargo/registry/crate-1.0.0/test.py
--
2.10.2
Reply to: