ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/BuildPackageReqs
Revision: 1.2
Committed: Mon Mar 1 11:01:41 1999 UTC (26 years, 2 months ago) by williamc
Branch: MAIN
CVS Tags: ProtoEnd, V0_9_13, V0_9_12, V0_9_11, V0_9_10, V0_9_9, V0_9_8, V0_9_7, V0_9_6, V0_9_5, V0_9_4, V0_9_3, V0_9_2, V0_9_1, V0_9, V0_8, V0_7, V0_6, V0_5, V0_4, V0_3, V0_2, V0_1
Branch point for: V0_9branch
Changes since 1.1: +1 -1 lines
Log Message:
get rid of unessary shell invocation stuff in modules

File Contents

# User Rev Content
1 williamc 1.1 #!perl
2     #
3     # build the package dependencies information file
4     #
5     # First argument is filename to build
6     # Following arguments are package names to update from
7    
8     $reqsfile=shift;
9 williamc 1.2 use Utilities::Switcher;
10 williamc 1.1
11     &initialise;
12     foreach $file ( @ARGV ) {
13     $hashtags={
14     'Use' => 'none',
15     'Use_StartTag' => 'Use_start'
16     };
17     $switch=Switcher->new($hashtags,"$file");
18     &finishup;
19     }
20    
21     sub Use_start {
22     my $name=shift;
23     my @var=@_;
24     my $hashref;
25    
26     $hashref=$switch->SetupValueHash(\@vars);
27     $switch->checkparam($hashref, $name, "name");
28    
29     print WORKFILE "local__$file:Use:$$hashref{name}\n";
30     }
31    
32     sub initialise {
33     open WORKFILE, ">$reqsfile.wk" ) or die "Unable to open $reqsfile.wk $!";
34     open ( REQSFILE , "<$reqsfile" );
35     while ( <REQSFILE> ) {
36     foreach $file ( @ARGV ) {
37     next if ( /^local__$file:Use:/ )
38     print WORKFILE $_;
39     }
40     }
41     close REQSFILE
42     }
43    
44     sub finishup {
45     use File::Copy;
46     close WORKFILE;
47     copy ( $reqsfile.wk, $reqsfile ) or die "Unable to update $reqsfile $!";
48     }