diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2003-04-22 14:19:16 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2003-04-22 14:19:16 +0000 |
commit | bc9ad1b67f4b21d8a3dce3075e3b494a35408c64 (patch) | |
tree | ab48847b10b1148a5aad0c97faa33ba667471c8f | |
parent | 2c93ee119a4712affbcf166f064c7a3dae1567c9 (diff) | |
download | ATCD-bc9ad1b67f4b21d8a3dce3075e3b494a35408c64.tar.gz |
ChangeLogTag: Tue Apr 22 09:16:29 2003 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r-- | ChangeLog | 35 | ||||
-rw-r--r-- | bin/MakeProjectCreator/modules/Creator.pm | 2 | ||||
-rw-r--r-- | bin/MakeProjectCreator/modules/ProjectCreator.pm | 14 | ||||
-rw-r--r-- | bin/MakeProjectCreator/modules/WorkspaceCreator.pm | 296 |
4 files changed, 228 insertions, 119 deletions
diff --git a/ChangeLog b/ChangeLog index e2132436186..5ca7f163bb1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +Tue Apr 22 09:16:29 2003 Chad Elliott <elliott_c@ociweb.com> + + * bin/MakeProjectCreator/modules/Creator.pm: + * bin/MakeProjectCreator/modules/ProjectCreator.pm: + * bin/MakeProjectCreator/modules/WorkspaceCreator.pm: + + Changed the behavior when project names contain slashes or back + slashes. This is now an error due to the fact that GHS build + files are put in subdirectories. + + Also, the ability to exclude files and directories based on + project type was added to the WorkspaceCreator. + Tue Apr 22 07:10:14 2003 Chad Elliott <elliott_c@ociweb.com> * bin/ChangeLogEditor/ChangeLogEdit.pm: @@ -10,8 +23,8 @@ Tue Apr 22 07:10:14 2003 Chad Elliott <elliott_c@ociweb.com> Tue Apr 22 12:43:17 2003 Simon McQueen <sm@prismtechnologies.com> - * tests/Proactor_Scatter_Gather_Test.cpp: - Fixed build error on win32. + * tests/Proactor_Scatter_Gather_Test.cpp: + Fixed build error on win32. Tue Apr 22 07:30:01 UTC 2003 Johnny Willemsen <jwillemsen@remedy.nl> @@ -39,24 +52,24 @@ Tue Apr 22 06:14:12 UTC 2003 Johnny Willemsen <jwillemsen@remedy.nl> Mon Apr 21 15:45:25 2003 Ossama Othman <ossama@dre.vanderbilt.edu> - * ace/SOCK_SEQPACK_Acceptor.h: + * ace/SOCK_SEQPACK_Acceptor.h: - No need to include "ace/Time_Value.h". Forward declare - ACE_Time_Value instead. + No need to include "ace/Time_Value.h". Forward declare + ACE_Time_Value instead. Mon Apr 21 15:27:21 2003 Ossama Othman <ossama@dre.vanderbilt.edu> - * ace/Makefile.am (libACE_Sockets_la_SOURCES, HEADER_FILES): - (INLINE_FILES): + * ace/Makefile.am (libACE_Sockets_la_SOURCES, HEADER_FILES): + (INLINE_FILES): - Added new SCTP related files to these variables. + Added new SCTP related files to these variables. Mon Apr 21 15:23:44 2003 Ossama Othman <ossama@dre.vanderbilt.edu> - * ace/SSL/Makefile.in: + * ace/SSL/Makefile.in: - Removed this generated file. It shouldn't exist in the CVS - repository. + Removed this generated file. It shouldn't exist in the CVS + repository. Mon Apr 21 21:20:00 UTC 2003 Gautam Thaker <gthaker@atl.lmco.com> diff --git a/bin/MakeProjectCreator/modules/Creator.pm b/bin/MakeProjectCreator/modules/Creator.pm index c1400ddaceb..7da4762a3a1 100644 --- a/bin/MakeProjectCreator/modules/Creator.pm +++ b/bin/MakeProjectCreator/modules/Creator.pm @@ -388,7 +388,7 @@ sub transform_file_name { my($self) = shift; my($name) = shift; - $name =~ s/[\s\/\\]/_/g; + $name =~ s/\s/_/g; return $name; } diff --git a/bin/MakeProjectCreator/modules/ProjectCreator.pm b/bin/MakeProjectCreator/modules/ProjectCreator.pm index b7bee0b9d90..7dddf6ae5d2 100644 --- a/bin/MakeProjectCreator/modules/ProjectCreator.pm +++ b/bin/MakeProjectCreator/modules/ProjectCreator.pm @@ -287,7 +287,14 @@ sub parse_line { if (defined $name) { $name =~ s/^\(\s*//; $name =~ s/\s*\)$//; - $self->process_assignment('project_name', $name); + if ($name =~ /[\/\\]/) { + $status = 0; + $errorString = 'ERROR: Projects can not have a slash ' . + 'or a back slash in the name'; + } + else { + $self->process_assignment('project_name', $name); + } } $self->{$typecheck} = 1; @@ -1259,6 +1266,11 @@ sub generate_defaults { $self->process_assignment('project_name', $self->base_directory()); } else { + ## Since files on UNIX can have back slashes, we transform them + ## into underscores. + $current =~ s/\\/_/g; + + ## Take off the extension $current =~ s/\.[^\.]+$//; $self->process_assignment('project_name', $current); } diff --git a/bin/MakeProjectCreator/modules/WorkspaceCreator.pm b/bin/MakeProjectCreator/modules/WorkspaceCreator.pm index 2901fdac8b9..6898dd04341 100644 --- a/bin/MakeProjectCreator/modules/WorkspaceCreator.pm +++ b/bin/MakeProjectCreator/modules/WorkspaceCreator.pm @@ -70,6 +70,8 @@ sub new { $self->{'project_files'} = []; $self->{'scoped_assign'} = {}; $self->{'cacheok'} = 1; + $self->{'exclude'} = {}; + $self->{'wctype'} = $self->extractType("$self"); return $self; } @@ -156,7 +158,14 @@ sub parse_line { if (defined $name) { $name =~ s/^\(\s*//; $name =~ s/\s*\)$//; - $self->{'workspace_name'} = $name; + if ($name =~ /[\/\\]/) { + $status = 0; + $errorString = 'ERROR: Workspaces can not have a slash ' . + 'or a back slash in the name'; + } + else { + $self->{'workspace_name'} = $name; + } } $self->{$typecheck} = 1; } @@ -189,10 +198,16 @@ sub parse_line { } } elsif ($values[0] eq 'component') { - ($status, $errorString) = $self->parse_scope($ih, - $values[1], - $values[2], - \%validNames); + if ($values[1] eq 'exclude') { + ($status, $errorString) = $self->parse_exclude($ih, + $values[2]); + } + else { + ($status, $errorString) = $self->parse_scope($ih, + $values[1], + $values[2], + \%validNames); + } } else { $errorString = "ERROR: Unrecognized line: $line"; @@ -208,6 +223,62 @@ sub parse_line { } +sub parse_exclude { + my($self) = shift; + my($fh) = shift; + my($typestr) = shift; + my($status) = 0; + my($errorString) = 'ERROR: Unable to process exclude'; + + if ($typestr eq 'default') { + $errorString = 'ERROR: You must specify a project type ' . + 'for exclusions'; + } + else { + my(@types) = split(/\s+/, $typestr); + my(@exclude) = (); + + while(<$fh>) { + my($line) = $self->strip_line($_); + + if ($line eq '') { + } + elsif ($line =~ /^}/) { + $status = 1; + $errorString = ''; + last; + } + else { + push(@exclude, $line); + } + } + + foreach my $type (@types) { + if (!defined $self->{'exclude'}->{$type}) { + $self->{'exclude'}->{$type} = []; + } + push(@{$self->{'exclude'}->{$type}}, @exclude); + } + } + + return $status, $errorString; +} + + +sub excluded { + my($self) = shift; + my($file) = shift; + + foreach my $excluded (@{$self->{'exclude'}->{$self->{'wctype'}}}) { + if ($excluded eq $file || $file =~ /$excluded\//) { + return 1; + } + } + + return 0; +} + + sub handle_scoped_unknown { my($self) = shift; my($fh) = shift; @@ -295,14 +366,16 @@ sub generate_default_components { ## If we have files, then process directories my(@built) = (); foreach my $file (@$pjf) { - if (-d $file) { - my(@found) = (); - my(@gen) = $self->generate_default_file_list($file); - $self->search_for_files(\@gen, \@exts, \@found); - push(@built, @found); - } - else { - push(@built, $file); + if (!$self->excluded($file)) { + if (-d $file) { + my(@found) = (); + my(@gen) = $self->generate_default_file_list($file); + $self->search_for_files(\@gen, \@exts, \@found); + push(@built, @found); + } + else { + push(@built, $file); + } } } @@ -346,6 +419,11 @@ sub generate_defaults { $self->{'workspace_name'} = $self->base_directory(); } else { + ## Since files on UNIX can have back slashes, we transform them + ## into underscores. + $current =~ s/\\/_/g; + + ## Take off the extension $current =~ s/\.[^\.]+$//; $self->{'workspace_name'} = $current; } @@ -429,7 +507,7 @@ sub save_project_info { sub generate_project_files { my($self) = shift; - my($status) = 0; + my($status) = (scalar @{$self->{'project_files'}} == 0 ? 1 : 0); my(@projects) = (); my(%pi) = (); my($generator) = $self->project_creator(); @@ -445,113 +523,119 @@ sub generate_project_files { $postkey =~ s/=.*//; foreach my $ofile (@{$self->{'project_files'}}) { - my($file) = $ofile; - my($dir) = dirname($file); - my($restore) = 0; + if (!$self->excluded($ofile)) { + my($file) = $ofile; + my($dir) = dirname($file); + my($restore) = 0; + + if (defined $self->{'scoped_assign'}->{$ofile}) { + ## Handle the implicit assignment + my($oi) = $self->{'scoped_assign'}->{$ofile}->{'implicit'}; + if (defined $oi) { + $previmpl = $impl; + $impl = $oi; + } - if (defined $self->{'scoped_assign'}->{$ofile}) { - ## Handle the implicit assignment - my($oi) = $self->{'scoped_assign'}->{$ofile}->{'implicit'}; - if (defined $oi) { - $previmpl = $impl; - $impl = $oi; - } + ## Handle the cmdline assignment + my($cmdline) = $self->{'scoped_assign'}->{$ofile}->{'cmdline'}; + if (defined $cmdline && $cmdline ne '') { + ## Save the cacheok value + $prevcache = $self->{'cacheok'}; - ## Handle the cmdline assignment - my($cmdline) = $self->{'scoped_assign'}->{$ofile}->{'cmdline'}; - if (defined $cmdline && $cmdline ne '') { - ## Save the cacheok value - $prevcache = $self->{'cacheok'}; + ## Get the current parameters and process the command line + my(%parameters) = $self->current_parameters(); + $self->process_cmdline($cmdline, \%parameters); - ## Get the current parameters and process the command line - my(%parameters) = $self->current_parameters(); - $self->process_cmdline($cmdline, \%parameters); + ## Set the parameters on the generator + $generator->restore_state(\%parameters); + $restore = 1; + } + } - ## Set the parameters on the generator - $generator->restore_state(\%parameters); - $restore = 1; + ## If we are generating implicit projects and the file is a + ## directory, then we set the dir to the file and empty the file + if ($impl && -d $file) { + $dir = $file; + $file = ''; } - } - ## If we are generating implicit projects and the file is a - ## directory, then we set the dir to the file and empty the file - if ($impl && -d $file) { - $dir = $file; - $file = ''; - } + ## Generate the key for this project file + my($prkey) = $self->getcwd() . "/$file-$postkey"; + + ## We must change to the subdirectory for + ## which this project file is intended + if ($self->cd($dir)) { + my($gen) = []; + my($gpi) = []; + if ($self->{'cacheok'} && defined $allprojects{$prkey}) { + $gen = $allprojects{$prkey}; + $gpi = $allprinfo{$prkey}; + $status = 1; + } + else { + $status = $generator->generate(basename($file)); + + ## If any one project file fails, then stop + ## processing altogether. + if (!$status) { + ## We don't restore the state before we leave, + ## but that's ok since we will be exiting soon. + return $status, $generator; + } - ## Generate the key for this project file - my($prkey) = $self->getcwd() . "/$file-$postkey"; - - ## We must change to the subdirectory for - ## which this project file is intended - if ($self->cd($dir)) { - my($gen) = []; - my($gpi) = []; - if ($self->{'cacheok'} && defined $allprojects{$prkey}) { - $gen = $allprojects{$prkey}; - $gpi = $allprinfo{$prkey}; - $status = 1; + ## Get the individual project information and + ## generated file name(s) + $gen = $generator->get_files_written(); + $gpi = $generator->get_project_info(); + + ## If we need to generate a workspace file per project + ## then we generate a temporary project info and projects + ## array and call write_project(). + if ($dir ne '.' && defined $$gen[0] && $self->workspace_per_project()) { + my(%perpi) = (); + my(@perprojects) = (); + $self->save_project_info($gen, $gpi, '.', \@perprojects, \%perpi); + + ## Set our per project information + $self->{'projects'} = \@perprojects; + $self->{'project_info'} = \%perpi; + + ## Write our per project workspace + $self->write_workspace($generator); + + ## Reset our project information to empty + $self->{'projects'} = []; + $self->{'project_info'} = {}; + } + + if ($self->{'cacheok'}) { + $allprojects{$prkey} = $gen; + $allprinfo{$prkey} = $gpi; + } + } + $self->cd($cwd); + $self->save_project_info($gen, $gpi, $dir, \@projects, \%pi); } else { - $status = $generator->generate(basename($file)); - - ## If any one project file fails, then stop - ## processing altogether. - if (!$status) { - ## We don't restore the state before we leave, - ## but that's ok since we will be exiting soon. - return $status, $generator; - } + ## Unable to change to the directory. + ## We don't restore the state before we leave, + ## but that's ok since we will be exiting soon. + return 0, $generator; + } - ## Get the individual project information and - ## generated file name(s) - $gen = $generator->get_files_written(); - $gpi = $generator->get_project_info(); - - ## If we need to generate a workspace file per project - ## then we generate a temporary project info and projects - ## array and call write_project(). - if ($dir ne '.' && defined $$gen[0] && $self->workspace_per_project()) { - my(%perpi) = (); - my(@perprojects) = (); - $self->save_project_info($gen, $gpi, '.', \@perprojects, \%perpi); - - ## Set our per project information - $self->{'projects'} = \@perprojects; - $self->{'project_info'} = \%perpi; - - ## Write our per project workspace - $self->write_workspace($generator); - - ## Reset our project information to empty - $self->{'projects'} = []; - $self->{'project_info'} = {}; - } + ## Return things to the way they were + if (defined $self->{'scoped_assign'}->{$ofile}) { + $impl = $previmpl; - if ($self->{'cacheok'}) { - $allprojects{$prkey} = $gen; - $allprinfo{$prkey} = $gpi; + if ($restore) { + $self->{'cacheok'} = $prevcache; + $generator->restore_state(\%gstate); } } - $self->cd($cwd); - $self->save_project_info($gen, $gpi, $dir, \@projects, \%pi); } else { - ## Unable to change to the directory. - ## We don't restore the state before we leave, - ## but that's ok since we will be exiting soon. - return 0, $generator; - } - - ## Return things to the way they were - if (defined $self->{'scoped_assign'}->{$ofile}) { - $impl = $previmpl; - - if ($restore) { - $self->{'cacheok'} = $prevcache; - $generator->restore_state(\%gstate); - } + ## This one was excluded, so status is ok + $status = 1; } } |