From: Rob H. <for...@us...> - 2002-06-19 06:30:39
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv15477/lib/SandWeb Modified Files: Shell.pm Repository.pm Log Message: ok, the log object reference is being passed correctly down this path - Repository -> cvs -> Shell Added some very important debugging to the Shell class, going to add alot more Index: Shell.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Shell.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -U2 -r1.11 -r1.12 --- Shell.pm 5 Jun 2002 06:32:17 -0000 1.11 +++ Shell.pm 19 Jun 2002 06:30:36 -0000 1.12 @@ -33,4 +33,5 @@ my $system = $args{'system'} || ''; my $vcs = $args{'vcs'} || ''; + my $log = $args{'log_obj'} || ''; my $self = bless { @@ -42,4 +43,5 @@ 'system' => "$system", 'vcs' => "$vcs", + 'log' => $log, }, $class; @@ -58,10 +60,15 @@ my $system = $self->{'system'} || ''; my $vcs = $self->{'vcs'} || ''; + my $log = $self->{'log'} || ''; my $command = $args{'command'}; + $log->debug("VCS call to Unix shell"); + $log->debug("VCS command is : $command"); my $output; if ( $system ) { + $log->debug("Using System username/password"); if ( $vcs ) { + $log->debug("Using VCS username/password"); my $raw_output = `$sandweb_expect system_vcs $system_username $system_password \'$vcs_password\' $command`; $raw_output =~ s/ /\n/g; @@ -71,4 +78,5 @@ $output = join('', @lined_output); } else { + $log->debug("Not using VCS username/password"); my $raw_output = `$sandweb_expect system $system_username $system_password $command`; $raw_output =~ s/^M/\n/g; @@ -79,4 +87,5 @@ } } elsif ( $vcs ) { + $log->debug("Using VCS username/password"); my $raw_output = `$sandweb_expect vcs \'$vcs_password\' "$command" 2>&1`; $raw_output =~ s/^M/\n/g; @@ -86,4 +95,5 @@ $output = join('', @lined_output); } else { + $log->debug("Not using VCS username/password"); $output = `$command 2>&1`; } Index: Repository.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Repository.pm,v retrieving revision 1.41 retrieving revision 1.42 diff -U2 -r1.41 -r1.42 --- Repository.pm 4 Jun 2002 18:24:59 -0000 1.41 +++ Repository.pm 19 Jun 2002 06:30:36 -0000 1.42 @@ -83,4 +83,8 @@ my $bindir = $args{'bindir'} || ''; + # $log hold the log object + + my $log = $args{'log_obj'} || ''; + my $self = bless { 'repo_type' => $repo_type, @@ -96,4 +100,5 @@ 'cvs_bin' => $cvs_bin, 'bindir' => $bindir, + 'log' => $log, }, $class; @@ -427,4 +432,5 @@ my $repo_type = $self->get_repo_type(); + my $log = $self->get_log(); my $file = $args{'file'}; @@ -436,4 +442,5 @@ } + $log->debug("Performing log operation"); my %return = $self->call_vcs( command => 'log', @@ -831,4 +838,5 @@ my $cvs_bin = $self->get_cvs_bin() || ''; my $bindir = $self->get_bindir() || ''; + my $log = $self->get_log() || ''; my $command = $args{'command'} || ''; @@ -851,4 +859,5 @@ vcs_username => $vcs_username, vcs_password => $vcs_password, + log_obj => $log, ); @@ -1027,4 +1036,14 @@ if ($self->{'bindir'}) { return $self->{'bindir'}; + } + else { + return 0; + } +} + +sub get_log { + my $self = shift; + if ($self->{'log'}) { + return $self->{'log'}; } else { |