diff mbox series

[06/24] contrib/buildsystems: ignore irrelevant files in Generators/

Message ID 60a45f26948989f928ca439a2860433c0f08f412.1563455939.git.gitgitgadget@gmail.com
State New, archived
Headers show
Series Reinstate support for Visual Studio | expand

Commit Message

Elijah Newren via GitGitGadget July 18, 2019, 1:19 p.m. UTC
From: Johannes Schindelin <johannes.schindelin@gmx.de>

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>
---
 contrib/buildsystems/Generators.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

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);