ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/Scram/ScramProjectDB.pm
(Generate patch)

Comparing COMP/SCRAM/src/Scram/ScramProjectDB.pm (file contents):
Revision 1.6 by sashby, Mon Jun 18 15:19:51 2001 UTC vs.
Revision 1.7 by sashby, Fri Nov 9 14:15:15 2001 UTC

# Line 40 | Line 40 | sub file {
40          return $self->{dbfile};
41   }
42  
43 < sub getarea {
44 <        require Configuration::ConfigArea;
45 <        my $self=shift;
46 <        my $name=shift;
47 <        my $version=shift;
48 <
49 <        my $area=undef;
50 <        my $index=$self->_findlocal($name,$version);
51 <        if ( $index != -1 ) {  
52 <         my $location=$self->{projects}[$index][3];
53 <         if ( defined $self->{projectobjects}{$location} ) {
54 <           $area=$self->{projectobjects}{$location};
43 > sub getarea
44 >   {
45 >   require Configuration::ConfigArea;
46 >   my $self=shift;
47 >   my $name=shift;
48 >   my $version=shift;
49 >   my $area=undef;
50 >   my $index=$self->_findlocal($name,$version);
51 >  
52 >   if ( $index != -1 )
53 >      {
54 >      my $location=$self->{projects}[$index][3];
55 >      if ( defined $self->{projectobjects}{$location} )
56 >         {
57 >         $area=$self->{projectobjects}{$location};
58           }
59 <         else {
59 >      else
60 >         {
61           $area=Configuration::ConfigArea->new();
62           $self->verbose("Attempt to ressurect $name $version from $location");
63 <         if ( $area->bootstrapfromlocation($location) == 1 ) {
64 <           undef $area;
65 <           $self->verbose("attempt unsuccessful");
66 <         }
67 <         else {
68 <           $self->verbose("area found");
69 <           $self->{projectobjects}{$location}=$area;
63 >         if ( $area->bootstrapfromlocation($location) == 1 )
64 >            {
65 >            undef $area;
66 >                 $self->verbose("attempt unsuccessful");
67 >            }
68 >         else
69 >            {
70 >            $self->verbose("area found");
71 >            $self->{projectobjects}{$location}=$area;
72 >            }
73           }
74 +      }
75 +   else
76 +      {
77 +      # -- search in linked databases
78 +      foreach $db ( @{$self->{linkeddbs}} )
79 +         {
80 +         $self->verbose("Searching in $db->file() for $name $version");
81 +         $area=$db->getarea($name,$version);
82 +         last if (defined $area);
83           }
84 <        }
85 <        else {
86 <           # -- search in linked databases
87 <           foreach $db ( @{$self->{linkeddbs}} ) {
88 <              $self->verbose("Searching in $db->file() for $name $version");
89 <              $area=$db->getarea($name,$version);
90 <              last if (defined $area);
91 <           }
92 <        }
77 <        if ( ! defined $area ) {
78 <           $self->verbose("Area $name $version not found");
79 <        }
80 <        return $area;
81 < }
84 >      }
85 >   if ( ! defined $area )
86 >      {
87 >      $self->verbose("Area $name $version not found");
88 >      }
89 >
90 >   return $area;
91 >   }
92 >
93  
94   sub addarea {
95          my $self=shift;
# Line 134 | Line 145 | sub list {
145   sub listall {
146          my $self=shift;
147          my @list=$self->list();
148 <
148 >        
149          foreach $db ( @{$self->{linkeddbs}} ) {
150            $self->verbose("Adding list from $db");
151            push @list, $db->listall();
152          }
153 +
154          return @list;
155   }
156  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines