ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/BuildSystem/Build.pm
Revision: 1.2
Committed: Wed Sep 13 11:17:14 2000 UTC (24 years, 8 months ago) by williamc
Content type: text/plain
Branch: MAIN
Changes since 1.1: +8 -3 lines
Log Message:
Use status rather than pass

File Contents

# Content
1 #
2 # Build.pm
3 #
4 # Originally Written by Christopher Williams
5 #
6 # Description
7 #
8 # Interface
9 # ---------
10 # new(ConfigArea) : A new Build object
11 # build(dir,[@targets]) : Build relevant target for a given directory
12 # dir relative to top. Returns a BuildReport
13
14 package BuildSystem::Build;
15 use BuildSystem::BuildReport;
16 use Utilities::Verbose;
17 require 5.004;
18 @ISA=qw(Utilities::Verbose);
19
20 sub new {
21 my $class=shift;
22 my $self={};
23 bless $self, $class;
24 $self->{area}=shift;
25 $self->{area}->copyenv(\%ENV);
26 $ENV{LOCALTOP}=$self->{area}->location();
27 $self->verbose("LOCALTOP=".$ENV{LOCALTOP});
28 return $self;
29 }
30
31 sub build {
32 my $self=shift;
33 my $dir=shift;
34
35 # -- set up a report
36 my $report=BuildSystem::BuildReport->new();
37 $report->status(1); # set to fail
38
39 # -- interface with old system
40 my $fulldir=$self->{area}->location()."/".$dir;
41 if ( ! -d $fulldir ) {
42 $report->error("$fulldir does not exist");
43 }
44 else {
45 chdir $fulldir;
46 my $bs=BuildSystem::BuildSetup->new($self->{area});
47 $bs->verbosity(1);
48 $self->verbose("Calling build module with $dir, @_");
49 $rv=$bs->BuildSetup($dir,@_);
50 $report->status($rv);
51 }
52 return $report;
53 }