Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

cvsplot, perl, and CVS

Jacob438Jacob438 Member Posts: 8
I need to extract some code metrics from our CVS repository. I am using an open source app called cvsplot, I'm using the newest version and you can check it out here...

http://cvsstat.sourceforge.net/

Anyways, I am running this on a windows machine rather than a UNIX machine just because that's all I have available for the near future. I'm having problems with the following lines of code (i do not get expected results)

[code]
# Unfortunately, cvs log doesn't indicate the number of
# lines an initial revision is created with, so find this
# out using the following cvs command.
my $lccmd = "";
if ($rlog_module ne "")
{
$working_file =~ /^${working_cvsdir}/(.*)$/;
$lccmd = "cvs -d $cvsdir co -r $revision -p "$1"";
}
else
{
$lccmd = "cvs update -r $revision -p "$relative_working_file"";
}
print "Executing $lccmd
" if $debug;
$number_lines = `$lccmd 2>/dev/null | wc -l`;

chop $number_lines;
$number_lines =~ s/ //g;
print "$working_file 1.1 = $number_lines lines
" if $debug;
[/code]

The value $number_lines doesn't get set to anything. When I try to execute the execution line (with the `'s in them) I get an error on the console stating that it can't find that file. Which probably has to do with this part:
[code]
$number_lines = `$lccmd 2>/dev/null | wc -l`;
[/code]

specifically this part
[code]
2>/dev/null | wc -l
[/code]

well, what is that supposed to do if this were ran in a unix box? I'm relatively new to perl and unix, so bear with me, I've had experience, but it's been a while since my skills were last put to use. Thanks,

Jacob438


Comments

  • dalehenddalehend Member Posts: 33

    You are right. This script assumes a *nix environment with a cvs client.
    The best alternative I can give you is to implement another script,
    http://simplecvs.sourceforge.net/, that will act as a cvs client on windows.

    regards,
    Dale
    Moderator




  • Shawn CarterShawn Carter Member Posts: 0

    ___ | http://forcoder.org | free ebooks and video tutorials about [ C++ Assembly Visual Basic Visual Basic .NET Delphi PHP Swift C# MATLAB Python R Java Go C Ruby Perl JavaScript PL/SQL Objective-C Scratch VBScript Apex Lua Scala Scheme Julia F# Rust Clojure Ada COBOL Erlang SAS Dart Fortran Alice Hack Logo Lisp Crystal Awk Kotlin D ABAP Prolog Bash Transact-SQL FoxPro ML LabVIEW ] ______________

Sign In or Register to comment.