scancpan: README as default license file

add this heuristic when no specific license file is found

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Francois Perrad
2015-10-26 18:45:01 +01:00
committed by Peter Korsgaard
parent 0a2d217826
commit e2aff3d7f5
9 changed files with 11 additions and 0 deletions

View File

@@ -544,6 +544,9 @@ sub find_license_files {
next if m|/|;
push @license_files, $_ if m/(ARTISTIC|COPYING|COPYRIGHT|LICENSE)/i;
}
if (scalar @license_files == 0 && $manifest =~ m/(README)[\n\s]/i) {
@license_files = ($1);
}
return \@license_files;
}