summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2003-08-18 17:30:16 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2003-08-18 17:30:16 +0000
commit3176e3a57d5d0926810507388df21af707e708ed (patch)
tree22ea11fba592f6ba63431ba789e391a74f1ffafe
parent11e5708e667116c404a058973d7615ccf0077acd (diff)
downloadMPC-3176e3a57d5d0926810507388df21af707e708ed.tar.gz
ChangeLogTag: Mon Aug 18 12:28:09 2003 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r--modules/Creator.pm23
-rw-r--r--modules/Driver.pm10
-rw-r--r--modules/Options.pm13
-rw-r--r--modules/ProjectCreator.pm2
-rw-r--r--modules/WorkspaceCreator.pm3
5 files changed, 39 insertions, 12 deletions
diff --git a/modules/Creator.pm b/modules/Creator.pm
index 71e6bfec..1f8a2261 100644
--- a/modules/Creator.pm
+++ b/modules/Creator.pm
@@ -443,18 +443,32 @@ sub add_file_written {
sub extension_recursive_input_list {
my($self) = shift;
my($dir) = shift;
+ my($exc) = shift;
my($ext) = shift;
my($fh) = new FileHandle();
my(@files) = ();
if (opendir($fh, $dir)) {
foreach my $file (grep(!/^\.\.?$/, readdir($fh))) {
+ my($excluded) = 0;
my($full) = ($dir ne '.' ? "$dir/" : '') . $file;
- if (-d $full) {
- push(@files, $self->extension_recursive_input_list($full, $ext));
+ if (defined $exc && defined $$exc[0]) {
+ foreach my $ex (@$exc) {
+ if ($file eq $ex) {
+ $excluded = 1;
+ last;
+ }
+ }
}
- elsif ($full =~ /$ext$/) {
- push(@files, $full);
+ if (!$excluded) {
+ if (-d $full) {
+ push(@files, $self->extension_recursive_input_list($full,
+ $exc,
+ $ext));
+ }
+ elsif ($full =~ /$ext$/) {
+ push(@files, $full);
+ }
}
}
closedir($fh);
@@ -763,6 +777,7 @@ sub process_duplicate_modification {
sub generate_recursive_input_list {
#my($self) = shift;
#my($dir) = shift;
+ #my($exc) = shift;
return ();
}
diff --git a/modules/Driver.pm b/modules/Driver.pm
index 3d0b6c1e..108ce125 100644
--- a/modules/Driver.pm
+++ b/modules/Driver.pm
@@ -40,7 +40,7 @@ sub new {
$self->{'path'} = $path;
$self->{'name'} = $name;
- $self->{'version'} = "2.0";
+ $self->{'version'} = "2.1";
$self->{'types'} = {};
$self->{'creators'} = \@creators;
$self->{'default'} = $creators[0];
@@ -95,7 +95,7 @@ sub optionError {
}
my($spaces) = (' ' x (length($base) + 8));
print STDERR "$base v$self->{'version'}\n" .
- "Usage: $base [-global <file>] [-include <directory>] [-recurse]\n" .
+ "Usage: $base [-global <file>] [-include <directory>] [-recurse[=dir1,...]]\n" .
$spaces . "[-ti <dll | lib | dll_exe | lib_exe>:<file>]\n" .
$spaces . "[-template <file>] [-relative NAME=VAR] [-base <project>]\n" .
$spaces . "[-noreldefs] [-notoplevel] [-static] [-static_only]\n" .
@@ -137,7 +137,8 @@ sub optionError {
" addition to dynamic projects.\n" .
" -static_only Specifies that only static projects will be generated.\n" .
" -recurse Recurse from the current directory and generate from\n" .
-" all found input files.\n" .
+" all found input files. If directories are passed to\n" .
+" this option, then those directories are not recursed.\n" .
" -relative Any \$() variable in an mpc that is matched to NAME\n" .
" is replaced by VAR only if VAR can be made into a\n" .
" relative path based on the current working directory.\n" .
@@ -221,7 +222,8 @@ sub run {
## Generate the recursive input list
my($generator) = $name->new();
- my(@input) = $generator->generate_recursive_input_list('.');
+ my(@input) = $generator->generate_recursive_input_list(
+ '.', $options->{'recurse'});
$options->{'input'} = \@input;
## If no files were found above, then we issue a warning
diff --git a/modules/Options.pm b/modules/Options.pm
index de5d819e..7862efa8 100644
--- a/modules/Options.pm
+++ b/modules/Options.pm
@@ -62,11 +62,11 @@ sub options {
my($global) = undef;
my($template) = undef;
my($feature_f) = undef;
+ my($recurse) = undef;
my($dynamic) = ($defaults ? 1 : undef);
my($reldefs) = ($defaults ? 1 : undef);
my($toplevel) = ($defaults ? 1 : undef);
my($static) = ($defaults ? 0 : undef);
- my($recurse) = ($defaults ? 0 : undef);
my($makeco) = ($defaults ? 0 : undef);
## Process the command line arguments
@@ -143,8 +143,15 @@ sub options {
elsif ($arg eq '-notoplevel') {
$toplevel = 0;
}
- elsif ($arg eq '-recurse') {
- $recurse = 1;
+ elsif ($arg =~ /^\-recurse(=(.*))?/) {
+ my($exc) = $2;
+ if (!defined $exc) {
+ $recurse = [];
+ }
+ else {
+ my(@exc) = split(',', $exc);
+ $recurse = \@exc;
+ }
}
elsif ($arg eq '-template') {
$i++;
diff --git a/modules/ProjectCreator.pm b/modules/ProjectCreator.pm
index 8318c0f8..753209db 100644
--- a/modules/ProjectCreator.pm
+++ b/modules/ProjectCreator.pm
@@ -2339,7 +2339,9 @@ sub get_verbatim {
sub generate_recursive_input_list {
my($self) = shift;
my($dir) = shift;
+ my($exc) = shift;
return $self->extension_recursive_input_list($dir,
+ $exc,
$ProjectCreatorExtension);
}
diff --git a/modules/WorkspaceCreator.pm b/modules/WorkspaceCreator.pm
index 93228a55..b3f32a17 100644
--- a/modules/WorkspaceCreator.pm
+++ b/modules/WorkspaceCreator.pm
@@ -972,7 +972,8 @@ sub get_modified_workspace_name {
sub generate_recursive_input_list {
my($self) = shift;
my($dir) = shift;
- return $self->extension_recursive_input_list($dir, $wsext);
+ my($exc) = shift;
+ return $self->extension_recursive_input_list($dir, $exc, $wsext);
}