[licensecheck] 76/112: Add license pattern wtfpl.

Jonas Smedegaard dr at jones.dk
Fri Nov 25 22:02:07 UTC 2016


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository licensecheck.

commit d5428b70620b3c70ff70e14145e964282cf86eec
Author: Jonas Smedegaard <dr at jones.dk>
Date:   Wed Nov 23 17:51:42 2016 +0100

    Add license pattern wtfpl.
---
 lib/App/Licensecheck.pm       | 14 ++------------
 lib/Regexp/Pattern/License.pm |  8 ++++++++
 t/SPDX.t                      |  1 +
 t/SPDX/WTFPL.txt              | 11 +++++++++++
 t/grant.t                     |  7 +++++++
 t/grant/WTFPL/COPYING.WTFPL   | 12 ++++++++++++
 6 files changed, 41 insertions(+), 12 deletions(-)

diff --git a/lib/App/Licensecheck.pm b/lib/App/Licensecheck.pm
index 971a00e..f1204d2 100755
--- a/lib/App/Licensecheck.pm
+++ b/lib/App/Licensecheck.pm
@@ -974,18 +974,8 @@ sub parse_license
 
 	# WTFPL
 	given ($licensetext) {
-		when ( /Do What The Fuck You Want To Public License,? $L{re}{version}{-keep}/i ) {
-			$gen_license->( 'WTFPL', $1 );
-		}
-	}
-	given ($licensetext) {
-		when ( /Do what The Fuck You Want To Public License/i ) {
-			$gen_license->('WTFPL');
-		}
-	}
-	given ($licensetext) {
-		when ( /(License WTFPL|Under (the|a) WTFPL)/i ) {
-			$gen_license->('WTFPL');
+		when ( /$L{re}{wtfpl},? $L{re}{version}{-keep}/i ) {
+			$gen_license->( 'wtfpl', $1 );
 		}
 	}
 	#>>>
diff --git a/lib/Regexp/Pattern/License.pm b/lib/Regexp/Pattern/License.pm
index 68d391e..1e3a91a 100644
--- a/lib/Regexp/Pattern/License.pm
+++ b/lib/Regexp/Pattern/License.pm
@@ -146,6 +146,8 @@ Patterns each covering a single license.
 
 =item * unicode_tou
 
+=item * wtfpl
+
 =item * zlib
 
 =item * zlib_acknowledgement
@@ -552,6 +554,12 @@ END
 		pat =>
 			qr/distribute all documents and files solely for informational/,
 	},
+	wtfpl => {
+		name    => 'WTFPL',
+		caption => 'do What The Fuck you want to Public License',
+		pat =>
+			qr/$the?(?:[Dd]o What The Fuck [Yy]ou [Ww]ant [Tt]o Public License|DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE(?: \(WTFPL\))?|WTFPL)/,
+	},
 	zlib => {
 		name    => 'Zlib',
 		caption => 'zlib/libpng',
diff --git a/t/SPDX.t b/t/SPDX.t
index f3625a3..39bf954 100644
--- a/t/SPDX.t
+++ b/t/SPDX.t
@@ -23,6 +23,7 @@ my %Debian2SPDX = (
 	'LGPL-2+'      => 'LGPL-2.0',
 	'LGPL-2.1+'    => 'LGPL-2.1',
 	'Python-2'     => 'Python-2.0',
+	'WTFPL-2'      => 'WTFPL',
 );
 
 path("t/SPDX")->visit(
diff --git a/t/SPDX/WTFPL.txt b/t/SPDX/WTFPL.txt
new file mode 100644
index 0000000..7a3094a
--- /dev/null
+++ b/t/SPDX/WTFPL.txt
@@ -0,0 +1,11 @@
+DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+Version 2, December 2004
+
+Copyright (C) 2004 Sam Hocevar <sam at hocevar.net>
+
+Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.
+
+DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. You just DO WHAT THE FUCK YOU WANT TO.
diff --git a/t/grant.t b/t/grant.t
index 10e53a9..6c304d4 100644
--- a/t/grant.t
+++ b/t/grant.t
@@ -185,4 +185,11 @@ run_me(
 	}
 );
 
+# WTFPL
+run_me(
+	{   license => 'WTFPL-1.0',
+		corpus  => 'WTFPL/COPYING.WTFPL'
+	}
+);
+
 done_testing;
diff --git a/t/grant/WTFPL/COPYING.WTFPL b/t/grant/WTFPL/COPYING.WTFPL
new file mode 100644
index 0000000..c971e27
--- /dev/null
+++ b/t/grant/WTFPL/COPYING.WTFPL
@@ -0,0 +1,12 @@
+do What The Fuck you want to Public License
+
+Version 1.0, March 2000
+Copyright (C) 2000 Banlu Kemiyatorn (]d).
+136 Nives 7 Jangwattana 14 Laksi Bangkok
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+Ok, the purpose of this license is simple
+and you just
+
+DO WHAT THE FUCK YOU WANT TO.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/licensecheck.git



More information about the Pkg-perl-cvs-commits mailing list