summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2003-08-27 19:24:31 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2003-08-27 19:24:31 +0000
commita5080743f2d576d5f48def42b0ae3b5f05f26fc5 (patch)
tree9f26f43d9cbec39e3f5c4ccdc7eb02fc5911b31f
parent0aa3c9144f2d4203f6c5de387dc6fa2683a04126 (diff)
downloadATCD-a5080743f2d576d5f48def42b0ae3b5f05f26fc5.tar.gz
ChangeLogTag: Wed Aug 27 14:23:00 2003 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r--ChangeLog17
-rw-r--r--bin/MakeProjectCreator/USAGE19
-rw-r--r--bin/MakeProjectCreator/modules/Creator.pm23
-rw-r--r--bin/MakeProjectCreator/modules/Driver.pm12
-rw-r--r--bin/MakeProjectCreator/modules/Options.pm27
-rw-r--r--bin/MakeProjectCreator/modules/ProjectCreator.pm3
-rw-r--r--bin/MakeProjectCreator/modules/WorkspaceCreator.pm13
7 files changed, 67 insertions, 47 deletions
diff --git a/ChangeLog b/ChangeLog
index 1976325bb3d..9f5528616b9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,20 @@
+Wed Aug 27 14:23:00 2003 Chad Elliott <elliott_c@ociweb.com>
+
+ * bin/MakeProjectCreator/USAGE:
+ * bin/MakeProjectCreator/modules/Creator.pm:
+ * bin/MakeProjectCreator/modules/Driver.pm:
+ * bin/MakeProjectCreator/modules/Options.pm:
+ * bin/MakeProjectCreator/modules/ProjectCreator.pm:
+ * bin/MakeProjectCreator/modules/WorkspaceCreator.pm:
+
+ Reverted the -recurse change from Mon Aug 18 12:28:09 2003. Added
+ a -exclude option that allows users to exclude directories
+ independently from the -recurse option.
+
Wed Aug 27 13:25:20 2003 Venkita Subramonian <venkita@cs.wustl.edu>
- * Kokyu/Kokyu_defs.h: Added inline qualification to operator != to
- fix warnings in SunOS_SunCC53 build.
+ * Kokyu/Kokyu_defs.h: Added inline qualification to operator != to
+ fix warnings in SunOS_SunCC53 build.
Wed Aug 27 17:06:12 UTC 2003 Johnny Willemsen <jwillemsen@remedy.nl>
diff --git a/bin/MakeProjectCreator/USAGE b/bin/MakeProjectCreator/USAGE
index 1dcde3dce9c..5c0455ed37b 100644
--- a/bin/MakeProjectCreator/USAGE
+++ b/bin/MakeProjectCreator/USAGE
@@ -9,19 +9,22 @@ script was started. It looks for .mpc files and generates a project or
projects for each one found.
-Usage: mwc.pl [-global <file>] [-include <directory>] [-recurse[=dir1,...]]
+Usage: mwc.pl [-global <file>] [-include <directory>] [-recurse]
[-ti <dll | lib | dll_exe | lib_exe>:<file>] [-hierarchy]
[-template <file>] [-relative NAME=VAR] [-base <project>]
[-noreldefs] [-notoplevel] [-static] [-static_only]
[-value_template <NAME+=VAL | NAME=VAL | NAME-=VAL>]
[-value_project <NAME+=VAL | NAME=VAL | NAME-=VAL>]
[-feature_file <file name>] [-make_coexistence]
+ [-exclude <directories>]
[-type <automake | borland | em3 | ghs | gnuace | make |
nmake | va4 | vc6 | vc7 | vc71>]
[files]
-base Add <project> as a base project to each generated
project file.
+ -exclude Use this option to exclude directories when searching
+ for input files.
-feature_file Specifies the feature file to read before processing.
The default feature file is default.features under the
config directory.
@@ -39,8 +42,7 @@ Usage: mwc.pl [-global <file>] [-include <directory>] [-recurse[=dir1,...]]
addition to dynamic projects.
-static_only Specifies that only static projects will be generated.
-recurse Recurse from the current directory and generate from
- all found input files. If directories are passed to
- this option, then those directories are not recursed.
+ all found input files.
-relative Any $() variable in an mpc that is matched to NAME
is replaced by VAR only if VAR can be made into a
relative path based on the current working directory.
@@ -80,6 +82,9 @@ and must reside within the include search directories. NOTE: the 'lib' and
the 'lib_exe' template input files are only used if the project creator makes
a separate project file for dynamic libraries and static libraries.
+The -exclude option is used to exclude directories when searching for input
+files. NOTE: This option has no effect when used with mpc.pl.
+
The -hierarchy option is used to force the generation of a hierarchical
workspace at each directory level in between the toplevel directory and the
location of the mpc file that is being processed. NOTE: This option only
@@ -130,19 +135,22 @@ file) is not provided, the project creator will attempt to create a default
project in the directory from which the script was started.
-Usage: mpc.pl [-global <file>] [-include <directory>] [-recurse[=dir1,...]]
+Usage: mpc.pl [-global <file>] [-include <directory>] [-recurse]
[-ti <dll | lib | dll_exe | lib_exe>:<file>] [-hierarchy]
[-template <file>] [-relative NAME=VAR] [-base <project>]
[-noreldefs] [-notoplevel] [-static] [-static_only]
[-value_template <NAME+=VAL | NAME=VAL | NAME-=VAL>]
[-value_project <NAME+=VAL | NAME=VAL | NAME-=VAL>]
[-feature_file <file name>] [-make_coexistence]
+ [-exclude <directories>]
[-type <automake | borland | em3 | ghs | gnuace | make |
nmake | va4 | vc6 | vc7 | vc71>]
[files]
-base Add <project> as a base project to each generated
project file.
+ -exclude Use this option to exclude directories when searching
+ for input files.
-feature_file Specifies the feature file to read before processing.
The default feature file is default.features under the
config directory.
@@ -160,8 +168,7 @@ Usage: mpc.pl [-global <file>] [-include <directory>] [-recurse[=dir1,...]]
addition to dynamic projects.
-static_only Specifies that only static projects will be generated.
-recurse Recurse from the current directory and generate from
- all found input files. If directories are passed to
- this option, then those directories are not recursed.
+ all found input files.
-relative Any $() variable in an mpc that is matched to NAME
is replaced by VAR only if VAR can be made into a
relative path based on the current working directory.
diff --git a/bin/MakeProjectCreator/modules/Creator.pm b/bin/MakeProjectCreator/modules/Creator.pm
index b6d6cf5aec9..c97af376e61 100644
--- a/bin/MakeProjectCreator/modules/Creator.pm
+++ b/bin/MakeProjectCreator/modules/Creator.pm
@@ -445,32 +445,18 @@ 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 (defined $exc && defined $$exc[0]) {
- foreach my $ex (@$exc) {
- if ($file eq $ex) {
- $excluded = 1;
- last;
- }
- }
+ if (-d $full) {
+ push(@files, $self->extension_recursive_input_list($full, $ext));
}
- if (!$excluded) {
- if (-d $full) {
- push(@files, $self->extension_recursive_input_list($full,
- $exc,
- $ext));
- }
- elsif ($full =~ /$ext$/) {
- push(@files, $full);
- }
+ elsif ($full =~ /$ext$/) {
+ push(@files, $full);
}
}
closedir($fh);
@@ -785,7 +771,6 @@ sub process_duplicate_modification {
sub generate_recursive_input_list {
#my($self) = shift;
#my($dir) = shift;
- #my($exc) = shift;
return ();
}
diff --git a/bin/MakeProjectCreator/modules/Driver.pm b/bin/MakeProjectCreator/modules/Driver.pm
index f81cd5ac739..9aff481e1b6 100644
--- a/bin/MakeProjectCreator/modules/Driver.pm
+++ b/bin/MakeProjectCreator/modules/Driver.pm
@@ -95,13 +95,14 @@ sub optionError {
}
my($spaces) = (' ' x (length($base) + 8));
print STDERR "$base v$self->{'version'}\n" .
- "Usage: $base [-global <file>] [-include <directory>] [-recurse[=dir1,...]]\n" .
+ "Usage: $base [-global <file>] [-include <directory>] [-recurse]]\n" .
$spaces . "[-ti <dll | lib | dll_exe | lib_exe>:<file>] [-hierarchy]\n" .
$spaces . "[-template <file>] [-relative NAME=VAR] [-base <project>]\n" .
$spaces . "[-noreldefs] [-notoplevel] [-static] [-static_only]\n" .
$spaces . "[-value_template <NAME+=VAL | NAME=VAL | NAME-=VAL>]\n" .
$spaces . "[-value_project <NAME+=VAL | NAME=VAL | NAME-=VAL>]\n" .
$spaces . "[-feature_file <file name>] [-make_coexistence]\n" .
+ $spaces . "[-exclude <directories>]\n" .
$spaces . "[-type <";
my(@keys) = sort keys %{$self->{'types'}};
@@ -121,6 +122,8 @@ sub optionError {
print STDERR
" -base Add <project> as a base project to each generated\n" .
" project file.\n" .
+" -exclude Use this option to exclude directories when searching\n" .
+" for input files.\n" .
" -feature_file Specifies the feature file to read before processing.\n" .
" The default feature file is default.features under the\n" .
" config directory.\n" .
@@ -138,8 +141,7 @@ 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. If directories are passed to\n" .
-" this option, then those directories are not recursed.\n" .
+" all found input files.\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" .
@@ -223,8 +225,7 @@ sub run {
## Generate the recursive input list
my($generator) = $name->new();
- my(@input) = $generator->generate_recursive_input_list(
- '.', $options->{'recurse'});
+ my(@input) = $generator->generate_recursive_input_list('.');
$options->{'input'} = \@input;
## If no files were found above, then we issue a warning
@@ -332,6 +333,7 @@ sub run {
$global_feature_file,
$options->{'feature_file'},
$options->{'hierarchy'},
+ $options->{'exclude'},
$options->{'coexistence'});
if ($base ne $file) {
my($dir) = ($base eq '' ? $file : dirname($file));
diff --git a/bin/MakeProjectCreator/modules/Options.pm b/bin/MakeProjectCreator/modules/Options.pm
index 008ec6d7b22..a9e31b31178 100644
--- a/bin/MakeProjectCreator/modules/Options.pm
+++ b/bin/MakeProjectCreator/modules/Options.pm
@@ -30,7 +30,7 @@ sub completion_command {
"'c/-/(global include type template relative " .
"ti static noreldefs notoplevel feature_file " .
"value_template value_project make_coexistence " .
- "hierarchy)/' " .
+ "hierarchy exclude)/' " .
"'c/dll:/f/' 'c/dll_exe:/f/' 'c/lib_exe:/f/' 'c/lib:/f/' " .
"'n/-ti/(dll lib dll_exe lib_exe)/:' 'n/-type/(";
@@ -60,15 +60,16 @@ sub options {
my(%relative) = ();
my(%addtemp) = ();
my(%addproj) = ();
+ my(@exclude) = ();
my($global) = undef;
my($template) = undef;
my($feature_f) = undef;
- my($recurse) = undef;
my($hierarchy) = 0;
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
@@ -112,6 +113,16 @@ sub options {
}
}
}
+ elsif ($arg eq '-exclude') {
+ $i++;
+ if (defined $args[$i]) {
+ @exclude = split(',', $args[$i]);
+ }
+ else {
+ $self->optionError('-exclude requires a ' .
+ 'comma separated list argument');
+ }
+ }
elsif ($arg eq '-feature_file') {
$i++;
$feature_f = $args[$i];
@@ -148,15 +159,8 @@ sub options {
elsif ($arg eq '-notoplevel') {
$toplevel = 0;
}
- elsif ($arg =~ /^\-recurse(=(.*))?/) {
- my($exc) = $2;
- if (!defined $exc) {
- $recurse = [];
- }
- else {
- my(@exc) = split(',', $exc);
- $recurse = \@exc;
- }
+ elsif ($arg eq '-recurse') {
+ $recurse = 1;
}
elsif ($arg eq '-template') {
$i++;
@@ -292,6 +296,7 @@ sub options {
'addproj' => \%addproj,
'coexistence' => $makeco,
'hierarchy' => $hierarchy,
+ 'exclude' => \@exclude,
);
return \%options;
diff --git a/bin/MakeProjectCreator/modules/ProjectCreator.pm b/bin/MakeProjectCreator/modules/ProjectCreator.pm
index d1f55e15fc5..b503c659f20 100644
--- a/bin/MakeProjectCreator/modules/ProjectCreator.pm
+++ b/bin/MakeProjectCreator/modules/ProjectCreator.pm
@@ -146,6 +146,7 @@ sub new {
my($gfeature) = shift;
my($feature) = shift;
my($hierarchy) = shift;
+ my($exclude) = shift;
my($makeco) = shift;
my($self) = Creator::new($class, $global, $inc,
$template, $ti, $dynamic, $static,
@@ -2340,9 +2341,7 @@ 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/bin/MakeProjectCreator/modules/WorkspaceCreator.pm b/bin/MakeProjectCreator/modules/WorkspaceCreator.pm
index cdb8f5ff50b..96bcef0030f 100644
--- a/bin/MakeProjectCreator/modules/WorkspaceCreator.pm
+++ b/bin/MakeProjectCreator/modules/WorkspaceCreator.pm
@@ -62,6 +62,7 @@ sub new {
my($gfeature) = shift;
my($feature) = shift;
my($hierarchy) = shift;
+ my($exclude) = shift;
my($makeco) = shift;
my($self) = Creator::new($class, $global, $inc,
$template, $ti, $dynamic, $static,
@@ -84,6 +85,14 @@ sub new {
$self->{'global_feature_file'} = $gfeature;
$self->{'coexistence'} = $makeco;
+ if (defined $$exclude[0]) {
+ my($type) = $self->{'wctype'};
+ if (!defined $self->{'exclude'}->{$type}) {
+ $self->{'exclude'}->{$type} = [];
+ }
+ push(@{$self->{'exclude'}->{$type}}, @$exclude);
+ }
+
## Add a hash reference for our workspace type
if (!defined $previous_workspace_name{$self->{'wctype'}}) {
$previous_workspace_name{$self->{'wctype'}} = {};
@@ -1029,6 +1038,7 @@ sub project_creator {
$self->{'global_feature_file'},
$parameters{'feature_file'},
$parameters{'hierarchy'},
+ $self->{'exclude'}->{$self->{'wctype'}},
$self->make_coexistence());
}
@@ -1086,8 +1096,7 @@ sub get_modified_workspace_name {
sub generate_recursive_input_list {
my($self) = shift;
my($dir) = shift;
- my($exc) = shift;
- return $self->extension_recursive_input_list($dir, $exc, $wsext);
+ return $self->extension_recursive_input_list($dir, $wsext);
}