Howdy, Stranger!

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


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...

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)

# 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"";
$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;

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:
$number_lines = `$lccmd 2>/dev/null | wc -l`;

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

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,



  • 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,, that will act as a cvs client on windows.


  • Shawn CarterShawn Carter Member Posts: 0

    ___ | | 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.