contrib/buildsystems: ignore irrelevant files in Generators/
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Mon, 29 Jul 2019 20:08:04 +0000 (13:08 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 29 Jul 2019 21:51:42 +0000 (14:51 -0700)
The Generators/ directory can contain spurious files such as editors'
backup files. Even worse, there could be .swp files which are not even
valid Perl scripts.

Let's just ignore anything but .pm files in said directory.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/buildsystems/Generators.pm
index 408ef714b8f0dcd0328dcef0055cc92f7737babb..aa4cbaa2adacb12616a3150b5735ad4634c93124 100644 (file)
@@ -17,7 +17,7 @@ BEGIN
     $me = dirname($me);
     if (opendir(D,"$me/Generators")) {
         foreach my $gen (readdir(D)) {
-            next if ($gen  =~ /^\.\.?$/);
+            next unless ($gen  =~ /\.pm$/);
             require "${me}/Generators/$gen";
             $gen =~ s,\.pm,,;
             push(@AVAILABLE, $gen);