[cvsnt] loginfo example

bwhicks at aep.com bwhicks at aep.com
Wed Nov 16 15:21:13 GMT 2005


Community technical support mailing list was retired 2010 and replaced with a professional technical support team. For assistance please contact: Pre-sales Technical support via email to sales@march-hare.com.


I'm posting this because I've had a couple of people ask me about it.

Because of some strange problems with loginfo (tested in version
2.5.02.2099 and 2.5.02.2115), I couldn't pass the arguments directly as
space separated variables (like this: fix_loginfo.pl %s %V %v) and had to
pass them like this: %{sVv} which comma separates them. So, my loginfo file
looks like this:

DEFAULT fix_loginfo.pl %{sVv},$CVSROOT,$USER

and the fix_loginfo.pl script will send messages to syslog. it looks like
this:

#!/usr/bin/perl -w

use strict;
use warnings;
use Sys::Syslog;

my $output;
my @newARGV = split (/\,/,"@ARGV");

if ($newARGV[0] =~ /(\w+)\/+(\w+) \- New directory\s*/ ) {
    $output = "A new directory called ".$2." was created in
".$newARGV[3]."/".$1." by user ".$newARGV[4];
} else {
    $output = $newARGV[4]." has changed file
'".$newARGV[3]."/".$newARGV[0]."' from version ".$newARGV[1]." to version
".$newARGV[2];
}

openlog ('cvsnt','cons,pid','local3');
syslog ('info', $output);
closelog;




More information about the cvsnt mailing list
Download the latest CVSNT, TortosieCVS, WinCVS etc. for Windows 8 etc.
@CVSNT on Twitter   CVSNT on Facebook