utils/scancpan: improve license file detection

MANIFEST may contains line like this:
"LICENSE                     LICENSE file (added by Distar)"
so, retains only the first word.

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Francois Perrad 2019-09-16 21:04:34 +02:00 committed by Thomas Petazzoni
parent 0471f650b1
commit f71f944fe6

View File

@ -566,6 +566,7 @@ sub find_license_files {
my @license_files;
foreach (split /\n/, $manifest) {
next if m|/|;
s|\s+.*$||;
push @license_files, $_ if m/(ARTISTIC|COPYING|COPYRIGHT|LICENSE)/i;
}
if (scalar @license_files == 0 && $manifest =~ m/(README)[\n\s]/i) {