summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog21
-rwxr-xr-xclone_build_tree.pl19
-rw-r--r--modules/AutomakeWorkspaceCreator.pm4
-rw-r--r--modules/ProjectCreator.pm30
-rw-r--r--modules/WorkspaceCreator.pm7
5 files changed, 57 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog
index 1cb6739c..05fd44a7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+Thu Jul 15 14:02:04 2004 Chad Elliott <elliott_c@ociweb.com>
+
+ * clone_build_tree.pl:
+
+ Cleaned up the code a bit.
+
+ * modules/AutomakeWorkspaceCreator.pm:
+
+ Used a parameter passed into write_comps to determine if we are
+ writing the top level workspace.
+
+ * modules/ProjectCreator.pm:
+
+ Ignore project names that are set in a base project. It doesn't
+ make sense and I can't think of a practical use of this.
+
+ * modules/WorkspaceCreator.pm:
+
+ Fixed a bug where an excluded name could be partially matched and
+ possibly exclude something that wasn't meant to be.
+
Thu Jul 8 14:09:49 2004 Chad Elliott <elliott_c@ociweb.com>
* README:
diff --git a/clone_build_tree.pl b/clone_build_tree.pl
index 52507fd6..abbc5f58 100755
--- a/clone_build_tree.pl
+++ b/clone_build_tree.pl
@@ -32,7 +32,7 @@ use File::Basename;
# Data Section
# ******************************************************************
-my($version) = '0.1';
+my($version) = '0.2';
my($exclude) = undef;
my($verbose) = 0;
my(@foundFiles) = ();
@@ -100,10 +100,9 @@ sub findCallback {
);
if ($matches) {
- ## Remove the beginning dot slash and save the file
- my($file) = $File::Find::name;
- $file =~ s/^\.[\\\/]+//;
- push(@foundFiles, $file);
+ ## Remove the beginning dot slash as we save the file
+ push(@foundFiles, $File::Find::name);
+ $foundFiles[$#foundFiles] =~ s/^\.[\\\/]+//;
}
}
}
@@ -310,7 +309,7 @@ sub hardlinkFiles {
## Remove links that point to non-existant files
my($lfh) = new FileHandle();
my($txt) = "$fullbuild/clone_build_tree.links";
- if (open($lfh, "$txt")) {
+ if (open($lfh, $txt)) {
while(<$lfh>) {
my($line) = $_;
$line =~ s/\s+$//;
@@ -356,7 +355,9 @@ sub linkFiles {
## Search for the clonable files
print "Searching $startdir for files...\n";
my($files) = getFileList();
- print "Found $#foundFiles files and directories.\n";
+ my($findtime) = time() - $starttime;
+ print 'Found ', scalar(@$files), ' files and directories in ',
+ $findtime, ' second', ($findtime == 1 ? '' : 's'), ".\n";
foreach my $build (@$builds) {
my($fullbuild) = "$builddir/$build";
@@ -375,7 +376,7 @@ sub linkFiles {
}
if ($status == 0) {
- print "Total time: ", time() - $starttime, " seconds.\n";
+ print 'Total time: ', time() - $starttime, " seconds.\n";
}
return $status;
@@ -480,7 +481,7 @@ else {
if (!defined $builds[0]) {
my($cwd) = getcwd();
if (chdir($builddir)) {
- @builds = glob("*");
+ @builds = glob('*');
chdir($cwd);
}
else {
diff --git a/modules/AutomakeWorkspaceCreator.pm b/modules/AutomakeWorkspaceCreator.pm
index 18ec81fc..f763a0e2 100644
--- a/modules/AutomakeWorkspaceCreator.pm
+++ b/modules/AutomakeWorkspaceCreator.pm
@@ -58,6 +58,8 @@ sub pre_workspace {
sub write_comps {
my($self) = shift;
my($fh) = shift;
+ my($creator) = shift;
+ my($toplevel) = shift;
my($projects) = $self->get_projects();
my(@list) = $self->sort_dependencies($projects);
my($crlf) = $self->crlf();
@@ -71,7 +73,7 @@ sub write_comps {
## the tree. configure.ac can include this to get an up-to-date list
## of all the involved Makefiles.
my($mfh);
- if ($self->getstartdir() eq $self->getcwd()) {
+ if ($toplevel) {
unlink('configure.ac.Makefiles');
$mfh = new FileHandle();
open($mfh, '>configure.ac.Makefiles');
diff --git a/modules/ProjectCreator.pm b/modules/ProjectCreator.pm
index 88a9a0f1..263a7794 100644
--- a/modules/ProjectCreator.pm
+++ b/modules/ProjectCreator.pm
@@ -231,8 +231,8 @@ sub process_assignment {
## the user to correctly depend on another project within the same
## directory.
if ($name eq 'after' && $value =~ /\*/) {
- my($def) = $self->get_default_project_name();
- $value = $self->fill_type_name($value, $def);
+ $value = $self->fill_type_name($value,
+ $self->get_default_project_name());
}
if (defined $value && !$self->{'dollar_special'} && $value =~ /\$\$/) {
$value =~ s/\$\$/\$/g;
@@ -503,15 +503,23 @@ sub parse_line {
'or a back slash in the name';
}
else {
- $name =~ s/^\(\s*//;
- $name =~ s/\s*\)$//;
- $name = $self->transform_file_name($name);
-
- ## Replace any *'s with the default name
- my($def) = $self->get_default_project_name();
- $name = $self->fill_type_name($name, $def);
-
- $self->set_project_name($name);
+ ## We should only set the project name if we are not
+ ## reading in a parent project.
+ if (!defined $self->{'reading_parent'}->[0]) {
+ $name =~ s/^\(\s*//;
+ $name =~ s/\s*\)$//;
+ $name = $self->transform_file_name($name);
+
+ ## Replace any *'s with the default name
+ $name = $self->fill_type_name(
+ $name,
+ $self->get_default_project_name());
+
+ $self->set_project_name($name);
+ }
+ else {
+ $self->warning("Ignoring project name in a base project.");
+ }
}
}
}
diff --git a/modules/WorkspaceCreator.pm b/modules/WorkspaceCreator.pm
index a231f515..5e98c73c 100644
--- a/modules/WorkspaceCreator.pm
+++ b/modules/WorkspaceCreator.pm
@@ -372,7 +372,7 @@ sub excluded {
my($file) = shift;
foreach my $excluded (@{$self->{'exclude'}->{$self->{'wctype'}}}) {
- if ($excluded eq $file || $file =~ /$excluded\//) {
+ if ($excluded eq $file || $file =~ /^$excluded\//) {
return 1;
}
}
@@ -725,7 +725,7 @@ sub write_workspace {
my($different) = 1;
if (open($fh, ">$tmp")) {
$self->pre_workspace($fh);
- $self->write_comps($fh, $creator);
+ $self->write_comps($fh, $creator, $addfile);
$self->post_workspace($fh);
close($fh);
@@ -765,7 +765,7 @@ sub write_workspace {
else {
if (open($fh, ">$name")) {
$self->pre_workspace($fh);
- $self->write_comps($fh, $creator);
+ $self->write_comps($fh, $creator, $addfile);
$self->post_workspace($fh);
close($fh);
@@ -1788,6 +1788,7 @@ sub write_comps {
#my($self) = shift;
#my($fh) = shift;
#my($gens) = shift;
+ #my($top) = shift;
}