ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/Interface.pm
Revision: 1.2
Committed: Mon Mar 1 11:01:42 1999 UTC (26 years, 2 months ago) by williamc
Content type: text/plain
Branch: MAIN
Changes since 1.1: +1 -4 lines
Log Message:
get rid of unessary shell invocation stuff in modules

File Contents

# User Rev Content
1 williamc 1.1 package Interface;
2 williamc 1.2 require 5.001;
3 williamc 1.1 require Exporter;
4     require BuildFile;
5     @ISA = qw(Exporter);
6     @EXPORT = qw( GetClass $ClassDir $Class);
7    
8     sub GetClass($dirname) {
9     my $dirname = shift;
10     $Class="DEFAULT";
11     $ClassDir="";
12    
13     #return if $dirname eq "";
14     @DIRA=split /\//, $dirname;
15    
16     $thispath=".";
17     # bootstrap from project buildfile if it exists
18     BuildFile::CheckBuildFile($ENV{projconfigdir});
19    
20     my @ClassPaths=split /:/, $BuildFile::BlockClassPath;
21     foreach $BClassPath ( @ClassPaths ) {
22     next if ( $BClassPath eq "");
23     push @LoBCA, [ split /\//, $BClassPath ];
24     }
25     for ( $i=0; $i<=$#DIRA; $i++ ) {
26     $thispath=$thispath."/".$DIRA[$i];
27     if ( ($ClassName=BuildFile::CheckBuildFile($thispath)) ne "" ) {
28     $Class=$ClassName;
29     $ClassDir=$thispath;
30     }
31     # TODO --- Must test against position of last new BlockCaseA
32     # Need to reset array LoBCA to the New BlockPath
33     # - merge and replace options
34     #
35     else {
36     foreach $BlockClassA ( @LoBCA ) {
37     if ( $$BlockClassA[0]=~/^$DIRA[$i]\+/ ) {
38     $$BlockClassA[0]=~s/^$DIRA[$i]//;
39     }
40     if ( $$BlockClassA[0]=~/^\+/ ) {
41     ($Class=$$BlockClassA[0])=~s/^\+//;
42     $ClassDir=$thispath;
43     shift @$BlockClassA;
44     }
45     else {
46     @$BlockClassA=();
47     }
48     }
49     }
50     }
51     $ClassDir=~s/^\.\///;
52     }