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.8 by sashby, Thu Jul 11 12:53:39 2002 UTC

# Line 14 | Line 14
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;
19 < require 5.001;
17 > #
18 >
19 > package Utilities::CVSmodule;
20   require Exporter;
21 + use Utilities::AddDir;
22 + require 5.004;
23   @ISA= qw(Exporter);
24  
25   sub new {
26          my $class=shift;
27 <        $self={};
27 >        my $self={};
28 >        bless $self, $class;
29          $self->{myenv}={};
30          $self->{cvs}='cvs';
28 #       $self->{cvs}='/usr/local/bin/cvs';
31          # Reset All variables
32          $self->{auth}="";
33          $self->{passkey}="";
34          $self->{user}="";
35          $self->{base}="";
36 <        $self->{passbase}=$ENV{HOME}."/.cvspass";
35 <        bless $self, $class;
36 >        $self->set_passbase("/tmp/".$>."CVSmodule/.cvspass");
37          return $self;
38   }
39  
40   sub set_passbase {
41          my $self=shift;
42 <        my $dir=shift;
42 >        my $file=shift;
43  
44 <        $self->{passbase}=$dir;
45 <        $self->env("CVS_PASSFILE", $dir);
44 >        my $dir;
45 >        ($dir=$file)=~s/(.*)\/.*/$1/;
46 >        AddDir::adddir($dir);
47 >        $self->{passbase}=$file;
48 >        $self->env("CVS_PASSFILE", $file);
49   }
50  
51   sub set_passkey {
# Line 74 | Line 78 | sub set_auth {
78          $self=shift;
79          $self->{auth}=shift;
80          $self->{auth}=~s/^\:*(.*)\:*/\:$1\:/;
81 +        
82          $self->_updatecvsroot();
83   }
84  
# Line 86 | Line 91 | sub env {
91   sub invokecvs {
92          $self=shift;
93          @cmds=@_;
94 <        #make sure weve got the right environment
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" ));
95 <        system( "$self->{cvs}" , "-d", "$self->{cvsroot}", @cmds );
98 >        # now perform the cvs command
99 >        return ( system( "$self->{cvs}" ,"-Q", "-d", "$self->{cvsroot}", @cmds ));
100   }
101  
102   sub _updatecvsroot {
# Line 100 | Line 104 | sub _updatecvsroot {
104          $self->{cvsroot}=$self->{auth}.$self->{user}.$self->{base};
105   }
106  
107 + sub cvsroot {
108 +        my $self=shift;
109 +        return $self->{cvsroot};
110 + }
111 +
112   sub repository {
113          my $self=shift;
114          return $self->{base};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines