}
}
- @$subjobs = grep {
- if ($recursion_track{ $_->{job} }) {
- print STDERR "Not recursively creating another $_->{job} (".
- (
- join " -> ",
- map { $_->{Spec} }
- sort { $a->{Depth} <=> $b->{Depth} }
- values %recursion_track
- ). " -> $_->{orgflight}.$_->{job}\n";
- 0;
- } else {
- 1;
- }
- } @$subjobs;
+ foreach my $subjob (@$subjobs) {
+ next unless $recursion_track{ $subjob->{job} };
+ $subjob->{suppress} = 1;
+ print STDERR "Not recursively demanding another $subjob->{job} (".
+ (
+ join " -> ",
+ map { $_->{Spec} }
+ sort { $a->{Depth} <=> $b->{Depth} }
+ values %recursion_track
+ ). " -> $subjob->{orgflight}.$subjob->{job}\n";
+ }
# See if there's a build we can reuse
my $usejob;
- if ($cache_option and $cacheok and $recipe =~ m/^build/ and !@$subjobs) {
+ if ($cache_option and $cacheok and $recipe =~ m/^build/
+ and !grep { !$_->{suppress} } @$subjobs) {
my $reusejob= $builds_investigated{$popjob};
if (!defined $reusejob) {
print STDERR "Searching for $popjob (like $copyflight) to reuse...\n";
END
foreach my $subjob (@$subjobs) {
my $target;
- $target= preparejob($subjob->{job}, $subjob->{orgflight}, 1);
+ if ($subjob->{suppress}) {
+ $target = "$subjob->{orgflight}.$subjob->{job}";
+ print STDERR "Reusing $target for $subjob->{name}".
+ " in $popflight.$popjob\n";
+ } else {
+ $target= preparejob($subjob->{job}, $subjob->{orgflight}, 1);
+ }
$jobsetq->execute($target, $popflight, $popjob, $subjob->{name});
}
$jobsetq->finish();