<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/env perl
#
# cvsform.pl by Yasuhiro MORIKAWA, 2006
#   original is cvsdiff.pl by Eizi TOYODA, 2001
#
# for loginfo in CVS 1.12
#
# Downloaded from &lt;http://www.gfd-dennou.org/library/cc-env/cvs/customize/commitmail-tools/cvsform1.12.pl&gt;

############################################################
## Settings

$mailto0 = 'davis@gfd-dennou.org';
$envelop_from = '';
$project = 'davis';
$charcode = 'iso-2022-jp';

## End Setting
############################################################

# umask 0;
# open(LOG, "&gt;/tmp/cvsform.tmp");

$mailto = $ARGV[0] || $mailto0;
shift(@ARGV);
@loginfo = @ARGV;
$sendmailto = join(' ', split(/,/, $mailto));

####
# Fix username
$user = $ENV{'USER'} || $ENV{'LOGNAME'} || $&lt;;
$domain = '@gfd-dennou.org';

####
# Set envelop-from user
$_ = $envelop_from;
$envelop_from =~ s/\s//g;
unless ($envelop_from eq '') {
    $envelop_from = "-f" . $envelop_from;
}

# GMT Time
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time);
$date = sprintf("%04d-%02d-%02dT%02d:%02d-00:00",
		$year + 1900, $mon + 1, $mday, $hour, $min);

# # Local Time (Assume Japan Time)
# ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
# $localdate = sprintf("%04d-%02d-%02dT%02d:%02d+09:00",
# 		     $year + 1900, $mon + 1, $mday, $hour, $min);

open(MAIL, "|nkf|/usr/lib/sendmail $envelop_from $sendmailto"); # convert to JIS
select(MAIL);
print &lt;&lt;EOF;
From: $user$domain
To: $mailto
Subject: ${project}-cvs-commit $date
Mime-Version: 1.0
Content-Type: Text/Plain; charset=$charcode
Content-Transfer-Encoding: 8bit

EOF

$path = shift @loginfo;
$number = int(scalar(@loginfo) / 3);

if ($loginfo[0] eq '-') {
    @loginfo = ('.', 'NONE', 'NONE');
}

$s = 's' if $number != 1;

print &lt;&lt;EOF;
At $date, user $user commited following $number file$s.

EOF
$loginfo_num = 0;
while ($loginfo[$loginfo_num]) {
    $fnam = $loginfo[$loginfo_num]; $loginfo_num++;
    $old  = $loginfo[$loginfo_num]; $loginfo_num++;
    $new  = $loginfo[$loginfo_num]; $loginfo_num++;
    print &lt;&lt;EOF;
$path/$fnam: $old to $new
EOF
}

print &lt;&lt;EOF;

EOF

while (&lt;STDIN&gt;) {
    s/\x0D\x0A|\x0D|\x0A/\n/g;  # convert each OS linefeed code to "\n"
    print;
}

close(MAIL);
</pre></body></html>