utils/scancpan: improve license file detection
authorFrancois Perrad <fperrad@gmail.com>
Mon, 16 Sep 2019 19:04:34 +0000 (21:04 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Tue, 17 Sep 2019 20:51:01 +0000 (22:51 +0200)
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>
utils/scancpan

index 1fccc980af9b205a8045f7f0655ab40731e927b1..484ccaca95ab4af303d407dc9f573e8da803844c 100755 (executable)
@@ -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) {