diff --git a/lib/App/KSP_CKAN/Roles/Licenses.pm b/lib/App/KSP_CKAN/Roles/Licenses.pm index 4d302ba..7324d7f 100644 --- a/lib/App/KSP_CKAN/Roles/Licenses.pm +++ b/lib/App/KSP_CKAN/Roles/Licenses.pm @@ -102,6 +102,7 @@ method _build__license_urls { "W3C" => 'https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document', "Zlib" => 'http://www.zlib.net/zlib_license.html', "Zope" => 'http://old.zope.org/Resources/License.1', + "Unlicense" => 'https://unlicense.org/UNLICENSE', } } @@ -144,6 +145,7 @@ method redistributable_licenses { "Zlib", "Zope", "WTFPL", + "Unlicense", "open-source", "unrestricted" ]; } diff --git a/lib/App/KSP_CKAN/Tools/IA.pm b/lib/App/KSP_CKAN/Tools/IA.pm index eced2f0..caebdc8 100644 --- a/lib/App/KSP_CKAN/Tools/IA.pm +++ b/lib/App/KSP_CKAN/Tools/IA.pm @@ -265,7 +265,7 @@ method ckan_mirrored( :$ckan ) { $self->logdie("Metadata JSON failed to parse"); }; - if ( any { uc($_->{sha1}) eq $ckan->download_sha1 } @{$data->{files}} ) { + if ( any { defined $_->{sha1} && uc($_->{sha1}) eq $ckan->download_sha1 } @{$data->{files}} ) { return 1; } diff --git a/t/App/KSP_CKAN/Roles/Licenses.t b/t/App/KSP_CKAN/Roles/Licenses.t index 1096618..80ea3c1 100644 --- a/t/App/KSP_CKAN/Roles/Licenses.t +++ b/t/App/KSP_CKAN/Roles/Licenses.t @@ -40,6 +40,7 @@ subtest 'licenses' => sub { "Zlib", "Zope", "WTFPL", + "Unlicense", "open-source", "unrestricted" ]; my @test = $licenses->redistributable_licenses;