aboutsummaryrefslogtreecommitdiffstats
path: root/CVSROOT
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2001-10-30 18:45:56 +0800
committerjoe <joe@FreeBSD.org>2001-10-30 18:45:56 +0800
commitefb53e289a8a0807521c83e03fa616c754936a06 (patch)
tree630fcda87a64bf4eb7f6cb32c71fd06632cb3a12 /CVSROOT
parent53033dbcb9ebd421900e43f2ff7543e93961c9fb (diff)
downloadfreebsd-ports-gnome-efb53e289a8a0807521c83e03fa616c754936a06.tar.gz
freebsd-ports-gnome-efb53e289a8a0807521c83e03fa616c754936a06.tar.zst
freebsd-ports-gnome-efb53e289a8a0807521c83e03fa616c754936a06.zip
Add the hosts that we're allowed to commit on to the configuration
file instead of hard coding them.
Diffstat (limited to 'CVSROOT')
-rwxr-xr-xCVSROOT/cfg.pm12
-rw-r--r--CVSROOT/cfg_local.pm2
-rwxr-xr-xCVSROOT/commitcheck12
3 files changed, 22 insertions, 4 deletions
diff --git a/CVSROOT/cfg.pm b/CVSROOT/cfg.pm
index 728c1d360bdc..f837a7c84b2b 100755
--- a/CVSROOT/cfg.pm
+++ b/CVSROOT/cfg.pm
@@ -15,7 +15,7 @@ package cfg;
use strict;
use vars qw($DEBUG $FILE_PREFIX $MAILADDRS $MAILBANNER $MAILCMD
$MAIL_BRANCH_HDR $MAIL_ON_DIR_CREATION $MAIL_TRANSFORM
- $ADD_TO_LINE $TMPDIR %TEMPLATE_HEADERS
+ $ADD_TO_LINE $TMPDIR %TEMPLATE_HEADERS @COMMIT_HOSTS
$CHECK_HEADERS $LAST_FILE $PID $IDHEADER $UNEXPAND_RCSID);
@@ -41,6 +41,16 @@ $FILE_PREFIX = "#cvs.files.$PID";
# when processing a multi-directory commit.
$LAST_FILE = "$TMPDIR/$FILE_PREFIX.lastdir";
+###################
+### commitcheck ###
+###################
+
+# A list of hosts the it's ok to commit on. Useful if your committers
+# take local copies of the repository to work off-line.
+# (Empty if you don't want checks.)
+@COMMIT_HOSTS = ();
+
+
################
### logcheck ###
################
diff --git a/CVSROOT/cfg_local.pm b/CVSROOT/cfg_local.pm
index 38e3a5d232e4..0c0f83569289 100644
--- a/CVSROOT/cfg_local.pm
+++ b/CVSROOT/cfg_local.pm
@@ -41,6 +41,8 @@ if ($hostname =~ /^freefall\.freebsd\.org$/i) {
$MAILADDRS='cvs-committers@FreeBSD.org cvs-all@FreeBSD.org';
$MAILADDRS = 'cvs@FreeBSD.org' if $DEBUG;
+
+ @COMMIT_HOSTS = qw(freefall.freebsd.org);
}
diff --git a/CVSROOT/commitcheck b/CVSROOT/commitcheck
index aa7edbdbf06a..412bf1567cfa 100755
--- a/CVSROOT/commitcheck
+++ b/CVSROOT/commitcheck
@@ -10,6 +10,9 @@
#
use strict;
+use lib $ENV{CVSROOT};
+use CVSROOT::cfg;
+
my $CVSROOT = $ENV{CVSROOT} || die "Can't determine CVSROOT (commitcheck)!\n";
@@ -17,10 +20,13 @@ my $MINCVSVERSION = "1090900"; # 1.9.9p0
# Check that the user is committing on the right machine.
#
-use Sys::Hostname; # get hostname() function
+use Sys::Hostname;
my $hostname = hostname();
-if ($hostname !~ /^freefall.freebsd.org$/) {
- print "Please commit on Freefall!\n";
+if (@cfg::COMMIT_HOSTS && !grep(/^\Q$hostname\E$/i, @cfg::COMMIT_HOSTS)) {
+ print "Please don't commit on this host!\n";
+ print "Please commit on ",
+ join(" or ", @cfg::COMMIT_HOSTS),
+ " instead.\n";
exit 1;
}