#!/usr/bin/perl -w # A trivial script example to send mail on every CVS commit. # The mail sent includes change summary, log message and a unidiff # about the changes. # This perl script is intended to be run under Windows. Under unix, # you can do the same thing a bit easier by using a fork() call. # This script requires mailbe.pl to exist in the same directory. # For further documentation, please see the www page mentioned later. # The original author of this script is Jouni Heikniemi # Feel free to do whatever you wish with this. # The home page of this script is # . ######################################################################## # We have to spawn another process to avoid CVS locking. Since we can't # reliably pipe the STDIN contents to the spawned process, we write # everything to a text file, whose path we pass on the the mail backend. my @cvslog = ; my $tmppath = "$ENV{'TEMP'}\\cvsmailtmp.$$"; open TEMP, ">$tmppath"; print TEMP @cvslog; close TEMP; # Construct the path to mailbe.pl my $mailengpath = $0; $mailengpath =~ s/mail\.pl/mailbe\.pl/; # Call the system command interpreter and start a new process, # passing the arguments forward. system($ENV{'COMSPEC'}, '/c', 'start', $mailengpath, $tmppath, @ARGV);