summaryrefslogtreecommitdiff
path: root/Porting/checkcase.pl
diff options
context:
space:
mode:
authorJames Mastros <james@mastros.biz>2004-05-06 16:45:53 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-05-06 14:43:08 +0000
commit772ab6503ff18dfd6856d3c039bc0c327944f3f1 (patch)
tree63fa891b9fb282053245917a84f695876ed8cbac /Porting/checkcase.pl
parent96090bfdf053854d56ae5c45fcf6eef606782969 (diff)
downloadperl-772ab6503ff18dfd6856d3c039bc0c327944f3f1.tar.gz
Add a small script to check whether a perl source tree
(with or without generated files) is friendly with case-insensitive filesystems. Adapted from : Subject: Re: STerm.pl vs Sterm.pl Message-ID: <20040506124556.2402.qmail@onion.perl.org> p4raw-id: //depot/perl@22793
Diffstat (limited to 'Porting/checkcase.pl')
-rw-r--r--Porting/checkcase.pl26
1 files changed, 26 insertions, 0 deletions
diff --git a/Porting/checkcase.pl b/Porting/checkcase.pl
new file mode 100644
index 0000000000..66dccd24c8
--- /dev/null
+++ b/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;