fix for case-insensitive filesystems
authorTony Finch <dot@dotat.at>
Tue, 18 Nov 2014 20:08:49 +0000 (20:08 +0000)
committerTony Finch <dot@dotat.at>
Tue, 18 Nov 2014 20:08:49 +0000 (20:08 +0000)
ipreg-pre-uplift
sccscheck

index 1353125..f74cc56 100755 (executable)
@@ -179,3 +179,11 @@ do
        mkdir -p ipreg-tarballs/$subdir
        mv $pathname ipreg-tarballs/$subdir
 done
+: $B case-insensitivity fixup $D
+DNS1996=ip-register/archive/dump/DNS.19960326
+mvp $DNS1996/db.cam $DNS1996/db.cam.lc
+(
+    cd $DNS1996
+    rm -f DB.cam
+    tar xf ../../../../ipreg-tarballs/$DNS1996.tar.gz DB.cam
+)
index 59ab79d..c07d625 100755 (executable)
--- a/sccscheck
+++ b/sccscheck
@@ -24,6 +24,12 @@ working files which do not match the latest SCCS revision
 USAGE
 }
 
+# case-sensitive -f
+sub _f {
+       my $f = shift;
+       return -f $f && 1 == grep { $_ eq $f } glob "$f*";
+}
+
 find { wanted => \&found, no_chdir => 1}, @ARGV;
 
 sub found {
@@ -35,7 +41,7 @@ sub found {
                        when (m{\.gz$}) {
                                print "SCCS GZIP $_\n";
                        }
-                       when (! -f "$1/$2") {
+                       when (! _f "$1/$2") {
                                print "SCCS UNGET $_\n";
                        }
                }
@@ -44,7 +50,7 @@ sub found {
                }
                when (m{^(.*)/([^/]+)(\.orig|~)$}s) {
                        my $sccs = "$1/SCCS/s.$2";
-                       when (-f $sccs) {
+                       when (_f $sccs) {
                                # was the backup checked in?
                                my $mtime = strftime "%Y-%m-%d.%H:%M:%S%z",
                                    localtime((stat)[9]);
@@ -62,7 +68,7 @@ sub found {
                                print "BACKSCCS NOMATCH $mtime $_\n";
                                continue;
                        }
-                       when (-f "$1/$2") {
+                       when (_f "$1/$2") {
                                my $qback = quotemeta $_;
                                my $qfile = quotemeta "$1/$2";
                                system "diff -u $qback $qfile >/dev/null";
@@ -86,7 +92,7 @@ sub found {
                default {
                        m{^(.*)/([^/]+)$}s;
                        my $sccs = "$1/SCCS/s.$2";
-                       when (! -f $sccs) {
+                       when (! _f $sccs) {
                                print "NO SCCS $_\n";
                        }
                        my $qsccs = quotemeta $sccs;