[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Patch: fix acoutput2.test
From: |
Tom Tromey |
Subject: |
Patch: fix acoutput2.test |
Date: |
17 Jun 2001 19:24:40 -0600 |
I'm checking this in. It fixes acoutput2.test plus a number of other
bugs I found while reading require_file_internal.
2001-06-17 Tom Tromey <address@hidden>
* automake.in (require_file_internal): Check for already-required
file after searching for it, and only if it is not found. Don't
use `readlink' when checking for dangling symlink. Work if
--force-missing specified.
* tests/acoutput2.test: Also test --force-missing.
Tom
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1140
diff -u -r1.1140 automake.in
--- automake.in 2001/06/17 19:02:40 1.1140
+++ automake.in 2001/06/18 01:06:48
@@ -7354,10 +7354,6 @@
my $errfile;
my $save_dir;
- # If we've already looked for it, we're done.
- next if defined $require_file_found{$file};
- $require_file_found{$file} = 1;
-
my $found_it = 0;
my $dangling_sym = 0;
foreach my $dir (@require_file_paths)
@@ -7371,7 +7367,7 @@
# config_aux_path.
$errfile = $errdir . '/' . $file;
- if (-l $fullfile && ! -f readlink ($fullfile))
+ if (-l $fullfile && ! -f $fullfile)
{
$dangling_sym = 1;
last;
@@ -7385,13 +7381,26 @@
}
}
- if ($found_it && ! $force_missing)
+ # `--force-missing' only has an effect if `--add-missing' is
+ # specified.
+ if ($found_it && (! $add_missing || ! $force_missing))
{
# Prune the path list.
@require_file_paths = $save_dir;
}
else
{
+ # If we've already looked for it, we're done. You might
+ # wonder why we don't do this before searching for the
+ # file. If we do that, then something like
+ # AC_OUTPUT(subdir/foo foo) will fail to put foo.in into
+ # DIST_COMMON.
+ if (! $found_it)
+ {
+ next if defined $require_file_found{$file};
+ $require_file_found{$file} = 1;
+ }
+
if ($strictness >= $mystrict)
{
if ($dangling_sym && $add_missing)
@@ -7451,6 +7460,11 @@
# Prune the path list.
@require_file_paths = &dirname ($errfile);
}
+
+ # If --force-missing was specified, and we have
+ # actually found the file, then do nothing.
+ next
+ if $found_it && $force_missing;
if ($suppress)
{
Index: tests/acoutput2.test
===================================================================
RCS file: /cvs/automake/automake/tests/acoutput2.test,v
retrieving revision 1.1
diff -u -r1.1 acoutput2.test
--- acoutput2.test 2001/06/17 18:53:03 1.1
+++ acoutput2.test 2001/06/18 01:06:48
@@ -18,4 +18,8 @@
$AUTOMAKE || exit 1
-grep '^DIST_COMMON =.*foo\.in' Makefile.in
+count=`fgrep foo.in Makefile.in | wc -l`
+test $count -eq 2 || exit 1
+
+# This ought to work as well.
+$AUTOMAKE --add-missing --force-missing
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Patch: fix acoutput2.test,
Tom Tromey <=