summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl/Porting/checkcase.pl
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/perl/Porting/checkcase.pl')
-rw-r--r--gnu/usr.bin/perl/Porting/checkcase.pl26
1 files changed, 26 insertions, 0 deletions
diff --git a/gnu/usr.bin/perl/Porting/checkcase.pl b/gnu/usr.bin/perl/Porting/checkcase.pl
new file mode 100644
index 00000000000..66dccd24c88
--- /dev/null
+++ b/gnu/usr.bin/perl/Porting/checkcase.pl
@@ -0,0 +1,26 @@
+#!/usr/bin/perl
+# Finds the files that have the same name, case insensitively,
+# in the current directory and its subdirectories
+
+use warnings;
+use strict;
+use File::Find;
+
+my %files;
+find(sub {
+ my $name = $File::Find::name;
+ # Assumes that the path separator is exactly one character.
+ $name =~ s/^\.\..//;
+ push @{$files{lc $name}}, $name;
+ }, '.');
+
+my $failed;
+
+foreach (values %files) {
+ if (@$_ > 1) {
+ print join(", ", @$_), "\n";
+ $failed++;
+ }
+}
+
+print "no similarly named files found\n" unless $failed;