summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2003-07-29 12:48:30 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2003-07-29 12:48:30 +0000
commita5fd5607df2c851c4dfc237514358419bb7d14c7 (patch)
treea8300fd98df1b977905f1e9c027230816e398648
parentbf60165615c9cc5271140508eaddc231431b4f48 (diff)
downloadMPC-a5fd5607df2c851c4dfc237514358419bb7d14c7.tar.gz
ChangeLogTag: Tue Jul 29 07:46:58 2003 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r--modules/Creator.pm15
-rw-r--r--modules/WorkspaceCreator.pm20
2 files changed, 27 insertions, 8 deletions
diff --git a/modules/Creator.pm b/modules/Creator.pm
index 6d9d8c60..71e6bfec 100644
--- a/modules/Creator.pm
+++ b/modules/Creator.pm
@@ -617,9 +617,20 @@ sub restore_state {
my($self) = shift;
my($state) = shift;
- ## Overwrite each state value
+ ## Make a deep copy of each state value. That way our array
+ ## references and hash references do not get accidentally modified.
foreach my $skey (@statekeys) {
- $self->{$skey} = $$state{$skey};
+ if (UNIVERSAL::isa($state->{$skey}, 'ARRAY')) {
+ my(@arr) = @{$state->{$skey}};
+ $self->{$skey} = \@arr;
+ }
+ elsif (UNIVERSAL::isa($state->{$skey}, 'HASH')) {
+ my(%hash) = %{$state->{$skey}};
+ $self->{$skey} = \%hash;
+ }
+ else {
+ $self->{$skey} = $state->{$skey};
+ }
}
}
diff --git a/modules/WorkspaceCreator.pm b/modules/WorkspaceCreator.pm
index 2d0dee8c..b2f7cf1f 100644
--- a/modules/WorkspaceCreator.pm
+++ b/modules/WorkspaceCreator.pm
@@ -617,6 +617,15 @@ sub generate_project_files {
if ($impl && -d $file) {
$dir = $file;
$file = '';
+
+ ## If the implicit assignment value was not a number, then
+ ## we will add this value to our base projects.
+ if ($impl !~ /^\d+$/) {
+ my($bps) = $generator->get_baseprojs();
+ push(@$bps, split(/\s+/, $impl));
+ $restore = 1;
+ $self->{'cacheok'} = 0;
+ }
}
## Generate the key for this project file
@@ -691,11 +700,10 @@ sub generate_project_files {
## Return things to the way they were
if (defined $self->{'scoped_assign'}->{$ofile}) {
$impl = $previmpl;
-
- if ($restore) {
- $self->{'cacheok'} = $prevcache;
- $generator->restore_state(\%gstate);
- }
+ }
+ if ($restore) {
+ $self->{'cacheok'} = $prevcache;
+ $generator->restore_state(\%gstate);
}
}
else {
@@ -845,7 +853,7 @@ sub process_cmdline {
## Determine if it's ok to use the cache
my(@cacheInvalidating) = ('global', 'include', 'baseprojs',
'template', 'ti', 'relative',
- 'addtemp', 'addproj');
+ 'addtemp', 'addproj', 'feature_file');
foreach my $key (@cacheInvalidating) {
if ($self->is_set($key, $options)) {
$self->{'cacheok'} = 0;