summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2003-09-15 18:23:37 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2003-09-15 18:23:37 +0000
commit78378d2b15825efd007a67a5f3fe1d17a4f2e8ba (patch)
tree6401d5b1503fb366a047fadd74cd973aa2e77855
parentee6ad76a9438af889c58f9636455b23f1d20bf19 (diff)
downloadMPC-78378d2b15825efd007a67a5f3fe1d17a4f2e8ba.tar.gz
ChangeLogTag: Mon Sep 15 13:22:40 2003 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r--modules/WorkspaceCreator.pm87
1 files changed, 47 insertions, 40 deletions
diff --git a/modules/WorkspaceCreator.pm b/modules/WorkspaceCreator.pm
index dc1af5c1..4a209caa 100644
--- a/modules/WorkspaceCreator.pm
+++ b/modules/WorkspaceCreator.pm
@@ -635,7 +635,6 @@ sub generate_hierarchy {
foreach my $prj (@projects) {
my($top, $rest) = $self->topname($prj);
-
if (!defined $current) {
$current = $top;
push(@saved, $rest);
@@ -949,21 +948,26 @@ sub generate_circular_tree {
my($prepend) = shift;
my($into) = shift;
my($current) = shift;
-
- if (!defined $$circular{$into}) {
- $$circular{$into} = {};
- }
- my($deps) = $self->get_validated_ordering($current);
-
- if ($deps ne '') {
- my($darr) = $self->create_array($deps);
- foreach my $dep (@$darr) {
- my($base) = basename($dep);
- my($full) = (defined $$prepend{$base} ?
- "$$prepend{$base}/" : '') . $base;
- if (!defined $$circular{$into}->{$full}) {
- $$circular{$into}->{$full} = 1;
- $self->generate_circular_tree($circular, $prepend, $current, $full);
+ my($aref) = $self->{'project_info'}->{$current};
+
+ if (defined $aref) {
+ my($name, $deps) = @$aref;
+
+ if (defined $deps && $deps ne '') {
+ my($darr) = $self->create_array($deps);
+
+ if (!defined $$circular{$into}) {
+ $$circular{$into} = {};
+ }
+
+ foreach my $dep (@$darr) {
+ my($base) = basename($dep);
+ my($full) = (defined $$prepend{$base} ?
+ "$$prepend{$base}/" : '') . $base;
+ if (!defined $$circular{$into}->{$full}) {
+ $$circular{$into}->{$full} = 1;
+ $self->generate_circular_tree($circular, $prepend, $into, $full);
+ }
}
}
}
@@ -1064,32 +1068,35 @@ sub number_target_deps {
## has been sorted in order to get the correct project numbers.
for(my $i = 0; $i <= $#list; ++$i) {
my($project) = $list[$i];
- my($deps) = $self->get_validated_ordering($project);
-
- if ($deps ne '') {
- my(%targetnumbers) = ();
- my($darr) = $self->create_array($deps);
-
- ## For each dependency, search in the sorted list
- ## up to the point of this project for the projects
- ## that this one depends on. When the project is
- ## found, we put the target number in a hash map (to avoid
- ## duplicates).
- foreach my $dep (@$darr) {
- my($base) = basename($dep);
- my($full) = (defined $prepend{$base} ?
- "$prepend{$base}/" : '') . $base;
- for(my $j = 0; $j < $i; ++$j) {
- if ($list[$j] eq $full) {
- $targetnumbers{$j} = 1;
+ if (defined $$pjs{$project}) {
+ my($name, $deps) = @{$$pjs{$project}};
+ if (defined $deps && $deps ne '') {
+ my(%targetnumbers) = ();
+ my($darr) = $self->create_array($deps);
+
+ ## For each dependency, search in the sorted list
+ ## up to the point of this project for the projects
+ ## that this one depends on. When the project is
+ ## found, we put the target number in a hash map (to avoid
+ ## duplicates).
+ foreach my $dep (@$darr) {
+ my($base) = basename($dep);
+ my($full) = (defined $prepend{$base} ?
+ "$prepend{$base}/" : '') . $base;
+ for(my $j = 0; $j < $i; ++$j) {
+ if ($list[$j] eq $full) {
+ $targetnumbers{$j} = 1;
+ }
}
}
- }
- ## Get the keys of the hash map and store the
- ## array in the hash keyed on the project file.
- my(@numbers) = sort { $a <=> $b } keys %targetnumbers;
- $$targets{$project} = \@numbers;
+ ## Get the keys of the hash map and store the
+ ## array in the hash keyed on the project file.
+ my(@numbers) = sort { $a <=> $b } keys %targetnumbers;
+ if (defined $numbers[0]) {
+ $$targets{$project} = \@numbers;
+ }
+ }
}
}
@@ -1302,7 +1309,7 @@ sub get_validated_ordering {
my($self) = shift;
my($project) = shift;
my($warn) = shift;
- my($pjs) = $self->get_project_info();
+ my($pjs) = $self->{'project_info'};
my($name) = undef;
my($deps) = '';