ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/BuildPackageReqs
Revision: 1.4
Committed: Tue Dec 11 10:05:04 2001 UTC (23 years, 5 months ago) by sashby
Branch: MAIN
CVS Tags: V0_19_7, V0_19_6, V0_19_6p1, V0_19_5, SFATEST, V0_19_4, V0_19_4_pre3, V0_19_4_pre2, V0_19_4_pre1, V0_19_3, V0_19_2, V0_19_1
Branch point for: SCRAM_V1_BRANCH, V0_19_4_B
Changes since 1.3: +2 -1 lines
Log Message:
*** empty log message ***

File Contents

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