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

Comparing COMP/SCRAM/src/Utilities/SCRAMUtils.pm (file contents):
Revision 1.1 by williamc, Mon Mar 1 10:35:01 1999 UTC vs.
Revision 1.6 by williamc, Mon Jul 31 12:37:20 2000 UTC

# Line 1 | Line 1
1 #!perl
1   #
2   # Utility Routines for the SCRAM tools
3   #
4  
5   package SCRAMUtils;
6 + require 5.001;
7   require Exporter;
8   @ISA = qw(Exporter);
9   @EXPORT = qw(checkfile updatelookup);
10   use Carp;
11  
12 < sub checkfile ($filename) {
12 > sub checkfile {
13          my $filename=shift;
14          my $thisfile="";
15 <        $thifile=$ENV{LOCALTOP}."/".$filename;
15 >        $thisfile=$ENV{LOCALTOP}."/".$filename;
16          return $thisfile, if ( -e $thisfile );
17 <        $thifile=$ENV{RELEASETOP}."/".$filename;
17 >        $thisfile=$ENV{RELEASETOP}."/".$filename;
18          return $thisfile, if ( -e $thisfile );
19          return "";
20   }
# Line 32 | Line 32 | sub updatelookup {
32          open ( SCRAMWORK, ">$filename.wk" ) or
33                  croak "Unable to open $filename.wk ".$!."\n";
34          open ( SCRAMUPDATEFILE,  $filename );
35 +        print "Searching for ".$key."\n";
36          while ( <SCRAMUPDATEFILE> ) {
37 <                if ( $_=~/^\Q$key\E/o ) {
37 >                chomp;
38 >                print $_."\n".$key."\n\n";
39 >                if ( $_=~/^\Q$key\E/ ) {
40                          $update=1;
41                          print SCRAMWORK $key.$rest."\n";
42                  }
43 <                print SCRAMWORK $_;
43 >                else {  
44 >                 print SCRAMWORK $_."\n";
45 >                }
46          }
42
47          close SCRAMUPDATEFILE;
48          if ( $update==0 ) {
49                  print SCRAMWORK $key.$rest."\n";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines