summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xCVSROOT/commit_prep.pl171
-rwxr-xr-xCVSROOT/commitcheck11
-rw-r--r--CVSROOT/commitinfo23
-rwxr-xr-xCVSROOT/cvs_acls.pl143
-rw-r--r--CVSROOT/editinfo31
-rwxr-xr-xCVSROOT/log_accum.pl407
-rw-r--r--CVSROOT/loginfo24
-rw-r--r--CVSROOT/rcsinfo19
-rw-r--r--CVSROOT/rcstemplate7
9 files changed, 836 insertions, 0 deletions
diff --git a/CVSROOT/commit_prep.pl b/CVSROOT/commit_prep.pl
new file mode 100755
index 0000000..7e4e631
--- /dev/null
+++ b/CVSROOT/commit_prep.pl
@@ -0,0 +1,171 @@
+#!/usr/local/bin/perl -w
+#
+# $FreeBSD$
+#
+#
+# Perl filter to handle pre-commit checking of files. This program
+# records the last directory where commits will be taking place for
+# use by the log_accumulate script. For new file, it forcing the
+# existence of a RCS "Id" keyword in the first ten lines of the file.
+# For existing files, it checks version number in the "Id" line to
+# prevent losing changes because an old version of a file was copied
+# into the direcory.
+#
+# Possible future enhancements:
+#
+#
+# Check for cruft left by unresolved conflicts. Search for
+# "^<<<<<<<$", "^-------$", and "^>>>>>>>$".
+#
+# Look for a copyright and automagically update it to the
+# current year.
+#
+# Contributed by David Hampton <hampton@cisco.com>
+#
+
+############################################################
+#
+# Configurable options
+#
+############################################################
+#
+# Check each file (except dot files) for an RCS "Id" keyword.
+#
+$check_id = 0;
+
+#
+# Record the directory for later use by the log_accumulate stript.
+#
+$record_directory = 1;
+
+############################################################
+#
+# Constants
+#
+############################################################
+$LAST_FILE = "/tmp/#cvs.lastdir";
+$ENTRIES = "CVS/Entries";
+
+$NoId = "
+%s - Does not contain a line with the keyword \"Id:\".
+ Please see the template files for an example.\n";
+
+# Protect string from substitution by RCS.
+$NoName = "
+%s - The ID line should contain only \"\$\I\d\:\ \$\" for a newly created file.\n";
+
+$BadName = "
+%s - The file name '%s' in the ID line does not match
+ the actual filename.\n";
+
+$BadVersion = "
+%s - How dare you!! You replaced your copy of the file '%s',
+ which was based upon version %s, with an %s version based
+ upon %s. Please move your '%s' out of the way, perform an
+ update to get the current version, and them merge your changes
+ into that file.\n";
+
+############################################################
+#
+# Subroutines
+#
+############################################################
+
+sub write_line {
+ local($filename, $line) = @_;
+ open(FILE, ">$filename") || die("Cannot open $filename, stopped");
+ print(FILE $line, "\n");
+ close(FILE);
+}
+
+sub check_version {
+ local($i, $id, $rname, $version);
+ local($filename, $cvsversion) = @_;
+
+ open(FILE, $filename) || die("Cannot open $filename, stopped");
+ for ($i = 1; $i < 10; $i++) {
+ $pos = -1;
+ last if eof(FILE);
+ $line = <FILE>;
+ $pos = index($line, "Id: ");
+ last if ($pos >= 0);
+ }
+
+ if ($pos == -1) {
+ printf($NoId, $filename);
+ return(1);
+ }
+
+ ($id, $rname, $version) = split(' ', substr($line, $pos));
+ if ($cvsversion{$filename} == 0) {
+ if ($rname ne "\$") {
+ printf($NoName, $filename);
+ return(1);
+ }
+ return(0);
+ }
+
+ if ($rname ne "$filename,v") {
+ printf($BadName, $filename, substr($rname, 0, length($rname)-2));
+ return(1);
+ }
+ if ($cvsversion{$filename} < $version) {
+ printf($BadVersion, $filename, $filename, $cvsversion{$filename},
+ "newer", $version, $filename);
+ return(1);
+ }
+ if ($cvsversion{$filename} > $version) {
+ printf($BadVersion, $filename, $filename, $cvsversion{$filename},
+ "older", $version, $filename);
+ return(1);
+ }
+ return(0);
+}
+
+#############################################################
+#
+# Main Body
+#
+############################################################
+
+$id = getpgrp();
+#print("ARGV - ", join(":", @ARGV), "\n");
+#print("id - ", id, "\n");
+
+#
+# Suck in the Entries file
+#
+open(ENTRIES, $ENTRIES) || die("Cannot open $ENTRIES.\n");
+while (<ENTRIES>) {
+ local($filename, $version) = split('/', substr($_, 1));
+ $cvsversion{$filename} = $version;
+}
+
+$directory = $ARGV[0];
+shift @ARGV;
+
+#
+# Now check each file name passed in, except for dot files. Dot files
+# are considered to be administrative files by this script.
+#
+if ($check_id != 0) {
+ $failed = 0;
+ foreach $arg (@ARGV) {
+ next if (index($arg, ".") == 0);
+ $failed += &check_version($arg);
+ }
+ if ($failed) {
+ print "\n";
+ exit(1);
+ }
+}
+
+#
+# Record this directory as the last one checked. This will be used
+# by the log_accumulate script to determine when it is processing
+# the final directory of a multi-directory commit.
+#
+if ($record_directory != 0) {
+ &write_line("$LAST_FILE.$id", $directory);
+}
+exit(0);
diff --git a/CVSROOT/commitcheck b/CVSROOT/commitcheck
new file mode 100755
index 0000000..b213037
--- /dev/null
+++ b/CVSROOT/commitcheck
@@ -0,0 +1,11 @@
+#! /bin/sh
+#
+# $FreeBSD$
+
+if perl $CVSROOT/CVSROOT/cvs_acls.pl ${1+"$@"}; then
+ if perl $CVSROOT/CVSROOT/commit_prep.pl ${1+"$@"}; then
+ exit 0
+ fi
+fi
+
+exit 1
diff --git a/CVSROOT/commitinfo b/CVSROOT/commitinfo
new file mode 100644
index 0000000..17ae416
--- /dev/null
+++ b/CVSROOT/commitinfo
@@ -0,0 +1,23 @@
+#
+# commitinfo,v 1.2 1992/03/31 04:19:47 berliner Exp
+# $FreeBSD$
+#
+# The "commitinfo" file is used to control pre-commit checks.
+# The filter on the right is invoked with the repository and a list
+# of files to check. A non-zero exit of the filter program will
+# cause the commit to be aborted.
+#
+# The first entry on a line is a regular expression which is tested
+# against the directory that the change is being committed to, relative to the
+# $CVSROOT. If a match is found, then the remainder of the line is the
+# name of the filter to run.
+#
+# If the repository name does not match any of the regular expressions in this
+# file, the "DEFAULT" line is used, if it is specified.
+#
+# If the name ALL appears as a regular expression it is always used
+# in addition to the first matching regex or DEFAULT.
+#
+#^cvs checkforcvsid
+#DEFAULT checkforid
+ALL /home/ncvs/CVSROOT/commitcheck
diff --git a/CVSROOT/cvs_acls.pl b/CVSROOT/cvs_acls.pl
new file mode 100755
index 0000000..9226f5b
--- /dev/null
+++ b/CVSROOT/cvs_acls.pl
@@ -0,0 +1,143 @@
+#!/usr/local/bin/perl -- # -*-Perl-*-
+#
+# cvs_acls.pl,v 1.2 1992/04/11 16:01:24 berliner Exp
+# $FreeBSD$
+#
+# Access control lists for CVS. dgg@ksr.com (David G. Grubbs)
+#
+# CVS "commitinfo" for matching repository names, running the program it finds
+# on the same line. More information is available in the CVS man pages.
+#
+# ==== INSTALLATION:
+#
+# To use this program as I intended, do the following four things:
+#
+# 0. Install PERL. :-)
+#
+# 1. Put one line, as the *only* non-comment line, in your commitinfo file:
+#
+# DEFAULT /usr/local/bin/cvs_acls
+#
+# 2. Install this file as /usr/local/bin/cvs_acls and make it executable.
+#
+# 3. Create a file named $CVSROOT/CVSROOT/avail.
+#
+# ==== FORMAT OF THE avail FILE:
+#
+# The avail file determines whether you may commit files. It contains lines
+# read from top to bottom, keeping track of a single "bit". The "bit"
+# defaults to "on". It can be turned "off" by "unavail" lines and "on" by
+# "avail" lines. ==> Last one counts.
+#
+# Any line not beginning with "avail" or "unavail" is ignored.
+#
+# Lines beginning with "avail" or "unavail" are assumed to be '|'-separated
+# triples: (All spaces and tabs are ignored in a line.)
+#
+# {avail.*,unavail.*} [| user,user,... [| repos,repos,...]]
+#
+# 1. String starting with "avail" or "unavail".
+# 2. Optional, comma-separated list of usernames.
+# 3. Optional, comma-separated list of repository pathnames.
+# These are pathnames relative to $CVSROOT. They can be directories or
+# filenames. A directory name allows access to all files and
+# directories below it.
+#
+# Example: (Text from the ';;' rightward may not appear in the file.)
+#
+# unavail ;; Make whole repository unavailable.
+# avail|dgg ;; Except for user "dgg".
+# avail|fred, john|bin/ls ;; Except when "fred" or "john" commit to
+# ;; the module whose repository is "bin/ls"
+#
+# PROGRAM LOGIC:
+#
+# CVS passes to @ARGV an absolute directory pathname (the repository
+# appended to your $CVSROOT variable), followed by a list of filenames
+# within that directory.
+#
+# We walk through the avail file looking for a line that matches both
+# the username and repository.
+#
+# A username match is simply the user's name appearing in the second
+# column of the avail line in a space-or-comma separate list.
+#
+# A repository match is either:
+# - One element of the third column matches $ARGV[0], or some
+# parent directory of $ARGV[0].
+# - Otherwise *all* file arguments ($ARGV[1..$#ARGV]) must be
+# in the file list in one avail line.
+# - In other words, using directory names in the third column of
+# the avail file allows committing of any file (or group of
+# files in a single commit) in the tree below that directory.
+# - If individual file names are used in the third column of
+# the avail file, then files must be committed individually or
+# all files specified in a single commit must all appear in
+# third column of a single avail line.
+#
+
+$debug = 0;
+$cvsroot = $ENV{'CVSROOT'};
+$availfile = $cvsroot . "/CVSROOT/avail";
+$myname = $ENV{"USER"} if !($myname = $ENV{"LOGNAME"});
+
+eval "print STDERR \$die='Unknown parameter $1\n' if !defined \$$1; \$$1=\$';"
+ while ($ARGV[0] =~ /^(\w+)=/ && shift(@ARGV));
+exit 255 if $die; # process any variable=value switches
+
+die "Must set CVSROOT\n" if !$cvsroot;
+($repos = shift) =~ s:^$cvsroot/::;
+grep($_ = $repos . '/' . $_, @ARGV);
+
+print "$$ Repos: $repos\n","$$ ==== ",join("\n$$ ==== ",@ARGV),"\n" if $debug;
+
+$exit_val = 0; # Good Exit value
+
+$universal_off = 0;
+open (AVAIL, $availfile) || exit(0); # It is ok for avail file not to exist
+while (<AVAIL>) {
+ chop;
+ next if /^\s*\#/;
+ next if /^\s*$/;
+ ($flagstr, $u, $m) = split(/[\s,]*\|[\s,]*/, $_);
+
+ # Skip anything not starting with "avail" or "unavail" and complain.
+ (print "Bad avail line: $_\n"), next
+ if ($flagstr !~ /^avail/ && $flagstr !~ /^unavail/);
+
+ # Set which bit we are playing with. ('0' is OK == Available).
+ $flag = (($& eq "avail") ? 0 : 1);
+
+ # If we find a "universal off" flag (i.e. a simple "unavail") remember it
+ $universal_off = 1 if ($flag && !$u && !$m);
+
+ # $myname considered "in user list" if actually in list or is NULL
+ $in_user = (!$u || grep ($_ eq $myname, split(/[\s,]+/,$u)));
+ print "$$ \$myname($myname) in user list: $_\n" if $debug && $in_user;
+
+ # Module matches if it is a NULL module list in the avail line. If module
+ # list is not null, we check every argument combination.
+ if (!($in_repo = !$m)) {
+ @tmp = split(/[\s,]+/,$m);
+ for $j (@tmp) {
+ # If the repos from avail is a parent(or equal) dir of $repos, OK
+ $in_repo = 1, last if ($repos eq $j || $repos =~ /^$j\//);
+ }
+ if (!$in_repo) {
+ $in_repo = 1;
+ for $j (@ARGV) {
+ last if !($in_repo = grep ($_ eq $j, @tmp));
+ }
+ }
+ }
+ print "$$ \$repos($repos) in repository list: $_\n" if $debug && $in_repo;
+
+ $exit_val = $flag if ($in_user && $in_repo);
+ print "$$ ==== \$exit_val = $exit_val\n$$ ==== \$flag = $flag\n" if $debug;
+}
+close(AVAIL);
+print "$$ ==== \$exit_val = $exit_val\n" if $debug;
+print "**** Access denied: Insufficient Karma ($myname|$repos)\n" if $exit_val;
+print "**** Access allowed: Personal Karma exceeds Environmental Karma.\n"
+ if $universal_off && !$exit_val;
+exit($exit_val);
diff --git a/CVSROOT/editinfo b/CVSROOT/editinfo
new file mode 100644
index 0000000..61f6c26
--- /dev/null
+++ b/CVSROOT/editinfo
@@ -0,0 +1,31 @@
+#
+# editinfo,v 1.1 1992/03/21 06:49:39 berliner Exp
+# $FreeBSD$
+#
+# The "editinfo" file is used to allow verification of logging
+# information. It works best when a template (as specified in the
+# rcsinfo file) is provided for the logging procedure. Given a
+# template with locations for, a bug-id number, a list of people who
+# reviewed the code before it can be checked in, and an external
+# process to catalog the differences that were code reviewed, the
+# following test can be applied to the code:
+#
+# Making sure that the entered bug-id number is correct.
+# Validating that the code that was reviewed is indeed the code being
+# checked in (using the bug-id number or a seperate review
+# number to identify this particular code set.).
+#
+# If any of the above test failed, then the commit would be aborted.
+#
+# Actions such as mailing a copy of the report to each reviewer are
+# better handled by an entry in the loginfo file.
+#
+# Although these test could be handled by an interactive script being
+# called via an entry in commitinfo, The information reported in
+# such a script can't be easily merged into the report.
+#
+# One thing that should be noted is the the ALL keyword is not
+# supported. There can be only one entry that matches a given
+# repository.
+#
+#DEFAULT $CVSROOT/CVSROOT/edit "%s"
diff --git a/CVSROOT/log_accum.pl b/CVSROOT/log_accum.pl
new file mode 100755
index 0000000..bbc20c8
--- /dev/null
+++ b/CVSROOT/log_accum.pl
@@ -0,0 +1,407 @@
+#!/usr/local/bin/perl -w
+#
+# $FreeBSD$
+#
+# Perl filter to handle the log messages from the checkin of files in
+# a directory. This script will group the lists of files by log
+# message, and mail a single consolidated log message at the end of
+# the commit.
+#
+# This file assumes a pre-commit checking program that leaves the
+# names of the first and last commit directories in a temporary file.
+#
+# Contributed by David Hampton <hampton@cisco.com>
+#
+
+############################################################
+#
+# Configurable options
+#
+############################################################
+#
+# Do cisco Systems, Inc. specific nonsense.
+#
+$cisco_systems = 0;
+
+############################################################
+#
+# Constants
+#
+############################################################
+$STATE_NONE = 0;
+$STATE_CHANGED = 1;
+$STATE_ADDED = 2;
+$STATE_REMOVED = 3;
+$STATE_LOG = 4;
+
+$LAST_FILE = "/tmp/#cvs.lastdir";
+$CHANGED_FILE = "/tmp/#cvs.files.changed";
+$ADDED_FILE = "/tmp/#cvs.files.added";
+$REMOVED_FILE = "/tmp/#cvs.files.removed";
+$LOG_FILE = "/tmp/#cvs.files.log";
+$FILE_PREFIX = "#cvs.files";
+
+$AVAIL_FILE = "$ENV{'CVSROOT'}/CVSROOT/avail";
+$MAIL_FILE = "/tmp/#cvs.mail";
+$VERSION_FILE = "version";
+$TRUNKREV_FILE = "TrunkRev";
+#$CHANGES_FILE = "Changes";
+#$CHANGES_TEMP = "Changes.tmp";
+
+############################################################
+#
+# Subroutines
+#
+############################################################
+
+sub format_names {
+ local($dir, @files) = @_;
+ local(@lines);
+ $lines[0] = sprintf(" %-08s", $dir);
+ foreach $file (@files) {
+ if (length($lines[$#lines]) + length($file) > 60) {
+ $lines[++$#lines] = sprintf(" %8s", " ");
+ }
+ $lines[$#lines] .= " ".$file;
+ }
+ @lines;
+}
+
+sub cleanup_tmpfiles {
+ local($all) = @_;
+ local($wd, @files);
+
+ $wd = `pwd`;
+ chdir("/tmp");
+ opendir(DIR, ".");
+ if ($all == 1) {
+ push(@files, grep(/$id$/, readdir(DIR)));
+ push(@files, "$MAIL_FILE.$id.db") if (-e "$MAIL_FILE.$id.db");
+ } else {
+ push(@files, grep(/^$FILE_PREFIX.*$id$/, readdir(DIR)));
+ }
+ closedir(DIR);
+ foreach (@files) {
+ unlink $_;
+ }
+ chdir($wd);
+}
+
+sub write_logfile {
+ local($filename, @lines) = @_;
+ open(FILE, ">$filename") || die ("Cannot open log file $filename.\n");
+ print(FILE join("\n", @lines), "\n");
+ close(FILE);
+}
+
+sub append_to_file {
+ local($filename, $dir, @files) = @_;
+ if (@files) {
+ local(@lines) = &format_names($dir, @files);
+ open(FILE, ">>$filename") || die ("Cannot open file $filename.\n");
+ print(FILE join("\n", @lines), "\n");
+ close(FILE);
+ }
+}
+
+sub write_line {
+ local($filename, $line) = @_;
+ open(FILE, ">$filename") || die("Cannot open file $filename.\n");
+ print(FILE $line, "\n");
+ close(FILE);
+}
+
+sub read_line {
+ local($line);
+ local($filename) = @_;
+ open(FILE, "<$filename") || die("Cannot open file $filename.\n");
+ $line = <FILE>;
+ close(FILE);
+ chop($line);
+ $line;
+}
+
+sub read_file {
+ local(@text);
+ local($filename, $leader) = @_;
+ open(FILE, "<$filename") || return ();
+ while (<FILE>) {
+ chop;
+ push(@text, sprintf(" %-10s %s", $leader, $_));
+ $leader = "";
+ }
+ close(FILE);
+ @text;
+}
+
+sub read_logfile {
+ local(@text);
+ local($filename, $leader) = @_;
+ open(FILE, "<$filename") || die ("Cannot open log file $filename.\n");
+ while (<FILE>) {
+ chop;
+ push(@text, $leader.$_);
+ }
+ close(FILE);
+ @text;
+}
+
+sub bump_version {
+ local($trunkrev, $editnum, $version);
+
+ $trunkrev = &read_line("$ENV{'CVSROOT'}/$repository/$TRUNKREV_FILE");
+ $editnum = &read_line("$ENV{'CVSROOT'}/$repository/$VERSION_FILE");
+ &write_line("$ENV{'CVSROOT'}/$repository/$VERSION_FILE", $editnum+1);
+ $version = $trunkrev . "(" . $editnum . ")";
+}
+
+sub build_header {
+ local($version) = @_;
+ local($header);
+ local($sec,$min,$hour,$mday,$mon,$year) = localtime(time);
+ $version = '';
+ $header = sprintf("%-8s %s %02d/%02d/%02d %02d:%02d:%02d",
+ $login, $version, $year%100, $mon+1, $mday,
+ $hour, $min, $sec);
+}
+
+# !!! Mailing-list and history file mappings here !!!
+sub mlist_map {
+ local($dir) = @_;
+
+ return 'cvs-CVSROOT' if($dir =~ /^CVSROOT/);
+ return 'cvs-ports' if($dir =~ /^ports/);
+
+ return 'cvs-other' unless($dir =~ /^src/);
+ $dir =~ s,^src/,,;
+
+ return 'cvs-bin' if($dir =~ /^bin/);
+ return 'cvs-etc' if($dir =~ /^etc/);
+ return 'cvs-games' if($dir =~ /^games/);
+ return 'cvs-gnu' if($dir =~ /^gnu/);
+ return 'cvs-include' if($dir =~ /^include/);
+ return 'cvs-kerberosIV' if($dir =~ /^kerberosIV/);
+ return 'cvs-lib' if($dir =~ /^lib\//);
+ return 'cvs-libexec' if($dir =~ /^libexec/);
+ return 'cvs-sbin' if($dir =~ /^sbin/);
+ return 'cvs-share' if($dir =~ /^share/);
+ return 'cvs-usrbin' if($dir =~ /^usr\.bin/);
+ return 'cvs-usrsbin' if($dir =~ /^usr\.sbin/);
+
+ return 'cvs-user' unless($dir =~ /^sys/);
+ $dir =~ s,^sys/,,;
+
+ return 'cvs-sys_ddb' if($dir =~ /^ddb/);
+ return 'cvs-sys_fs' if($dir =~ /^(fs)|(isofs)|(miscfs)|(nfs)|(ufs)/);
+ return 'cvs-sys_i386' if($dir =~ /^i386/);
+ return 'cvs-sys_net' if($dir =~ /^net/);
+ return 'cvs-sys_kern' if($dir =~ /^kern/);
+ return 'cvs-sys_libkern' if($dir =~ /^libkern/);
+ return 'cvs-sys_scsi' if($dir =~ /^scsi/);
+ return 'cvs-sys_sys' if($dir =~ /^sys/);
+ return 'cvs-sys_vm' if($dir =~ /^vm/);
+
+ return 'cvs-sys';
+}
+
+sub do_changes_file {
+ local($changes,$category);
+ local(@text) = @_;
+
+ $category = $mlist;
+ $category =~ s/^cvs-//;
+
+ $changes = "$ENV{'CVSROOT'}/CVSROOT/commitlogs/$category";
+
+ open(CHANGES, ">>$changes") || die("Cannot open $changes.\n");
+ print(CHANGES join("\n", @text), "\n\n");
+ close(CHANGES);
+}
+
+sub do_avail_file {
+ local($where) = @_;
+ local($users,$repo,$who);
+
+ dbmopen(MAILFILE, "$MAIL_FILE.$id", 0666);
+ open(AVAIL, "<$AVAIL_FILE") || die("Cannot open $AVAIL_FILE.\n");
+ while(<AVAIL>) {
+ if(/^avail\|([^|]*)\|(.*)$/) {
+ $users = $1;
+ $repo = $2;
+ if(($where eq $repo) || ($where =~ /^$repo\//)) {
+ foreach $who (split(/,/, $users)) {
+ $MAILFILE{$who} = 1;
+ }
+ }
+ } elsif(/^avail\|([^|]*)$/) {
+ foreach $who (split(/,/, $1)) {
+ $MAILFILE{$who} = 1;
+ }
+ }
+ }
+ close(AVAIL);
+ dbmclose(MAILFILE);
+}
+
+
+sub mail_notification {
+ local(@text) = @_;
+ local($names);
+
+ print "Mailing commit message...\n";
+ dbmopen(MAILFILE, "$MAIL_FILE.$id", 0666);
+ $names = join(" ", keys %MAILFILE) . " $mlist";
+ $names =~ s,\n,,;
+ dbmclose(MAILFILE);
+
+ open(MAIL, "| mail -s \"cvs commit: $ARGV[0]\" $names");
+ print(MAIL join("\n", @text));
+ close(MAIL);
+}
+
+#############################################################
+#
+# Main Body
+#
+############################################################
+
+#
+# Initialize basic variables
+#
+$id = getpgrp();
+$state = $STATE_NONE;
+$login = getlogin || (getpwuid($<))[0] || die("Unknown user $<.\n");
+@files = split(' ', $ARGV[0]);
+@path = split('/', $files[0]);
+$repository = @path[0];
+if ($#path == 0) {
+ $dir = ".";
+} else {
+ $dir = join('/', @path[1..$#path]);
+}
+#print("ARGV - ", join(":", @ARGV), "\n");
+#print("files - ", join(":", @files), "\n");
+#print("path - ", join(":", @path), "\n");
+#print("dir - ", $dir, "\n");
+#print("id - ", $id, "\n");
+
+$mlist = &mlist_map($files[0]);
+
+#
+# Check for a new directory first. This will always appear as a
+# single item in the argument list, and an empty log message.
+#
+if ($ARGV[0] =~ /New directory/) {
+ $version = &bump_version if ($cisco_systems != 0);
+ $header = &build_header($version);
+ @text = ();
+ push(@text, $header);
+ push(@text, "");
+ push(@text, " ".$ARGV[0]);
+ &do_changes_file(@text);
+ &mail_notification(@text);
+ exit 0;
+}
+
+&do_avail_file($dir);
+
+#
+# Iterate over the body of the message collecting information.
+#
+while (<STDIN>) {
+ chop; # Drop the newline
+ if (/^Modified Files/) { $state = $STATE_CHANGED; next; }
+ if (/^Added Files/) { $state = $STATE_ADDED; next; }
+ if (/^Removed Files/) { $state = $STATE_REMOVED; next; }
+ if (/^Log Message/) { $state = $STATE_LOG; next; }
+ s/^[ \t\n]+//; # delete leading space
+ s/[ \t\n]+$//; # delete trailing space
+
+ push (@changed_files, split) if ($state == $STATE_CHANGED);
+ push (@added_files, split) if ($state == $STATE_ADDED);
+ push (@removed_files, split) if ($state == $STATE_REMOVED);
+ push (@log_lines, $_) if ($state == $STATE_LOG);
+}
+
+#
+# Strip leading and trailing blank lines from the log message. Also
+# compress multiple blank lines in the body of the message down to a
+# single blank line.
+#
+while ($#log_lines > -1) {
+ last if ($log_lines[0] ne "");
+ shift(@log_lines);
+}
+while ($#log_lines > -1) {
+ last if ($log_lines[$#log_lines] ne "");
+ pop(@log_lines);
+}
+for ($i = $#log_lines; $i > 0; $i--) {
+ if (($log_lines[$i - 1] eq "") && ($log_lines[$i] eq "")) {
+ splice(@log_lines, $i, 1);
+ }
+}
+
+#
+# Find the log file that matches this log message
+#
+for ($i = 0; ; $i++) {
+ last if (! -e "$LOG_FILE.$i.$id");
+ @text = &read_logfile("$LOG_FILE.$i.$id", "");
+ last if ($#text == -1);
+ last if (join(" ", @log_lines) eq join(" ", @text));
+}
+
+#
+# Spit out the information gathered in this pass.
+#
+&write_logfile("$LOG_FILE.$i.$id", @log_lines);
+&append_to_file("$ADDED_FILE.$i.$id", $dir, @added_files);
+&append_to_file("$CHANGED_FILE.$i.$id", $dir, @changed_files);
+&append_to_file("$REMOVED_FILE.$i.$id", $dir, @removed_files);
+
+#
+# Check whether this is the last directory. If not, quit.
+#
+if (-e "$LAST_FILE.$id") {
+ $_ = &read_line("$LAST_FILE.$id");
+ exit 0 if (! grep(/$files[0]$/, $_));
+}
+
+#
+# This is it. The commits are all finished. Lump everything together
+# into a single message, fire a copy off to the mailing list, and drop
+# it on the end of the Changes file.
+#
+# Get the full version number
+#
+$version = &bump_version if ($cisco_systems != 0);
+$header = &build_header($version);
+
+#
+# Produce the final compilation of the log messages
+#
+@text = ();
+push(@text, $header);
+push(@text, "");
+for ($i = 0; ; $i++) {
+ last if (! -e "$LOG_FILE.$i.$id");
+ push(@text, &read_file("$CHANGED_FILE.$i.$id", "Modified:"));
+ push(@text, &read_file("$ADDED_FILE.$i.$id", "Added:"));
+ push(@text, &read_file("$REMOVED_FILE.$i.$id", "Removed:"));
+ push(@text, " Log:");
+ push(@text, &read_logfile("$LOG_FILE.$i.$id", " "));
+ push(@text, "");
+}
+if ($cisco_systems != 0) {
+ @ddts = grep(/^CSCdi/, split(' ', join(" ", @text)));
+ $text[0] .= " " . join(" ", @ddts);
+}
+#
+# Put the log message at the beginning of the Changes file and mail
+# out the notification.
+#
+&do_changes_file(@text);
+&mail_notification(@text);
+&cleanup_tmpfiles(1);
+exit 0;
diff --git a/CVSROOT/loginfo b/CVSROOT/loginfo
new file mode 100644
index 0000000..7abe865
--- /dev/null
+++ b/CVSROOT/loginfo
@@ -0,0 +1,24 @@
+#
+# $FreeBSD$
+#
+# The "loginfo" file is used to control where "cvs commit" log information
+# is sent. The first entry on a line is a regular expression which is tested
+# against the directory that the change is being made to, relative to the
+# $CVSROOT. If a match is found, then the remainder of the line is a filter
+# program that should expect log information on its standard input.
+#
+# The filter program may use one and only one % modifier (ala printf). If
+# %s is specified in the filter program, a brief title is included (enclosed
+# in single quotes) showing the modified file names.
+#
+# If the repository name does not match any of the regular expressions in this
+# file, the "DEFAULT" line is used, if it is specified.
+#
+# If the name ALL appears as a regular expression it is always used
+# in addition to the first matching regex or DEFAULT.
+#
+# NB: For FreeBSD 2.0, the following line is the ONLY one which should
+# ever appear. If you want to do something extra to the log output, learn
+# Perl.
+#
+DEFAULT perl $CVSROOT/CVSROOT/log_accum.pl %s
diff --git a/CVSROOT/rcsinfo b/CVSROOT/rcsinfo
new file mode 100644
index 0000000..1c02ed7
--- /dev/null
+++ b/CVSROOT/rcsinfo
@@ -0,0 +1,19 @@
+#
+# rcsinfo,v 1.3 1992/04/10 18:59:14 berliner Exp
+# $FreeBSD$
+#
+# The "rcsinfo" file is used to control templates with which the editor
+# is invoked on commit and import.
+#
+# The first entry on a line is a regular expression which is tested
+# against the directory that the change is being made to, relative to the
+# $CVSROOT. If a match is found, then the remainder of the line is the
+# name of the file that contains the template.
+#
+# If the repository name does not match any of the regular expressions in this
+# file, the "DEFAULT" line is used, if it is specified.
+#
+# If the name ALL appears as a regular expression it is always used
+# in addition to the first matching regex or DEFAULT.
+#
+ALL /home/ncvs/CVSROOT/rcstemplate
diff --git a/CVSROOT/rcstemplate b/CVSROOT/rcstemplate
new file mode 100644
index 0000000..085f975
--- /dev/null
+++ b/CVSROOT/rcstemplate
@@ -0,0 +1,7 @@
+Reviewed by:
+Submitted by:
+CVS: ----------------------------------------------------------------------
+CVS: Delete the ``Reviewed by'' line if this is somebody else's work
+CVS: (you are the reviewer).
+CVS: Delete the ``Submitted by'' line if this is NOT somebody else's
+CVS: work (you are the author).
OpenPOWER on IntegriCloud