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

Comparing COMP/SCRAM/src/Utilities/CVSmodule.pm (file contents):
Revision 1.3 by williamc, Fri Dec 17 10:10:36 1999 UTC vs.
Revision 1.4 by williamc, Mon Aug 28 08:35:16 2000 UTC

# Line 15 | Line 15
15   # invokecvs(@cmds)  : invoke a cvs command supplied in @cmds
16   # repository            : return a string to indicate the repository
17   #                      
18 < package CVSmodule;
19 < require 5.001;
18 > package Utilities::CVSmodule;
19   require Exporter;
20 + use Utilities::AddDir;
21 + require 5.004;
22   @ISA= qw(Exporter);
23  
24   sub new {
25          my $class=shift;
26 <        $self={};
26 >        my $self={};
27 >        bless $self, $class;
28          $self->{myenv}={};
29          $self->{cvs}='cvs';
30   #       $self->{cvs}='/usr/local/bin/cvs';
# Line 31 | Line 33 | sub new {
33          $self->{passkey}="";
34          $self->{user}="";
35          $self->{base}="";
36 <        $self->{passbase}=$ENV{HOME}."/.cvspass";
37 <        bless $self, $class;
36 > #       $self->{passbase}=$ENV{HOME}."/.cvspass";
37 >        $self->set_passbase("/tmp/CVSmodule/.cvspass");
38          return $self;
39   }
40  
41   sub set_passbase {
42          my $self=shift;
43 <        my $dir=shift;
43 >        my $file=shift;
44  
45 <        $self->{passbase}=$dir;
46 <        $self->env("CVS_PASSFILE", $dir);
45 >        my $dir;
46 >        ($dir=$file)=~s/(.*)\/.*/$1/;
47 >        AddDir::adddir($dir);
48 >        $self->{passbase}=$file;
49 >        $self->env("CVS_PASSFILE", $file);
50   }
51  
52   sub set_passkey {
# Line 88 | Line 93 | sub invokecvs {
93          @cmds=@_;
94          #make sure weve got the right environment
95          foreach $key ( %{$self->{myenv}} ) {
96 <          $ENV{$key}=$self->{myenv}{$key}
96 >          $ENV{$key}=$self->{myenv}{$key};
97          }
98          #now perform the cvs command
99          #print ( join ' ', ( $self->{cvs}, "-d", $self->{cvsroot}, @cmds, "\n" ));
# Line 100 | Line 105 | sub _updatecvsroot {
105          $self->{cvsroot}=$self->{auth}.$self->{user}.$self->{base};
106   }
107  
108 + sub cvsroot {
109 +        my $self=shift;
110 +        return $self->{cvsroot};
111 + }
112 +
113   sub repository {
114          my $self=shift;
115          return $self->{base};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines