summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2006-03-13 17:56:09 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2006-03-13 17:56:09 +0000
commit0271efaad752425006dd4697f43c4a23bcdad15d (patch)
tree55e5c3f86c3d954e905b93c293026bf559ac48f5
parent2678d36cc704803dbb1e401fb183559d80aca4de (diff)
downloadMPC-0271efaad752425006dd4697f43c4a23bcdad15d.tar.gz
ChangeLogTag: Mon Mar 13 17:53:45 UTC 2006 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r--ChangeLog9
-rw-r--r--modules/Driver.pm36
2 files changed, 34 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index e35d628e..c9b9990a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Mon Mar 13 17:53:45 UTC 2006 Chad Elliott <elliott_c@ociweb.com>
+
+ * modules/Driver.pm:
+
+ If global.features, default.features, global.mpb or default.rel
+ are not found in the path relative to the location of mwc.pl (or
+ mpc.pl), look for them in the config directory found underneath
+ MPC. This only matters when working in conjunction with ACE.
+
Fri Mar 10 18:59:34 UTC 2006 Chad Elliott <elliott_c@ociweb.com>
* modules/BMakeWorkspaceCreator.pm:
diff --git a/modules/Driver.pm b/modules/Driver.pm
index 7be78d4d..e6d57ee3 100644
--- a/modules/Driver.pm
+++ b/modules/Driver.pm
@@ -40,6 +40,7 @@ sub new {
my($self) = $class->SUPER::new();
$self->{'path'} = $path;
+ $self->{'basepath'} = ::getBasePath();
$self->{'name'} = $name;
$self->{'types'} = {};
$self->{'creators'} = \@creators;
@@ -190,26 +191,34 @@ sub run {
}
## Set the global feature file
+ my($cgf) = '/config/global.features';
my($global_feature_file) = (defined $options->{'gfeature_file'} &&
-r $options->{'gfeature_file'} ?
$options->{'gfeature_file'} :
- $self->{'path'} . '/config/global.features');
+ -r $self->{'path'} . $cgf ?
+ $self->{'path'} . $cgf :
+ $self->{'basepath'} . $cgf
+ );
## Set up default values
if (!defined $options->{'input'}->[0]) {
push(@{$options->{'input'}}, '');
}
if (!defined $options->{'feature_file'}) {
- my($feature_file) = $self->{'path'} . '/config/default.features';
- if (-r $feature_file) {
- $options->{'feature_file'} = $feature_file;
- }
+ my($cdf) = '/config/default.features';
+ $options->{'feature_file'} = (-r $self->{'path'} . $cdf ?
+ $self->{'path'} . $cdf :
+ -r $self->{'basepath'} . $cdf ?
+ $self->{'basepath'} . $cdf :
+ undef);
}
if (!defined $options->{'global'}) {
- my($global) = $self->{'path'} . '/config/global.mpb';
- if (-r $global) {
- $options->{'global'} = $global;
- }
+ my($cgm) = '/config/global.mpb';
+ $options->{'global'} = (-r $self->{'path'} . $cgm ?
+ $self->{'path'} . $cgm :
+ -r $self->{'basepath'} . $cgm ?
+ $self->{'basepath'} . $cgm :
+ undef);
}
## Save the original directory outside of the loop
## to avoid calling it multiple times.
@@ -222,8 +231,13 @@ sub run {
if ($options->{'reldefs'}) {
## Only try to read the file if it exists
- my($rel) = $self->{'path'} . '/config/default.rel';
- if (-r $rel) {
+ my($cdr) = '/config/default.rel';
+ my($rel) = (-r $self->{'path'} . $cdr ?
+ $self->{'path'} . $cdr :
+ -r $self->{'basepath'} . $cdr ?
+ $self->{'basepath'} . $cdr :
+ undef);
+ if (defined $rel) {
my($srel, $errorString) = $self->read_file($rel);
if (!$srel) {
$self->error("$errorString\nin $rel");