From: Johannes Schindelin Date: Mon, 29 Jul 2019 20:08:04 +0000 (-0700) Subject: contrib/buildsystems: ignore irrelevant files in Generators/ X-Git-Tag: v2.23.0-rc1~2^2~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e88919bfe285965bf99e3302a90187ba6f117be6;p=thirdparty%2Fgit.git contrib/buildsystems: ignore irrelevant files in Generators/ 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 Signed-off-by: Junio C Hamano --- diff --git a/contrib/buildsystems/Generators.pm b/contrib/buildsystems/Generators.pm index 408ef714b8..aa4cbaa2ad 100644 --- a/contrib/buildsystems/Generators.pm +++ b/contrib/buildsystems/Generators.pm @@ -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);