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

Bug#633779: lintian: validate DEP-5 debian/copyright files



* Niels Thykier <niels@thykier.net>, 2011-08-22, 10:53:
I renamed the check to source-copyright (from source-copyright-file, which was too long :P), fixed a few minor bugs, added tests.


Hey.

--- a/t/COVERAGE
+++ b/t/COVERAGE
@@ -1,5 +1,5 @@
-Last generated 2011-08-17
-Coverage: 697/915 (76.17%), w. legacy tests: 820/915 (89.62%)
+Last generated 2011-08-21
+Coverage: 712/930 (76.56%), w. legacy tests: 835/930 (89.78%)

When I run private/update-coverage after applying the patch I get

+Coverage: 704/930 (75.70%), w. legacy tests: 835/930 (88.92%)


plus it lists 7 new source-copyright tags that are not covered.  Is a
part of this patch missing?

Ooops, good catch. I attach the missing bits.

The patch carries 7 source-copyright tests (boilerplate-uri, missing, ood-uri [odd?],

That's OOD as in Out Of Date.

--
Jakub Wilk
diff --git a/t/tests/source-copyright-dep5-general/debian/debian/copyright b/t/tests/source-copyright-dep5-general/debian/debian/copyright
new file mode 100644
--- /dev/null
+++ b/t/tests/source-copyright-dep5-general/debian/debian/copyright
@@ -0,0 +1,57 @@
+Format: http://anonscm.debian.org/viewvc/dep/web/deps/dep5.mdwn?revision=174
+Upstream-Name: Doohickey
+Upstream-Maintainer: J. Random Hacker <j.r.hacker@example.com>
+Source: http://examples.com/doohickey/source/
+
+Comment: I'm a bogus paragraph.
+
+Files: a/*, b/*
+Copyright: 2011 J. Random Hacker <j.r.hacker@example.com>
+License: GPL-2
+
+Files: c
+Copyright: 2010 J. Random Hacker <j.r.hacker@example.com>
+
+Files: d
+License: GPL-3
+
+Files: 5
+License: MIT
+Copyright: 2010 J. Random Hacker <j.r.hacker@example.com>
+
+License: GPL-2
+ This package is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free Software
+ Foundation; version 2 dated June, 1991.
+ .
+ This package is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License along with
+ this package; if not, write to the Free Software Foundation, Inc., 51 Franklin
+ St, Fifth Floor, Boston, MA 02110-1301, USA.
+ .
+ On Debian systems, the full text of the GNU General Public License version 2
+ can be found in the file `/usr/share/common-licenses/GPL-2'.
+
+License: GPL-3
+
+License: Expat
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the â??Softwareâ??), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED â??AS ISâ??, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
diff --git a/t/tests/source-copyright-dep5-general/desc b/t/tests/source-copyright-dep5-general/desc
new file mode 100644
--- /dev/null
+++ b/t/tests/source-copyright-dep5-general/desc
@@ -0,0 +1,12 @@
+Testname: source-copyright-dep5-general
+Sequence: 6000
+Version: 1.0
+Description: Test for various errors in DEP-5 copyright files
+Test-For:
+ comma-separated-files-in-dep5-copyright
+ missing-field-in-dep5-copyright
+ missing-license-paragraph-in-dep5-copyright
+ missing-license-text-in-dep5-copyright
+ obsolete-field-in-dep5-copyright
+ unknown-paragraph-in-dep5-copyright
+ unused-license-paragraph-in-dep5-copyright
diff --git a/t/tests/source-copyright-dep5-general/tags b/t/tests/source-copyright-dep5-general/tags
new file mode 100644
--- /dev/null
+++ b/t/tests/source-copyright-dep5-general/tags
@@ -0,0 +1,8 @@
+I: source-copyright-dep5-general source: unused-license-paragraph-in-dep5-copyright paragraph 9 expat
+W: source-copyright-dep5-general source: comma-separated-files-in-dep5-copyright
+W: source-copyright-dep5-general source: missing-field-in-dep5-copyright paragraph 4 license
+W: source-copyright-dep5-general source: missing-field-in-dep5-copyright paragraph 5 copyright
+W: source-copyright-dep5-general source: missing-license-paragraph-in-dep5-copyright paragraph 6 mit
+W: source-copyright-dep5-general source: missing-license-text-in-dep5-copyright paragraph 8 gpl-3
+W: source-copyright-dep5-general source: obsolete-field-in-dep5-copyright upstream-maintainer upstream-contact
+W: source-copyright-dep5-general source: unknown-paragraph-in-dep5-copyright paragraph 2
diff --git a/t/tests/source-copyright-dep5-syntax-error/debian/debian/copyright b/t/tests/source-copyright-dep5-syntax-error/debian/debian/copyright
new file mode 100644
--- /dev/null
+++ b/t/tests/source-copyright-dep5-syntax-error/debian/debian/copyright
@@ -0,0 +1,22 @@
+Format: http://anonscm.debian.org/viewvc/dep/web/deps/dep5.mdwn?revision=174
+Upstream-Name: Doohickey
+Upstream-Contact: J. Random Hacker <j.r.hacker@example.com>
+Source: http://examples.com/doohickey/source/
+
+Files: *
+Copyright: 2011 J. Random Hacker <j.r.hacker@example.com>
+License: GPL-2
+ This package is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free Software
+ Foundation; version 2 dated June, 1991.
+
+ This package is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this package; if not, write to the Free Software Foundation, Inc., 51 Franklin
+ St, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ On Debian systems, the full text of the GNU General Public License version 2
+ can be found in the file `/usr/share/common-licenses/GPL-2'.
diff --git a/t/tests/source-copyright-dep5-syntax-error/desc b/t/tests/source-copyright-dep5-syntax-error/desc
new file mode 100644
--- /dev/null
+++ b/t/tests/source-copyright-dep5-syntax-error/desc
@@ -0,0 +1,6 @@
+Testname: source-copyright-dep5-syntax-error
+Sequence: 6000
+Version: 1.0
+Description: Test for DEP-5 syntax error
+Test-For:
+ syntax-error-in-dep5-copyright
diff --git a/t/tests/source-copyright-dep5-syntax-error/tags b/t/tests/source-copyright-dep5-syntax-error/tags
new file mode 100644
--- /dev/null
+++ b/t/tests/source-copyright-dep5-syntax-error/tags
@@ -0,0 +1,1 @@
+W: source-copyright-dep5-syntax-error source: syntax-error-in-dep5-copyright syntax error in section 2 after the tag license:  This package is distributed in the hope that it will be useful, but WITHOUT\n

Reply to: