378{
379 NSAutoreleasePool *pool =
nil;
380 NSArray *stageKeys =
nil;
381 NSEnumerator *stageEnum =
nil;
382 NSString *stageKey =
nil;
384 NSString *name =
nil;
385 NSMutableDictionary *dependenciesByStage =
nil,
386 *dependentsByStage =
nil;
387 NSSet *dependencies =
nil,
390
391 pool = [[NSAutoreleasePool alloc] init];
392
393
394
395
396
397 dependenciesByStage = [NSMutableDictionary dictionary];
398 dependentsByStage = [NSMutableDictionary dictionary];
399
400 for (;;)
401 {
402
403
404
405
406 stage = [_waitingStages anyObject];
407 if (stage ==
nil)
break;
408 [_waitingStages removeObject:stage];
409
410 key = [NSValue valueWithNonretainedObject:stage];
411
413 if (dependencies !=
nil)
414 {
415 [dependenciesByStage setObject:dependencies
416 forKey:key];
417 }
418
420 if (dependents !=
nil)
421 {
422 [dependentsByStage setObject:dependents
423 forKey:key];
424 }
425 }
426 [_waitingStages release];
427 _waitingStages =
nil;
428 _openForRegistration = NO;
429
430
431 stageKeys = [_stagesByName allKeys];
432
433 for (stageEnum = [stageKeys objectEnumerator]; (stageKey = [stageEnum nextObject]); )
434 {
435 stage = [_stagesByName objectForKey:stageKey];
436 if (stage ==
nil)
continue;
437
438
440 if (![stageKey isEqualToString:name])
441 {
442 OOLog(
@"verifyOXP.buildDependencyGraph.badName",
@"***** Stage name appears to have changed from \"%@\
" to \"%@\" for verifier stage %@, removing.", stageKey, name, stage);
443 [_stagesByName removeObjectForKey:stageKey];
444 continue;
445 }
446
447
448 key = [NSValue valueWithNonretainedObject:stage];
449 dependencies = [dependenciesByStage objectForKey:key];
450
451 if (dependencies !=
nil && ![
self setUpDependencies:dependencies forStage:stage])
452 {
453 [_stagesByName removeObjectForKey:stageKey];
454 }
455 }
456
457
458
459
460
461 stageKeys = [_stagesByName allKeys];
462
463 for (stageEnum = [stageKeys objectEnumerator]; (stageKey = [stageEnum nextObject]); )
464 {
465 stage = [_stagesByName objectForKey:stageKey];
466 if (stage ==
nil)
continue;
467
468
469 key = [NSValue valueWithNonretainedObject:stage];
470 dependents = [dependentsByStage objectForKey:key];
471
472 if (dependents !=
nil)
473 {
474 [self setUpDependents:dependents forStage:stage];
475 }
476 }
477
478 _waitingStages = [[NSMutableSet alloc] initWithArray:[_stagesByName allValues]];
479 [_waitingStages makeObjectsPerformSelector:@selector(dependencyRegistrationComplete)];
480
481 if ([[NSUserDefaults standardUserDefaults] boolForKey:@"oxp-verifier-dump-debug-graphviz"])
482 {
483 [self dumpDebugGraphviz];
484 }
485
486 [pool release];
487}
#define OOLog(class, format,...)