mirror of
https://salsa.debian.org/srivasta/make-dfsg.git
synced 2024-12-29 00:05:59 +00:00
- Fix Savannah bug #13529
This commit is contained in:
parent
dceb954f9c
commit
be6b22a283
3 changed files with 38 additions and 0 deletions
13
remake.c
13
remake.c
|
@ -373,6 +373,7 @@ update_file_1 (struct file *file, unsigned int depth)
|
|||
FILE_TIMESTAMP this_mtime;
|
||||
int noexist, must_make, deps_changed;
|
||||
int dep_status = 0;
|
||||
struct file *ofile;
|
||||
struct dep *d, *ad;
|
||||
struct dep amake;
|
||||
int running = 0;
|
||||
|
@ -423,6 +424,10 @@ update_file_1 (struct file *file, unsigned int depth)
|
|||
/* Notice recursive update of the same file. */
|
||||
start_updating (file);
|
||||
|
||||
/* We might change file if we find a different one via vpath;
|
||||
remember this one to turn off updating. */
|
||||
ofile = file;
|
||||
|
||||
/* Looking at the file's modtime beforehand allows the possibility
|
||||
that its name may be changed by a VPATH search, and thus it may
|
||||
not need an implicit rule. If this were not done, the file
|
||||
|
@ -608,6 +613,7 @@ update_file_1 (struct file *file, unsigned int depth)
|
|||
}
|
||||
|
||||
finish_updating (file);
|
||||
finish_updating (ofile);
|
||||
|
||||
DBF (DB_VERBOSE, _("Finished prerequisites of target file `%s'.\n"));
|
||||
|
||||
|
@ -943,12 +949,17 @@ static int
|
|||
check_dep (struct file *file, unsigned int depth,
|
||||
FILE_TIMESTAMP this_mtime, int *must_make_ptr)
|
||||
{
|
||||
struct file *ofile;
|
||||
struct dep *d;
|
||||
int dep_status = 0;
|
||||
|
||||
++depth;
|
||||
start_updating (file);
|
||||
|
||||
/* We might change file if we find a different one via vpath;
|
||||
remember this one to turn off updating. */
|
||||
ofile = file;
|
||||
|
||||
if (file->phony || !file->intermediate)
|
||||
{
|
||||
/* If this is a non-intermediate file, update it and record whether it
|
||||
|
@ -1054,6 +1065,8 @@ check_dep (struct file *file, unsigned int depth,
|
|||
}
|
||||
|
||||
finish_updating (file);
|
||||
finish_updating (ofile);
|
||||
|
||||
return dep_status;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
2009-06-14 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/vpath: Verify we don't get bogus circular
|
||||
dependency warnings if we choose a different file via vpath during
|
||||
update. Savannah bug #13529.
|
||||
|
||||
2009-06-13 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/variables/MAKEFILES: Verify that MAKEFILES included
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# -*-perl-*-
|
||||
|
||||
$description = "The following test creates a makefile to test the \n"
|
||||
."vpath directive which allows you to specify a search \n"
|
||||
."path for a particular class of filenames, those that\n"
|
||||
|
@ -59,4 +61,21 @@ if (&compare_output($answer,&get_logfile(1)))
|
|||
unlink @files_to_touch;
|
||||
}
|
||||
|
||||
# TEST 2: after vpath lookup ensure we don't get incorrect circular dependency
|
||||
# warnings due to change of struct file ptr. Savannah bug #13529.
|
||||
|
||||
mkdir('vpath-d', 0777);
|
||||
|
||||
run_make_test(q!
|
||||
vpath %.te vpath-d/
|
||||
.SECONDARY:
|
||||
default: vpath-d/a vpath-d/b
|
||||
vpath-d/a: fail.te
|
||||
vpath-d/b : fail.te
|
||||
vpath-d/fail.te:
|
||||
!,
|
||||
'', "#MAKE#: Nothing to be done for `default'.\n");
|
||||
|
||||
rmdir('vpath-d');
|
||||
|
||||
1;
|
||||
|
|
Loading…
Reference in a new issue