[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Case insensitive file system, ChangeLog and CHANGELOG
From: |
Peter O'Gorman |
Subject: |
Case insensitive file system, ChangeLog and CHANGELOG |
Date: |
Tue, 26 Oct 2004 00:40:23 +0900 |
User-agent: |
Mozilla Thunderbird 0.7.3 (Macintosh/20040803) |
Hi,
I just tried a "make distcheck" in cvs smartmontools. If failed with "No
rule to make target CHANGELOG". A little investigation revealed that
smartmontools has a CHANGELOG, but no ChangeLog, and on my case-preserving
case-insensitive HFS+ filesystem, automake (well, perl really) did not see
any difference and copied CHANGELOG into the dist as ChangeLog, causing make
(which can tell that CHANGELOG does not exist) to complain.
I can "fix" the problem with the attached patch, but a) I suck at perl b) I
am not sure that it is worth fixing and c) there is probably a "better way".
Anyway, patch attached, do as you see fit.
Peter
--
Peter O'Gorman - http://www.pogma.com
? aclocal-1.9a
? aclocal.tmp
? automake-1.9a
? automake-case-sens.diff
? automake.diff
? automake.tmp
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1587
diff -u -3 -p -u -r1.1587 automake.in
--- automake.in 21 Oct 2004 21:37:39 -0000 1.1587
+++ automake.in 25 Oct 2004 15:39:10 -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);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Case insensitive file system, ChangeLog and CHANGELOG,
Peter O'Gorman <=