lol
1diff --git remake.c remake.c
2index c0bf709..b1ddd23 100644
3--- remake.c
4+++ remake.c
5@@ -612,6 +612,10 @@ update_file_1 (struct file *file, unsigned int depth)
6 d->file->dontcare = file->dontcare;
7 }
8
9+ /* We may have already considered this file, when we didn't know
10+ we'd need to update it. Force update_file() to consider it and
11+ not prune it. */
12+ d->file->considered = !considered;
13
14 dep_status |= update_file (d->file, depth);
15
16diff --git tests/scripts/features/parallelism tests/scripts/features/parallelism
17index d4250f0..76d24a7 100644
18--- tests/scripts/features/parallelism
19+++ tests/scripts/features/parallelism
20@@ -214,6 +214,23 @@ rm main.x");
21 rmfiles(qw(foo.y foo.y.in main.bar));
22 }
23
24+# Ensure intermediate/secondary files are not pruned incorrectly.
25+# See Savannah bug #30653
26+
27+utouch(-15, 'file2');
28+utouch(-10, 'file4');
29+utouch(-5, 'file1');
30+
31+run_make_test(q!
32+.INTERMEDIATE: file3
33+file4: file3 ; @mv -f $< $@
34+file3: file2 ; touch $@
35+file2: file1 ; @touch $@
36+!,
37+ '--no-print-directory -j2', "touch file3");
38+
39+#rmfiles('file1', 'file2', 'file3', 'file4');
40+
41 if ($all_tests) {
42 # Jobserver FD handling is messed up in some way.
43 # Savannah bug #28189
44--
451.7.12
46