diff options
author | unknown <df@pippilotta.erinye.com> | 2007-10-25 13:28:12 +0200 |
---|---|---|
committer | unknown <df@pippilotta.erinye.com> | 2007-10-25 13:28:12 +0200 |
commit | 80241b44a830e4c5fd506e75fbbbc09f27c3123f (patch) | |
tree | d8e836766c21ec3f78a1fba026166a13344adc5d /BitKeeper | |
parent | 77f287556bd72963630b8e0f625e230088522c4f (diff) | |
download | mariadb-git-80241b44a830e4c5fd506e75fbbbc09f27c3123f.tar.gz |
add new trigger to prevent certain naming clashes
BitKeeper/triggers/pre-commit.check-case.pl:
catch duplicate file names, ignoring capitalisation, mostly to avoid changesets where a deleted file foobar and a deleted file FooBar break a tree on case insensitive file systems
Diffstat (limited to 'BitKeeper')
-rwxr-xr-x | BitKeeper/triggers/pre-commit.check-case.pl | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/BitKeeper/triggers/pre-commit.check-case.pl b/BitKeeper/triggers/pre-commit.check-case.pl new file mode 100755 index 00000000000..4f68f8619e5 --- /dev/null +++ b/BitKeeper/triggers/pre-commit.check-case.pl @@ -0,0 +1,26 @@ +#!/usr/bin/perl +my $status = 0; + +my $pending = $ENV{'BK_PENDING'}; +exit 0 unless -f $pending; + +open FI, "<", $pending || exit 0; +while(<FI>) { + my ($file, $stuff) = split /\|/, $_, 2; + next unless -f $file; + $file =~ s/^(.*)\/([^\/]*)$/$2/; + my $path = $1; + opendir DIR, $path; + my @files = sort map { lc } readdir DIR; + closedir DIR; + my %count = (); + $count{$_}++ for @files; + @files = grep { $count{$_} > 1 } keys %count; + if(@files > 0) { + print "$path/$file: duplicate file names: " . (join " ", @files) . "\n"; + $status = 1; + } +} +close FI; + +exit $status; |