From 6cf8c1bcc1e1cc6577fdebfa8b6ba3d2256365ad Mon Sep 17 00:00:00 2001 From: AndreyDobrovolskyOdessa Date: Mon, 22 Feb 2021 02:10:42 +0200 Subject: Calling compute_uprel() before redo_ifchange() record_deps() is called after redo_ifchange(). It needs uprel[] value corresponding to REDO_DIRPREFIX supplied by the parent process. But redo_ifchange() may modify REDO_DIRPREFIX in case it will envoke default*.do file located in one of updirs. In this case if compute_uprel() will be called from inside record_deps(), it will produce wrong uprel[] value. That's why compute_uprel() must be called before run_script() will be able to change REDO_DIRPREFIX for the child process. Closes: #11 [via git-merge-pr] --- redo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redo.c b/redo.c index 9b893ae..181e3c4 100644 --- a/redo.c +++ b/redo.c @@ -901,7 +901,6 @@ record_deps(int targetc, char *targetv[]) return; fchdir(dir_fd); - compute_uprel(); for (targeti = 0; targeti < targetc; targeti++) { fd = open(targetv[targeti], O_RDONLY); @@ -981,6 +980,7 @@ main(int argc, char *argv[]) redo_ifchange(argc, argv); procure(); } else if (strcmp(program, "redo-ifchange") == 0) { + compute_uprel(); redo_ifchange(argc, argv); record_deps(argc, argv); procure(); -- cgit 1.4.1