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

Comparing COMP/SCRAM/src/BuildSystem/Build.pm (file contents):
Revision 1.5.2.1 by williamc, Thu Nov 2 17:37:02 2000 UTC vs.
Revision 1.7 by sashby, Fri Dec 10 14:05:52 2004 UTC

# Line 18 | Line 18 | use Utilities::Verbose;
18   require 5.004;
19   @ISA=qw(Utilities::Verbose);
20  
21 < sub new {
22 <        my $class=shift;
23 <        my $self={};
24 <        bless $self, $class;
25 <        $self->{area}=shift;
26 <        $self->{area}->copyenv(\%ENV);
27 <        $ENV{LOCALTOP}=$self->{area}->location();
28 <
29 <        # -- set RELEASTOP
30 <        my $rarea=$self->{area}->linkarea();
31 <        if ( ! defined $rarea ) {
32 <          $ENV{RELEASETOP}=$ENV{LOCALTOP};
33 <        }
34 <        else {
35 <          $ENV{RELEASETOP}=$rarea->location();
36 <        }
37 <
38 <        $self->verbose("LOCALTOP=".$ENV{LOCALTOP});
39 <        $self->verbose("RELEASETOP=".$ENV{RELEASETOP});
40 <        return $self;
41 < }
42 <
43 < sub build {
44 <        my $self=shift;
45 <        my $dir=shift;
46 <
47 <        # -- set up a report
48 <        my $report=BuildSystem::BuildReport->new();
49 <
50 <        # -- interface with old system
51 <        my $fulldir=$self->{area}->location()."/".$dir;
52 <        if ( ! -d $fulldir ) {
53 <          $report->error("$fulldir does not exist");
54 <          $report->status(1); # set to fail
55 <        }
56 <        else {
57 <          chdir $fulldir;
58 <          # -- initialise BuildSystem if we dont already have it
59 <          if ( ! defined $self->{bs} ) {
60 <            $self->{bs}=BuildSystem::BuildSetup->new($self->{area});
61 <            $self->{bs}->verbosity(1);
62 <          }
63 <          $self->verbose("Calling build module with $dir, @_");
64 <          my $rv=$self->{bs}->BuildDir($dir,@_);
65 <          $report->status($rv);
66 <        }
67 <        return $report;
68 < }
21 > sub new
22 >   {
23 >   my $class=shift;
24 >   my $self={};
25 >   bless $self, $class;
26 >   $self->{area}=shift;
27 >   $self->{toolbox}=shift;
28 >   # Other initialisations:
29 >   $self->_init();
30 >   $self->verbose("LOCALTOP=".$ENV{LOCALTOP});
31 >   $self->verbose("RELEASETOP=".$ENV{RELEASETOP});
32 >   return $self;
33 >   }
34 >
35 > sub _init
36 >   {
37 >   my $self=shift;
38 >   $self->{buildreport}=BuildSystem::BuildReport->new();
39 >   return $self;
40 >   }
41 >
42 > sub build
43 >   {
44 >   my $self=shift;
45 >   my $dir=shift;
46 >
47 >   # Get the full directory path:
48 >   my $fulldir=$self->{area}->location()."/".$dir;
49 >  
50 >   # Check that the build dir exists:
51 >   if ( ! -d $fulldir )
52 >      {
53 >      $self->{buildreport}->error("$dir does not exist");
54 >      $self->{buildreport}->status(1); # set to fail
55 >      }
56 >   else
57 >      {
58 >      chdir $fulldir;
59 >      # -- initialise BuildSystem if we dont already have it
60 >      if ( ! defined $self->{bs} )
61 >         {
62 >         $self->{bs}=BuildSystem::BuildSetup->new($self->{toolbox});
63 >         }
64 >      $self->verbose("Calling build module with $dir, @_");
65 >      my $rv=$self->{bs}->BuildDir($dir,@_);
66 >      $self->{buildreport}->status($rv);
67 >      }
68 >   return $self->{buildreport};
69 >   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines