Subject: | list recognized licenses if given an unknown one |
I'm attaching a wee patch that lists all the known licenses if the one
given in Build.PL is not recognized. The patch is also available in my
github repo: http://github.com/yanick/Module-Build
Subject: | license.diff |
diff --git a/lib/Module/Build/Base.pm b/lib/Module/Build/Base.pm
index 7e28e1e..57c4490 100644
--- a/lib/Module/Build/Base.pm
+++ b/lib/Module/Build/Base.pm
@@ -3662,7 +3662,10 @@ sub do_create_license {
or die "No license specified";
my $key = $self->valid_licenses->{$l}
- or die "'$l' isn't a license key we know about";
+ or die "'$l' isn't a recognized license\n",
+ "licenses we know about:\n",
+ map { "\t$_\n" } sort keys %{ $self->valid_licenses };
+
my $class = "Software::License::$key";
eval "use $class; 1"