#!/usr/bin/perl
#
# Useage:  taglog.pl "Tagname" "operation" "repository" "filename Revisions"
#	where operation = add, move, or delete
#
#	The script is called by CVS as a result of tagging a build because the 
#	following line appears in the taginfo file:
#		ALL <script location>
#
#	
$module = @ARGV[2];	# Repository name passed by CVS
$tagName = @ARGV[0];	# Tag Name passed by CVS
$time = localtime	# localtime = localtime(time())

open (TEMPLATE, "/home/projects/CVSROOT/TagLog.Template") || die ("Can't open file TEMPLATE: $!");
@templateContents = <TEMPLATE>;         # read template into an array of lines


for (@templateContents) {
	s/-module-/$module/;
	s/-tag_name-/$tagName/;
	s/-date-/$time/; 
}

open (LOGFILE, ">> tag.log") || die ("Can't open file TEMPLATE: $!");
print LOGFILE @templateContents;

exec "vi +?REASON?+6 tag.log";

 

