[lintian] 02/02: Ensure salsa.debian.org Vcs-Git and Vcs-Browser URIs are canonical and do not redirect. (Closes: #888809)
This is an automated email from the git hooks/post-receive script.
lamby pushed a commit to branch master
in repository lintian.
commit 7592ff5f83deda44716ac8d96340f29998eb3e41
Author: Chris Lamb <lamby@debian.org>
Date: Thu Feb 1 18:37:38 2018 +0000
Ensure salsa.debian.org Vcs-Git and Vcs-Browser URIs are canonical and do not redirect. (Closes: #888809)
---
checks/fields.pm | 4 ++++
debian/changelog | 2 ++
.../debian/debian/control.in | 18 ++++++++++++++++++
t/tests/fields-uncanonical-salsa-vcs-fields/desc | 5 +++++
t/tests/fields-uncanonical-salsa-vcs-fields/tags | 2 ++
5 files changed, 31 insertions(+)
diff --git a/checks/fields.pm b/checks/fields.pm
index a042b08..d3c389a 100644
--- a/checks/fields.pm
+++ b/checks/fields.pm
@@ -129,6 +129,8 @@ my %VCS_CANONIFY = (
{https://anonscm.debian.org/git/};
$_[0] =~ s{https?\Q://bzr.debian.org/loggerhead/\E}
{https://anonscm.debian.org/loggerhead/};
+ $_[0] =~ s{https?\Q://salsa.debian.org/\E([^/]+/[^/]+)\.git/?$}
+ {https://salsa.debian.org/$1};
if ($_[0] =~ m{https?\Q://anonscm.debian.org/viewvc/\E}xsm) {
if ($_[0] =~ s{\?(.*[;\&])?op=log(?:[;\&](.*))?\Z}{}xsm) {
my (@keep) = ($1, $2, $3);
@@ -172,6 +174,8 @@ my %VCS_CANONIFY = (
{https://anonscm.debian.org/git/};
$_[0] =~ s{\Qgit://anonscm.debian.org/git/\E}
{https://anonscm.debian.org/git/};
+ $_[0] =~ s{https?\Q://salsa.debian.org/\E([^/]+/[^/]+)(?!\.git)$}
+ {https://salsa.debian.org/$1.git};
},
hg => sub {
$_[0] =~ s{https?\Q://hg.debian.org/\E}
diff --git a/debian/changelog b/debian/changelog
index d971d22..0747ef5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -33,6 +33,8 @@ lintian (2.5.73) UNRELEASED; urgency=medium
packages such as cdbs or debhelper. (Closes: #700953)
+ [CL] Emit a warning about documentation packages that end with -docs.
(Closes: #664520)
+ + [CL] Ensure salsa.debian.org Vcs-Git and Vcs-Browser URIs are
+ canonical and do not redirect. (Closes: #888809)
* checks/java.{desc,pm}:
+ [CL] Check for .jar files that do not match the Debian Java policy.
(Closes: #791552)
diff --git a/t/tests/fields-uncanonical-salsa-vcs-fields/debian/debian/control.in b/t/tests/fields-uncanonical-salsa-vcs-fields/debian/debian/control.in
new file mode 100644
index 0000000..ac605a7
--- /dev/null
+++ b/t/tests/fields-uncanonical-salsa-vcs-fields/debian/debian/control.in
@@ -0,0 +1,18 @@
+Source: {$source}
+Priority: optional
+Section: {$section}
+Maintainer: {$author}
+Standards-Version: {$standards_version}
+Build-Depends: {$build_depends}
+Rules-Requires-Root: no
+Vcs-Git: https://salsa.debian.org/foo/bar
+Vcs-Browser: https://salsa.debian.org/foo/bar.git
+
+Package: {$source}
+Architecture: {$architecture}
+Depends: $\{misc:Depends\}
+Description: {$description}
+ This is a test package designed to exercise some feature or tag of
+ Lintian. It is part of the Lintian test suite and may do very odd
+ things. It should not be installed like a regular package. It may
+ be an empty package.
diff --git a/t/tests/fields-uncanonical-salsa-vcs-fields/desc b/t/tests/fields-uncanonical-salsa-vcs-fields/desc
new file mode 100644
index 0000000..6d49615
--- /dev/null
+++ b/t/tests/fields-uncanonical-salsa-vcs-fields/desc
@@ -0,0 +1,5 @@
+Testname: fields-uncanonical-salsa-vcs-fields
+Description: Test for vcs fields needing canonization (salsa)
+Version: 1.0
+Test-For:
+ vcs-field-not-canonical
diff --git a/t/tests/fields-uncanonical-salsa-vcs-fields/tags b/t/tests/fields-uncanonical-salsa-vcs-fields/tags
new file mode 100644
index 0000000..526bf7b
--- /dev/null
+++ b/t/tests/fields-uncanonical-salsa-vcs-fields/tags
@@ -0,0 +1,2 @@
+I: fields-uncanonical-salsa-vcs-fields source: vcs-field-not-canonical https://salsa.debian.org/foo/bar https://salsa.debian.org/foo/bar.git
+I: fields-uncanonical-salsa-vcs-fields source: vcs-field-not-canonical https://salsa.debian.org/foo/bar.git https://salsa.debian.org/foo/bar
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: