[maven-debian-helper] 04/08: Added the MPL-1.1 and MPL-2.0 to the list of the recognized licenses
Emmanuel Bourg
ebourg-guest at moszumanska.debian.org
Tue Jun 27 13:06:43 UTC 2017
This is an automated email from the git hooks/post-receive script.
ebourg-guest pushed a commit to branch master
in repository maven-debian-helper.
commit 170a5bc27a77dd57c2329f9a96f0d73881de5834
Author: Emmanuel Bourg <ebourg at apache.org>
Date: Tue Jun 27 14:32:03 2017 +0200
Added the MPL-1.1 and MPL-2.0 to the list of the recognized licenses
---
debian/changelog | 1 +
.../java/org/debian/maven/packager/util/LicensesScanner.java | 11 +++++++++--
maven-packager-utils/src/main/resources/copyright.vm | 2 +-
.../org/debian/maven/packager/util/LicensesScannerTest.java | 8 ++++++++
4 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 1d2c5e1..0129651 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
maven-debian-helper (2.2.1) UNRELEASED; urgency=medium
* Team upload.
+ * Added the MPL-1.1 and MPL-2.0 to the list of the recognized licenses
* The generated copyright file now has a https format URL
* Standards-Version updated to 4.0.0
* The generated control file now specifies Standards-Version: 4.0.0
diff --git a/maven-packager-utils/src/main/java/org/debian/maven/packager/util/LicensesScanner.java b/maven-packager-utils/src/main/java/org/debian/maven/packager/util/LicensesScanner.java
index 9a40358..a282a73 100644
--- a/maven-packager-utils/src/main/java/org/debian/maven/packager/util/LicensesScanner.java
+++ b/maven-packager-utils/src/main/java/org/debian/maven/packager/util/LicensesScanner.java
@@ -73,7 +73,7 @@ public class LicensesScanner {
private String getAvailableLicenses() {
return "Apache-2.0 Artistic BSD FreeBSD ISC CC-BY CC-BY-SA CC-BY-ND CC-BY-NC CC-BY-NC-SA\n"
+ "CC-BY-NC-ND CC0 CDDL CPL Eiffel EPL-1.0 Expat GPL-2 GPL-3 LGPL-2 LGPL-2.1 LGPL-3"
- + "GFDL-1.2 GFDL-1.3 GFDL-NIV LPPL MPL Perl PSF QPL W3C-Software ZLIB Zope";
+ + "GFDL-1.2 GFDL-1.3 GFDL-NIV LPPL MPL-1.1 MPL-2.0 Perl PSF QPL W3C-Software ZLIB Zope";
}
boolean recognizeLicense(Set<String> licenses, String licenseName, String licenseUrl) {
@@ -124,7 +124,14 @@ public class LicensesScanner {
licenses.add("GPL-3");
recognized = true;
}
-
+ } else if (licenseName.contains("mpl") || licenseUrl.contains("mpl")) {
+ if (licenseName.contains("1.1") || licenseUrl.contains("1.1")) {
+ licenses.add("MPL-1.1");
+ recognized = true;
+ } else if (licenseName.contains("2.0") || licenseUrl.contains("2.0")) {
+ licenses.add("MPL-2.0");
+ recognized = true;
+ }
} else if (licenseUrl.contains("http://creativecommons.org/licenses/by-sa/3.0")) {
licenses.add("CC-BY-SA-3.0");
recognized = true;
diff --git a/maven-packager-utils/src/main/resources/copyright.vm b/maven-packager-utils/src/main/resources/copyright.vm
index 57e7b1b..f021134 100644
--- a/maven-packager-utils/src/main/resources/copyright.vm
+++ b/maven-packager-utils/src/main/resources/copyright.vm
@@ -18,7 +18,7 @@ License: ${packagerLicense}
#foreach ($license in $licenses)
License: $license
-#set ($knownLicenses = ["Apache-2.0", "GFDL-1.2", "GPL-2", "LGPL-2.1", "Artistic", "GPL-3", "LGPL-2", "LGPL-3"])
+#set ($knownLicenses = ["Apache-2.0", "GFDL-1.2", "GPL-2", "LGPL-2.1", "Artistic", "GPL-3", "LGPL-2", "LGPL-3", "MPL-1.1", "MPL-2.0"])
#if ($knownLicenses.contains($license))
On Debian systems, the full text of the $license license
can be found in the file '/usr/share/common-licenses/$license'
diff --git a/maven-packager-utils/src/test/java/org/debian/maven/packager/util/LicensesScannerTest.java b/maven-packager-utils/src/test/java/org/debian/maven/packager/util/LicensesScannerTest.java
index fbed3d0..96e055f 100644
--- a/maven-packager-utils/src/test/java/org/debian/maven/packager/util/LicensesScannerTest.java
+++ b/maven-packager-utils/src/test/java/org/debian/maven/packager/util/LicensesScannerTest.java
@@ -34,5 +34,13 @@ public class LicensesScannerTest extends TestCase {
assertTrue(scanner.recognizeLicense(licenses, "", "http://www.apache.org/licenses/LICENSE-2.0"));
assertEquals("Apache-2.0", licenses.iterator().next());
licenses.clear();
+
+ assertTrue(scanner.recognizeLicense(licenses, "MPL (v1.1)", ""));
+ assertEquals("MPL-1.1", licenses.iterator().next());
+ licenses.clear();
+
+ assertTrue(scanner.recognizeLicense(licenses, "", "https://www.mozilla.org/MPL/2.0/"));
+ assertEquals("MPL-2.0", licenses.iterator().next());
+ licenses.clear();
}
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/maven-debian-helper.git
More information about the pkg-java-commits
mailing list