summaryrefslogtreecommitdiff
path: root/modules/WorkspaceCreator.pm
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2010-01-04 15:29:07 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2010-01-04 15:29:07 +0000
commit45c1b1500f69ebf04959e44cc3846115ab363cdc (patch)
tree27c3e9ec7c0cb128abe6e11d8b113b09c9b7e5ce /modules/WorkspaceCreator.pm
parent95c25eef9f5c102b318f946acebbf16e8fcbd944 (diff)
downloadMPC-45c1b1500f69ebf04959e44cc3846115ab363cdc.tar.gz
ChangeLogTag: Mon Jan 4 15:25:54 UTC 2010 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'modules/WorkspaceCreator.pm')
-rw-r--r--modules/WorkspaceCreator.pm21
1 files changed, 7 insertions, 14 deletions
diff --git a/modules/WorkspaceCreator.pm b/modules/WorkspaceCreator.pm
index d11c81ef..f4c497a0 100644
--- a/modules/WorkspaceCreator.pm
+++ b/modules/WorkspaceCreator.pm
@@ -130,10 +130,8 @@ sub set_verbose_ordering {
sub modify_assignment_value {
- my($self, $name, $value) = @_;
-
## Workspace assignments do not need modification.
- return $value;
+ return $_[2];
}
@@ -233,6 +231,11 @@ sub parse_line {
}
elsif ($values[0] eq '1') {
if (defined $validNames{$values[1]}) {
+ ## This code only runs when there is a non-scoped assignment. As
+ ## such, we can safely replace all environment variables here so
+ ## that they are not incorrectly handled in aggregated
+ ## workspaces.
+ $self->replace_env_vars(\$values[2]) if ($values[2] =~ /\$/);
$self->process_assignment_add($values[1], $values[2], $flags);
}
else {
@@ -1881,17 +1884,7 @@ sub process_cmdline {
## Look for environment variables
foreach my $arg (@$args) {
- while($arg =~ /\$(\w+)/) {
- my $name = $1;
- my $val = '';
- if ($name eq 'PWD') {
- $val = $self->getcwd();
- }
- elsif (defined $ENV{$name}) {
- $val = $ENV{$name};
- }
- $arg =~ s/\$\w+/$val/;
- }
+ $self->replace_env_vars(\$arg) if ($arg =~ /\$/);
}
my $options = $self->options('MWC', {}, 0, @$args);