[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
case sensitive file checks
From: |
Peter O'Gorman |
Subject: |
case sensitive file checks |
Date: |
Sat, 04 Dec 2004 23:27:47 +0900 |
User-agent: |
Mozilla Thunderbird 0.9 (Macintosh/20041103) |
Hi,
Okay, my copyright assignment is complete.
Please consider this.
By the way, did you know it takes 12 hours to run make check in automake on
my machine!!
Thanks,
Peter
--
Peter O'Gorman - http://www.pogma.com
Index: ChangeLog
===================================================================
RCS file: /cvs/automake/automake/ChangeLog,v
retrieving revision 1.2698
diff -u -3 -p -u -r1.2698 ChangeLog
--- ChangeLog 24 Nov 2004 22:44:12 -0000 1.2698
+++ ChangeLog 4 Dec 2004 14:22:14 -0000
@@ -1,3 +1,10 @@
+2004-12-04 Peter O'Gorman <address@hidden>
+
+ * automake.in (dir_has_case_matching_file, require_file_internal,
+ handle_dist): New sub which does case sensitive matching for a file,
+ and changes to use it. All because test etc. on my Mac OS X HFS+ file
+ system show ChAnGeLoG and ChangeLog as being the same :(
+
2004-11-24 Alexandre Duret-Lutz <address@hidden>
* doc/automake.texi (Conditional Subdirectories): More comments
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1589
diff -u -3 -p -u -r1.1589 automake.in
--- automake.in 22 Nov 2004 00:03:29 -0000 1.1589
+++ automake.in 4 Dec 2004 14:22:17 -0000
@@ -3433,6 +3433,33 @@ sub for_dist_common
return $a cmp $b;
}
+# $BOOLEAN
+# &dir_has_case_matching_file ($A, $B)
+# -------------------------
+# Subroutine for &handle_dist on case insensitive filesystems.
+# Use readdir/opendir/closedir to check if file B exists in the
+# directory A
+sub dir_has_case_matching_file ($$)
+{
+ my $A = shift;
+ my $B = shift;
+ my $f;
+ my $found=0;
+ local(*DIR);
+ return 0
+ if (! -d $A);
+ return 0
+ if (! -f "$A/$B");
+ # We have a file that at least looks like $A/$B
+ opendir(DIR,$A) || return 0;
+ while ($f=readdir(DIR)) {
+ next if ($f ne $B);
+ $found=1;
+ last;
+ }
+ closedir(DIR);
+ return $found;
+}
# handle_dist
# -----------
@@ -3505,7 +3532,7 @@ sub handle_dist ()
}
foreach my $cfile (@common_files)
{
- if (-f ($relative_dir . "/" . $cfile)
+ if (dir_has_case_matching_file ($relative_dir, $cfile)
# The file might be absent, but if it can be built it's ok.
|| rule $cfile)
{
@@ -3514,7 +3541,7 @@ sub handle_dist ()
# Don't use `elsif' here because a file might meaningfully
# appear in both directories.
- if ($check_aux && -f "$config_aux_dir/$cfile")
+ if ($check_aux && dir_has_case_matching_file($config_aux_dir, $cfile))
{
&push_dist_common ("$config_aux_dir/$cfile")
}
@@ -6925,7 +6952,7 @@ sub require_file_internal ($$$@)
{
$dangling_sym = 1;
}
- elsif (-f $fullfile)
+ elsif (dir_has_case_matching_file ($dir,$file))
{
$found_it = 1;
maybe_push_required_file ($dir, $file, $fullfile);
- case sensitive file checks,
Peter O'Gorman <=