[lintian] 01/03: c/fields: Tag non-canonical forms of CRAN homepage
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch master
in repository lintian.
commit 16a7afbc50239361ea9433bb7c2e4a7329e4831c
Author: Dylan Aïssi <bob.dybian@gmail.com>
Date: Fri Sep 30 07:47:04 2016 +0000
c/fields: Tag non-canonical forms of CRAN homepage
Check for the canonical form of the homepage field of CRAN R packages
Signed-off-by: Niels Thykier <niels@thykier.net>
---
checks/fields.desc | 15 +++++++++++++++
checks/fields.pm | 3 +++
debian/changelog | 2 ++
t/tests/fields-cran-homepage/debian/debian/control.in | 16 ++++++++++++++++
t/tests/fields-cran-homepage/desc | 4 ++++
t/tests/fields-cran-homepage/tags | 2 ++
6 files changed, 42 insertions(+)
diff --git a/checks/fields.desc b/checks/fields.desc
index 36fd0fd..a8143f6 100644
--- a/checks/fields.desc
+++ b/checks/fields.desc
@@ -1303,3 +1303,18 @@ Info: This .dsc file contains no Checksum-Sha256 field and hence only
Accordingly it can be fixed by simply rebuilding the source package
with a more recent dpkg-source version, i.e. by uploading a new
Debian release of the package.
+
+Tag: homepage-for-cran-package-not-canonical
+Severity: wishlist
+Certainty: certain
+Info: The Homepage field for this package points to an uncanonical CRAN URL.
+ Please update to use the current canonical URL instead. The canonical URL is
+ recommended for use in publications, etc., will always redirect to current
+ release version (or devel if package is not in release yet). For example, the
+ link for the package "foo" should be:
+ .
+ https://cran.r-project.org/package=foo
+ .
+ not:
+ .
+ https://cran.r-project.org/web/packages/foo/index.html
diff --git a/checks/fields.pm b/checks/fields.pm
index c8bf898..66b8d77 100644
--- a/checks/fields.pm
+++ b/checks/fields.pm
@@ -616,6 +616,9 @@ sub run {
{
tag 'homepage-for-cpan-package-contains-version', $orig;
}
+ if ($homepage=~ m,/cran\.r-project\.org/web/packages/.+,){
+ tag 'homepage-for-cran-package-not-canonical', $orig;
+ }
} elsif (not $info->native) {
if ($type eq 'source') {
my $binary_has_homepage_field = 0;
diff --git a/debian/changelog b/debian/changelog
index 4e5e585..e9e81a8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -38,6 +38,8 @@ lintian (2.5.48) UNRELEASED; urgency=low
Thanks to Helmut Grohne for the bug report. (Closes: #831633)
+ [NT] Apply patch from Dylan Aïssi to tag r-bioc packages not in
section "gnu-r". (Closes: #839263)
+ + [NT] Apply patch from Dylan Aïssi to tag non-canonical uses of
+ the cran homepage in the Homepage field. (Closes: #839553)
* checks/files.{desc,pm}:
+ [CL, NT] Tag usages of shell wildcard characters in file names.
(Closes: #814326)
diff --git a/t/tests/fields-cran-homepage/debian/debian/control.in b/t/tests/fields-cran-homepage/debian/debian/control.in
new file mode 100644
index 0000000..a2f196c
--- /dev/null
+++ b/t/tests/fields-cran-homepage/debian/debian/control.in
@@ -0,0 +1,16 @@
+Source: {$source}
+Priority: extra
+Section: {$section}
+Maintainer: {$author}
+Standards-Version: {$standards_version}
+Build-Depends: {$build_depends}
+Homepage: https://cran.r-project.org/web/packages/foo/index.html
+
+Package: {$source}
+Architecture: {$architecture}
+Depends: $\{shlibs: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-cran-homepage/desc b/t/tests/fields-cran-homepage/desc
new file mode 100644
index 0000000..778a339
--- /dev/null
+++ b/t/tests/fields-cran-homepage/desc
@@ -0,0 +1,4 @@
+Testname: fields-cran-homepage
+Version: 1.0
+Description: CRAN Homepage URLs should be canonical
+Test-For: homepage-for-cran-package-not-canonical
diff --git a/t/tests/fields-cran-homepage/tags b/t/tests/fields-cran-homepage/tags
new file mode 100644
index 0000000..ee519af
--- /dev/null
+++ b/t/tests/fields-cran-homepage/tags
@@ -0,0 +1,2 @@
+I: fields-cran-homepage source: homepage-for-cran-package-not-canonical https://cran.r-project.org/web/packages/foo/index.html
+I: fields-cran-homepage: homepage-for-cran-package-not-canonical https://cran.r-project.org/web/packages/foo/index.html
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: