summaryrefslogtreecommitdiffstats
path: root/CVSROOT
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2001-11-15 12:35:33 +0000
committerjoe <joe@FreeBSD.org>2001-11-15 12:35:33 +0000
commit58e7d63643c07c23319ebe79c89e9652f890a6a5 (patch)
tree16765977a13ecb91d01d9a09649b968f32be6446 /CVSROOT
parent3795775ad7428efb3a05f3b3f8d6d13ed26e9034 (diff)
downloadFreeBSD-ports-58e7d63643c07c23319ebe79c89e9652f890a6a5.zip
FreeBSD-ports-58e7d63643c07c23319ebe79c89e9652f890a6a5.tar.gz
Add a new configuration option: COMMITCHECK_EXTRA. This is a
reference to an anonymous subroutine that if defined gets run at commitcheck time. It allows the admin to run further checks to see whether committing is allowed.
Diffstat (limited to 'CVSROOT')
-rwxr-xr-xCVSROOT/cfg.pm14
-rwxr-xr-xCVSROOT/commitcheck11
2 files changed, 21 insertions, 4 deletions
diff --git a/CVSROOT/cfg.pm b/CVSROOT/cfg.pm
index 705f7f4..eabc2bc 100755
--- a/CVSROOT/cfg.pm
+++ b/CVSROOT/cfg.pm
@@ -14,10 +14,11 @@
package cfg;
use strict;
use vars qw(
- $ADD_TO_LINE $CHECK_HEADERS $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 $TMPDIR $UNEXPAND_RCSID %TEMPLATE_HEADERS @COMMIT_HOSTS
+ $ADD_TO_LINE $CHECK_HEADERS $COMMITCHECK_EXTRA $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 $TMPDIR $UNEXPAND_RCSID %TEMPLATE_HEADERS
+ @COMMIT_HOSTS
);
my $CVSROOT = $ENV{'CVSROOT'} || die "Can't determine \$CVSROOT!";
@@ -62,6 +63,11 @@ $PROG_MV = '/bin/mv'; # mv(1)
# The minimum version of cvs that we will work with.
$MINCVSVERSION = "1090900"; # 1.9.9p0
+# Additional commit time checks. This is an anonymous subroutine
+# that gets called early on in the validation process to see whether
+# the committer is allowed to commit.
+$COMMITCHECK_EXTRA = "";
+
################
### logcheck ###
diff --git a/CVSROOT/commitcheck b/CVSROOT/commitcheck
index aa58ef3..65e0bc9 100755
--- a/CVSROOT/commitcheck
+++ b/CVSROOT/commitcheck
@@ -26,6 +26,7 @@ if (@cfg::COMMIT_HOSTS && !grep(/^\Q$hostname\E$/i, @cfg::COMMIT_HOSTS)) {
exit 1;
}
+
# Sanity check to make sure we've been run through the wrapper and are
# now primary group 'ncvs'.
#
@@ -36,6 +37,16 @@ unless ( $GRP =~ /^ncvs$/ ) {
exit 1;
}
+
+# Run locally defined extra commitchecks.
+if (defined($cfg::COMMITCHECK_EXTRA) && $cfg::COMMITCHECK_EXTRA) {
+ die 'commitcheck: $cfg::COMMITCHECK_EXTRA isn\'t a sub!'
+ unless ref($cfg::COMMITCHECK_EXTRA) eq "CODE";
+
+ die "Failed commitcheck_extra\n" unless &$cfg::COMMITCHECK_EXTRA();
+}
+
+
#
# Ensure the minimum version of cvs is installed.
#
OpenPOWER on IntegriCloud