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.2 by williamc, Fri Oct 22 10:08:42 1999 UTC vs.
Revision 1.7 by sashby, Thu Jun 13 14:46:22 2002 UTC

# Line 13 | Line 13
13   # set_passkey(encrypted) : For pserver method - set a password
14   #                          (encrypted)
15   # invokecvs(@cmds)  : invoke a cvs command supplied in @cmds
16 + # repository            : return a string to indicate the repository
17   #                      
18 < package CVSmodule;
18 < 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';
27 #       $self->{cvs}='/usr/local/bin/cvs';
30          # Reset All variables
31          $self->{auth}="";
32          $self->{passkey}="";
33          $self->{user}="";
34          $self->{base}="";
35 <        $self->{passbase}=$ENV{HOME}."/.cvspass";
34 <        bless $self, $class;
35 >        $self->set_passbase("/tmp/".$>."CVSmodule/.cvspass");
36          return $self;
37   }
38  
39   sub set_passbase {
40          my $self=shift;
41 <        my $dir=shift;
41 >        my $file=shift;
42  
43 <        $self->{passbase}=$dir;
44 <        $self->env("CVS_PASSFILE", $dir);
43 >        my $dir;
44 >        ($dir=$file)=~s/(.*)\/.*/$1/;
45 >        AddDir::adddir($dir);
46 >        $self->{passbase}=$file;
47 >        $self->env("CVS_PASSFILE", $file);
48   }
49  
50   sub set_passkey {
# Line 85 | Line 89 | sub env {
89   sub invokecvs {
90          $self=shift;
91          @cmds=@_;
92 <        #make sure weve got the right environment
92 >        # make sure weve got the right environment
93          foreach $key ( %{$self->{myenv}} ) {
94 <          $ENV{$key}=$self->{myenv}{$key}
94 >          $ENV{$key}=$self->{myenv}{$key};
95          }
96 <        #now perform the cvs command
97 <        #print ( join ' ', ( $self->{cvs}, "-d", $self->{cvsroot}, @cmds, "\n" ));
94 <        system( "$self->{cvs}" , "-d", "$self->{cvsroot}", @cmds );
96 >        # now perform the cvs command
97 >        return ( system( "$self->{cvs}" ,"-Q", "-d", "$self->{cvsroot}", @cmds ));
98   }
99  
100   sub _updatecvsroot {
101          my $self=shift;
102          $self->{cvsroot}=$self->{auth}.$self->{user}.$self->{base};
103   }
104 +
105 + sub cvsroot {
106 +        my $self=shift;
107 +        return $self->{cvsroot};
108 + }
109 +
110 + sub repository {
111 +        my $self=shift;
112 +        return $self->{base};
113 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines