Bug#757615: lintian: warn if a space is used in a DEP-5 license name
Package: lintian
Version: 2.5.25
Severity: wishlist
Tags: patch
Hi,
an overwhelming number of debian/copyright files in the archive uses
spaces in the license name even though they are forbidden. Lintian
should warn about these cases for debian/copyright files that declare to
be dep-5 compliant.
See attached patch.
cheers, josch
-- System Information:
Debian Release: jessie/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.14-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages lintian depends on:
ii binutils 2.24.51.20140617-1
ii bzip2 1.0.6-5
ii diffstat 1.58-1
ii file 1:5.19-1
ii gettext 0.18.3.2-3
ii hardening-includes 2.5
ii intltool-debian 0.35.0+20060710.1
ii libapt-pkg-perl 0.1.29+b1
ii libarchive-zip-perl 1.37-2
ii libclass-accessor-perl 0.34-1
ii libclone-perl 0.37-1
ii libdpkg-perl 1.17.10
ii libemail-valid-perl 1.194-1
ii libfile-basedir-perl 0.03-1
ii libipc-run-perl 0.92-1
ii liblist-moreutils-perl 0.33-2
ii libparse-debianchangelog-perl 1.2.0-1
ii libtext-levenshtein-perl 0.09-1
ii libtimedate-perl 2.3000-2
ii liburi-perl 1.62-1
ii man-db 2.6.7.1-1
ii patchutils 0.3.3-1
ii perl [libdigest-sha-perl] 5.18.2-6
ii t1utils 1.37-2
Versions of packages lintian recommends:
ii libautodie-perl 2.25-1
ii libperlio-gzip-perl 0.18-3
ii perl-modules [libautodie-perl] 5.18.2-6
Versions of packages lintian suggests:
pn binutils-multiarch <none>
ii dpkg-dev 1.17.10
ii libhtml-parser-perl 3.71-1+b1
ii libtext-template-perl 1.46-1
ii libyaml-perl 0.95-1
ii xz-utils 5.1.1alpha+20120614-2
-- no debconf information
>From c106aa4bea259fb16cca51207c9c5aa8a0f68828 Mon Sep 17 00:00:00 2001
From: josch <j.schauer@email.de>
Date: Sat, 9 Aug 2014 16:20:15 +0200
Subject: [PATCH] check for space in license short name
---
checks/source-copyright.desc | 8 ++++++++
checks/source-copyright.pm | 3 +++
.../debian/debian/copyright | 9 +++++++++
t/tests/source-copyright-invalid-license-name/desc | 7 +++++++
t/tests/source-copyright-invalid-license-name/tags | 1 +
5 files changed, 28 insertions(+)
create mode 100644 t/tests/source-copyright-invalid-license-name/debian/debian/copyright
create mode 100644 t/tests/source-copyright-invalid-license-name/desc
create mode 100644 t/tests/source-copyright-invalid-license-name/tags
diff --git a/checks/source-copyright.desc b/checks/source-copyright.desc
index 921e7b9..d8b486e 100644
--- a/checks/source-copyright.desc
+++ b/checks/source-copyright.desc
@@ -205,3 +205,11 @@ Info: The paragraph has a "License" and a "Copyright" field, but no
Lintian will attempt to guess what you intended and continue based on
its guess. If the guess is wrong, you may see spurious tags related
to this paragraph.
+
+Tag: space-in-std-shortname-in-dep5-copyright
+Certainty: certain
+Severity: normal
+Ref: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Info: The license header contains a short name with a space, which
+ does not conform to the specification. License names are case-insensitive,
+ and may not contain spaces.
diff --git a/checks/source-copyright.pm b/checks/source-copyright.pm
index 6b9a0c5..a75f59f 100644
--- a/checks/source-copyright.pm
+++ b/checks/source-copyright.pm
@@ -354,6 +354,9 @@ sub _parse_dep5 {
"(paragraph at line $lines[$i]{'START-OF-PARAGRAPH'})";
}
}
+ if ($license =~ / /) {
+ tag 'space-in-std-shortname-in-dep5-copyright', $license, "(paragraph at line $lines[$i]{'START-OF-PARAGRAPH'})";
+ }
}
return;
}
diff --git a/t/tests/source-copyright-invalid-license-name/debian/debian/copyright b/t/tests/source-copyright-invalid-license-name/debian/debian/copyright
new file mode 100644
index 0000000..a3eb687
--- /dev/null
+++ b/t/tests/source-copyright-invalid-license-name/debian/debian/copyright
@@ -0,0 +1,9 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: Doohickey
+Upstream-Contact: J. Random Hacker <j.r.hacker@example.com>
+Source: http://examples.com/doohickey/source/
+
+Files: debian/a*
+Copyright: 2014, somebody
+License: license with spaces
+ Fixme
diff --git a/t/tests/source-copyright-invalid-license-name/desc b/t/tests/source-copyright-invalid-license-name/desc
new file mode 100644
index 0000000..1344a13
--- /dev/null
+++ b/t/tests/source-copyright-invalid-license-name/desc
@@ -0,0 +1,7 @@
+Testname: source-copyright-invalid-license-name
+Sequence: 6000
+Version: 1.0
+Description: Test for invalid license namings
+Options: -I -E --pedantic
+Test-For:
+ space-in-std-shortname-in-dep5-copyright
diff --git a/t/tests/source-copyright-invalid-license-name/tags b/t/tests/source-copyright-invalid-license-name/tags
new file mode 100644
index 0000000..18e0bc3
--- /dev/null
+++ b/t/tests/source-copyright-invalid-license-name/tags
@@ -0,0 +1 @@
+W: source-copyright-invalid-license-name source: space-in-std-shortname-in-dep5-copyright license with spaces (paragraph at line 6)
--
2.0.1
Reply to: