Control: tags -1 + patch On Sat, May 30, 2015 at 01:53:59PM +0200, Evgeni Golov wrote:
> We should special-case public-domain here probably. patch incl tests attached :)
>From 548ff0f74e65df31eb5d683a0414395054955c84 Mon Sep 17 00:00:00 2001 From: Evgeni Golov <[email protected]> Date: Sat, 30 May 2015 14:04:09 +0200 Subject: [PATCH] skip dep5-copyright-license-name-not-unique for the public-domain "license" Closes: #787248 --- checks/source-copyright.pm | 4 ++-- t/tests/source-copyright-unique/debian/code | 1 + t/tests/source-copyright-unique/debian/code2 | 1 + t/tests/source-copyright-unique/debian/debian/copyright | 12 +++++++++++- t/tests/source-copyright-unique/tags | 6 +++--- 5 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 t/tests/source-copyright-unique/debian/code create mode 100644 t/tests/source-copyright-unique/debian/code2 diff --git a/checks/source-copyright.pm b/checks/source-copyright.pm index 525a0a9..804d2a2 100644 --- a/checks/source-copyright.pm +++ b/checks/source-copyright.pm @@ -298,7 +298,7 @@ sub _parse_dep5 { "(paragraph at line $current_line)"; }else { for (@short_licenses) { - if(defined($full_licenses_seen{$_})) { + if(defined($full_licenses_seen{$_}) and $_ ne 'public-domain') { tag 'dep5-copyright-license-name-not-unique', "(paragraph at line $current_line)"; } else { @@ -391,7 +391,7 @@ sub _parse_dep5 { if (not defined($full_license)) { $required_standalone_licenses{$_} = $i; } else { - if(defined($full_licenses_seen{$_})) { + if(defined($full_licenses_seen{$_}) and $_ ne 'public-domain') { tag 'dep5-copyright-license-name-not-unique', "(paragraph at line $current_line)"; } else { diff --git a/t/tests/source-copyright-unique/debian/code b/t/tests/source-copyright-unique/debian/code new file mode 100644 index 0000000..1e2b25a --- /dev/null +++ b/t/tests/source-copyright-unique/debian/code @@ -0,0 +1 @@ +simple 3rd party code diff --git a/t/tests/source-copyright-unique/debian/code2 b/t/tests/source-copyright-unique/debian/code2 new file mode 100644 index 0000000..31d7114 --- /dev/null +++ b/t/tests/source-copyright-unique/debian/code2 @@ -0,0 +1 @@ +another simple 3rd party code diff --git a/t/tests/source-copyright-unique/debian/debian/copyright b/t/tests/source-copyright-unique/debian/debian/copyright index fd12194..65979dd 100644 --- a/t/tests/source-copyright-unique/debian/debian/copyright +++ b/t/tests/source-copyright-unique/debian/debian/copyright @@ -10,6 +10,16 @@ Copyright: 2014, somebody1 License: some-license some license +Files: code +Copyright: none +License: public-domain + this work is PD because I say so + +Files: code2 +Copyright: none +License: public-domain + this work is also in the public domain + Files: debian/* Copyright: 2014, somebody1 License: other-license @@ -24,4 +34,4 @@ License: other-license other-license License: other-license - other-license 2 \ No newline at end of file + other-license 2 diff --git a/t/tests/source-copyright-unique/tags b/t/tests/source-copyright-unique/tags index 02105f1..4901a00 100644 --- a/t/tests/source-copyright-unique/tags +++ b/t/tests/source-copyright-unique/tags @@ -1,5 +1,5 @@ -W: source-copyright-unique source: dep5-copyright-license-name-not-unique (paragraph at line 18) -W: source-copyright-unique source: dep5-copyright-license-name-not-unique (paragraph at line 23) -W: source-copyright-unique source: dep5-copyright-license-name-not-unique (paragraph at line 26) +W: source-copyright-unique source: dep5-copyright-license-name-not-unique (paragraph at line 28) +W: source-copyright-unique source: dep5-copyright-license-name-not-unique (paragraph at line 33) +W: source-copyright-unique source: dep5-copyright-license-name-not-unique (paragraph at line 36) W: source-copyright-unique source: dep5-copyright-license-name-not-unique (paragraph at line 8) W: source-copyright-unique source: dep5-file-paragraph-reference-header-paragraph some-license (paragraph at line 8) -- 2.1.4

