about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndreyDobrovolskyOdessa <andrey.dobrovolsky.odessa@gmail.com>2021-02-22 02:10:42 +0200
committerLeah Neukirchen <leah@vuxu.org>2021-02-27 14:51:36 +0100
commit6cf8c1bcc1e1cc6577fdebfa8b6ba3d2256365ad (patch)
treeef8c00b7d0c4b5c078c85e3305d5bcce76593df3
parent8577c006cdc97ea378560e2dd7a20ed840cac4f5 (diff)
downloadredo-c-6cf8c1bcc1e1cc6577fdebfa8b6ba3d2256365ad.tar.gz
redo-c-6cf8c1bcc1e1cc6577fdebfa8b6ba3d2256365ad.tar.xz
redo-c-6cf8c1bcc1e1cc6577fdebfa8b6ba3d2256365ad.zip
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]
-rw-r--r--redo.c2
1 files changed, 1 insertions, 1 deletions
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();