aboutsummaryrefslogtreecommitdiffstats
path: root/CVSROOT
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2001-11-30 22:26:57 +0800
committerjoe <joe@FreeBSD.org>2001-11-30 22:26:57 +0800
commit721e2155b04711a3e7f4eaf39102ecd4978c67b9 (patch)
treed5323dc37d7bcb54a8c2ee4d20de7a9b4ab7dd4e /CVSROOT
parent9293af04974857ac68f95a843994c969ded00820 (diff)
downloadfreebsd-ports-gnome-721e2155b04711a3e7f4eaf39102ecd4978c67b9.tar.gz
freebsd-ports-gnome-721e2155b04711a3e7f4eaf39102ecd4978c67b9.tar.zst
freebsd-ports-gnome-721e2155b04711a3e7f4eaf39102ecd4978c67b9.zip
Move the map that determines the names of the log files to use into
the configuration file.
Diffstat (limited to 'CVSROOT')
-rwxr-xr-xCVSROOT/cfg.pm29
-rw-r--r--CVSROOT/cfg_local.pm30
-rwxr-xr-xCVSROOT/log_accum.pl71
3 files changed, 78 insertions, 52 deletions
diff --git a/CVSROOT/cfg.pm b/CVSROOT/cfg.pm
index 0979f8d01e98..734827e40fba 100755
--- a/CVSROOT/cfg.pm
+++ b/CVSROOT/cfg.pm
@@ -16,9 +16,10 @@ use strict;
use vars qw(
$ADD_TO_LINE $AVAIL_FILE $CHECK_HEADERS $COMMITCHECK_EXTRA
@COMMIT_HOSTS $COMMITTER $DEBUG $EXCLUDE_FILE $FILE_PREFIX $IDHEADER
- $LAST_FILE $MAILADDRS $MAILBANNER $MAILCMD $MAIL_BRANCH_HDR
- $MAIL_ON_DIR_CREATION $MAIL_TRANSFORM $MINCVSVERSION $PID $PROG_CVS
- $PROG_MV %TEMPLATE_HEADERS $TMPDIR $UNEXPAND_RCSID $WARN_HEADERS
+ $LAST_FILE @LOG_FILE_MAP $MAILADDRS $MAILBANNER $MAILCMD
+ $MAIL_BRANCH_HDR $MAIL_ON_DIR_CREATION $MAIL_TRANSFORM $MINCVSVERSION
+ $PID $PROG_CVS $PROG_MV %TEMPLATE_HEADERS $TMPDIR $UNEXPAND_RCSID
+ $WARN_HEADERS
);
my $CVSROOT = $ENV{'CVSROOT'} || die "Can't determine \$CVSROOT!";
@@ -187,6 +188,28 @@ $MAIL_TRANSFORM = "";
# add_cvsweb_entry("http://www.example.org/cgi-bin/cvsweb.cgi", @_);
#};
+# A copy of the commit summary is saved locally as well as being
+# emailed to the committers. The name of the local log is obtained
+# by performing a pattern match on the directory that the files are
+# in. The following map defines the file names and their associated
+# pattern match. They are checked in order. The name 'other' is
+# used if none of the patterns match.
+#
+# XXX The directory that the logs are placed in should be a
+# configuration option too.
+@LOG_FILE_MAP = (
+ 'CVSROOT' => '^CVSROOT/',
+ 'doc' => '^doc/',
+ 'user' => '^src/',
+ 'other' => '.*'
+);
+
+
+
+
+######################
+# EXAMPLES
+######################
# A function for post-processing a log message
# and outputing it with URLs to a cvsweb.cgi in.
sub add_cvsweb_entry {
diff --git a/CVSROOT/cfg_local.pm b/CVSROOT/cfg_local.pm
index c519f1df2a16..d3075f0f73f3 100644
--- a/CVSROOT/cfg_local.pm
+++ b/CVSROOT/cfg_local.pm
@@ -59,6 +59,36 @@ if ($hostname =~ /^freefall\.freebsd\.org$/i) {
}
+@LOG_FILE_MAP = (
+ 'CVSROOT' => '^CVSROOT/',
+ 'distrib' => '^distrib/',
+ 'doc' => '^doc/',
+ 'ports' => '^ports/',
+ 'projects' => '^projects/',
+ 'www' => '^www/',
+
+ 'bin' => '^src/bin/',
+ 'contrib' => '^src/contrib/',
+ 'eBones' => '^src/eBones/',
+ 'etc' => '^src/etc/',
+ 'games' => '^src/games/',
+ 'gnu' => '^src/gnu/',
+ 'include' => '^src/include/',
+ 'kerberosIV' => '^src/kerberosIV/',
+ 'lib' => '^src/lib/',
+ 'libexec' => '^src/libexec/',
+ 'lkm' => '^src/lkm/',
+ 'release' => '^src/release/',
+ 'sbin' => '^src/sbin/',
+ 'share' => '^src/share/',
+ 'sys' => '^src/sys/',
+ 'tools' => '^src/tools/',
+ 'usrbin' => '^src/usr\.bin/',
+ 'usrsbin' => '^src/usr\.sbin/',
+ 'user' => '^src/',
+
+ 'other' => '.*'
+);
1; # Perl requires all modules to return true. Don't delete!!!!
#end
diff --git a/CVSROOT/log_accum.pl b/CVSROOT/log_accum.pl
index 3d6b2515460a..5af5dcbdf3d5 100755
--- a/CVSROOT/log_accum.pl
+++ b/CVSROOT/log_accum.pl
@@ -46,7 +46,7 @@ my $ADDED_FILE = "$BASE_FN.added";
my $REMOVED_FILE = "$BASE_FN.removed";
my $LOG_FILE = "$BASE_FN.log";
my $SUMMARY_FILE = "$BASE_FN.summary";
-my $MAIL_FILE = "$BASE_FN.mail";
+my $LOGNAMES_FILE = "$BASE_FN.lognames";
my $SUBJ_FILE = "$BASE_FN.subj";
my $TAGS_FILE = "$BASE_FN.tags";
@@ -367,62 +367,35 @@ sub build_header {
# !!! Mailing-list and commitlog history file mappings here !!!
# This needs pulling out as a configuration block somewhere so
# that others can easily change it.
-sub mlist_map {
+sub get_log_name {
my $dir = shift; # Directory name
-
- return 'cvs-CVSROOT' if $dir =~ /^CVSROOT\//;
- return 'cvs-ports' if $dir =~ /^ports\//;
- return 'cvs-projects' if $dir =~ /^projects\//;
- return 'cvs-www' if $dir =~ /^www\//;
- return 'cvs-doc' if $dir =~ /^doc\//;
- return 'cvs-distrib' if $dir =~ /^distrib\//;
-
- return 'cvs-other' unless $dir =~ /^src\//;
-
- $dir =~ s,^src/,,;
-
- return 'cvs-bin' if $dir =~ /^bin\//;
- return 'cvs-contrib' if $dir =~ /^contrib\//;
- return 'cvs-eBones' if $dir =~ /^eBones\//;
- 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-lkm' if $dir =~ /^lkm\//;
- return 'cvs-release' if $dir =~ /^release\//;
- return 'cvs-sbin' if $dir =~ /^sbin\//;
- return 'cvs-share' if $dir =~ /^share\//;
- return 'cvs-sys' if $dir =~ /^sys\//;
- return 'cvs-tools' if $dir =~ /^tools\//;
- return 'cvs-usrbin' if $dir =~ /^usr\.bin\//;
- return 'cvs-usrsbin' if $dir =~ /^usr\.sbin\//;
-
- return 'cvs-user';
+
+
+ for my $i (0 .. ($#cfg::LOG_FILE_MAP - 1) / 2) {
+ my $log = $cfg::LOG_FILE_MAP[$i * 2];
+ my $pattern = $cfg::LOG_FILE_MAP[$i * 2 + 1];
+
+ return $log if $dir =~ /$pattern/;
+ }
+
+ return 'other';
}
sub do_changes_file {
my @text = @_;
my %unique = ();
- my @mailaddrs = &read_logfile($MAIL_FILE);
+ my @mailaddrs = &read_logfile($LOGNAMES_FILE);
foreach my $category (@mailaddrs) {
next if ($unique{$category});
$unique{$category} = 1;
- if ($category =~ /^cvs-/) {
- # convert mailing list name back to category
- chomp $category;
- $category =~ s/^cvs-//;
-
- my $changes = "$CVSROOT/CVSROOT/commitlogs/$category";
- open CHANGES, ">>$changes"
- or die "Cannot open $changes.\n";
- print CHANGES map { "$_\n" } @text;
- print CHANGES "\n\n\n";
- close CHANGES;
- }
+
+ my $changes = "$CVSROOT/CVSROOT/commitlogs/$category";
+ open CHANGES, ">>$changes"
+ or die "Cannot open $changes.\n";
+ print CHANGES map { "$_\n" } @text;
+ print CHANGES "\n\n\n";
+ close CHANGES;
}
}
@@ -432,7 +405,7 @@ sub mail_notification {
# This is turned off since the To: lines go overboard.
# Also it has bit-rotted since, and can't just be switched on again.
# - but keep it for the time being in case we do something like cvs-stable
-# my @mailaddrs = &read_logfile($MAIL_FILE);
+# my @mailaddrs = &read_logfile($LOGNAMES_FILE);
# print(MAIL 'To: cvs-committers' . $dom . ", cvs-all" . $dom);
# foreach $line (@mailaddrs) {
# next if ($unique{$line});
@@ -600,7 +573,7 @@ if ($cfg::DEBUG) {
}
# Was used for To: lines, still used for commitlogs naming.
-&append_line($MAIL_FILE, &mlist_map("$directory/"));
+&append_line($LOGNAMES_FILE, &get_log_name("$directory/"));
&append_line($SUBJ_FILE, "$directory " . join(" ", sort @filenames));
#