summaryrefslogtreecommitdiffstats
path: root/CVSROOT
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1999-09-10 18:14:35 +0000
committerpeter <peter@FreeBSD.org>1999-09-10 18:14:35 +0000
commit68a4e6f81feb9c93ac692d3210c671c6e4d7777e (patch)
treec7363201716a82b2e02aa2c1b358dd421faac972 /CVSROOT
parentcac9d89385de962a7714c6946ba55298e5c3297a (diff)
downloadFreeBSD-ports-68a4e6f81feb9c93ac692d3210c671c6e4d7777e.zip
FreeBSD-ports-68a4e6f81feb9c93ac692d3210c671c6e4d7777e.tar.gz
Turn on the $FreeBSD$ checking for src/* and ports/*/Makefile.
I've relaxed it a lot in branch cases (ie: not -CURRENT): - version number checking is disabled to enable MFC style clobbers. - on src/contrib and src/crypto no $freeBSD$ is required at all. There is an override availble (but it'll send mail!) in case of problems. If the checks here screw up, set the environment variable CVSFUBAR and it'll bypass the checks entirely. Depending on your shell, that's "setenv CVSFUBAR yep", or "CVSFUBAR=yep; export CVSFUBAR" Please don't use this unless there is a genuine problem that can't wait.
Diffstat (limited to 'CVSROOT')
-rwxr-xr-xCVSROOT/commit_prep.pl44
1 files changed, 36 insertions, 8 deletions
diff --git a/CVSROOT/commit_prep.pl b/CVSROOT/commit_prep.pl
index 50599bd..4c4caee 100755
--- a/CVSROOT/commit_prep.pl
+++ b/CVSROOT/commit_prep.pl
@@ -49,8 +49,7 @@ $LAST_FILE = "/tmp/#cvs.files.lastdir";
$ENTRIES = "CVS/Entries";
$NoId = "
-%s - Does not contain a line with the keyword \"\$FreeBSD:\".
- Please see the template files for an example.\n";
+%s - Does not contain a line with the keyword \"\$FreeBSD:\".\n";
# Protect string from substitution by RCS.
$NoName = "
@@ -64,8 +63,8 @@ $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";
+ update to get the current version, and then CAREFULLY
+ merge your changes into that file.\n";
############################################################
#
@@ -82,7 +81,7 @@ sub write_line {
sub check_version {
local($i, $id, $rname, $version);
- local($filename, $directory, $cvsversion) = @_;
+ local($filename, $directory, $hastag, $cvsversion) = @_;
open(FILE, $filename) || die("Cannot open $filename, stopped");
for ($i = 1; $i < 30; $i++) {
@@ -98,6 +97,10 @@ sub check_version {
return(1);
}
+ # Ignore version mismatches (MFC spamming etc) on branches.
+ if ($hastag) {
+ return (0);
+ }
($id, $rname, $version) = split(' ', substr($line, $pos));
if ($cvsversion{$filename} == 0) {
if (index($line, "\$\FreeBSD: \$") == -1 &&
@@ -119,7 +122,7 @@ sub check_version {
}
if ($cvsversion{$filename} > $version) {
printf($BadVersion, $filename, $filename, $cvsversion{$filename},
- "older", $version, $filename);
+ "OLDER", $version, $filename);
return(1);
}
return(0);
@@ -140,13 +143,35 @@ $id = getpgrp();
#
open(ENTRIES, $ENTRIES) || die("Cannot open $ENTRIES.\n");
while (<ENTRIES>) {
- local($filename, $version) = split('/', substr($_, 1));
+ chop;
+ next if (/^D/);
+ local($filename, $version, $stamp, $opt, $tag) = split('/', substr($_, 1));
$cvsversion{$filename} = $version;
+ $cvstag{$filename} = $tag;
+ $stamp = $opt; #silence -w
}
+close(ENTRIES);
$directory = $ARGV[0];
shift @ARGV;
+if ($directory =~ /src\//) {
+ $check_id = 1;
+}
+if ($directory =~ /ports\//) {
+ $check_id = 2;
+}
+if ($directory =~ /src\/contrib\//) {
+ $check_id = 3;
+}
+if ($directory =~ /src\/crypto\//) {
+ $check_id = 3;
+}
+if ($check_id != 0 && $ENV{'CVSFUBAR'}) {
+ $check_id = 0;
+ print "CVS VERSION CHECK BYPASSED!\n";
+ system("ps -xww | mail -s 'version check override used' cvs");
+}
#
# Now check each file name passed in, except for dot files. Dot files
# are considered to be administrative files by this script.
@@ -154,8 +179,11 @@ shift @ARGV;
if ($check_id != 0) {
$failed = 0;
foreach $arg (@ARGV) {
+ local($hastag) = ($cvstag{$arg} ne '');
next if (index($arg, ".") == 0);
- $failed += &check_version($arg, $directory, $cvsversion);
+ next if ($check_id == 2 && $arg ne "Makefile");
+ next if ($check_id == 3 && $hastag);
+ $failed += &check_version($arg, $directory, $hastag, $cvsversion);
}
if ($failed) {
print "\n";
OpenPOWER on IntegriCloud