From 2da6ded55b060893089c21ca0f61fa8c2a76a5a2 Mon Sep 17 00:00:00 2001 From: peter Date: Sat, 28 Aug 1999 05:18:55 +0000 Subject: First stage of updates to check for a $FreeBSD$ tag prior to allowing a commit. Not yet active. --- CVSROOT/commit_prep.pl | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/CVSROOT/commit_prep.pl b/CVSROOT/commit_prep.pl index 5d5beeeb57e6..50599bdcb93c 100755 --- a/CVSROOT/commit_prep.pl +++ b/CVSROOT/commit_prep.pl @@ -31,7 +31,7 @@ require 5.003; # to be sure. log_accum needs perl5 # ############################################################ # -# Check each file (except dot files) for an RCS "Id" keyword. +# Check each file (except dot files) for an RCS "FreeBSD" keyword. # $check_id = 0; @@ -49,12 +49,12 @@ $LAST_FILE = "/tmp/#cvs.files.lastdir"; $ENTRIES = "CVS/Entries"; $NoId = " -%s - Does not contain a line with the keyword \"Id:\". +%s - Does not contain a line with the keyword \"\$FreeBSD:\". 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"; +%s - The ID line should contain only \"\$\FreeBSD\$\" for a newly created file.\n"; $BadName = " %s - The file name '%s' in the ID line does not match @@ -82,14 +82,14 @@ sub write_line { sub check_version { local($i, $id, $rname, $version); - local($filename, $cvsversion) = @_; + local($filename, $directory, $cvsversion) = @_; open(FILE, $filename) || die("Cannot open $filename, stopped"); - for ($i = 1; $i < 10; $i++) { + for ($i = 1; $i < 30; $i++) { $pos = -1; last if eof(FILE); $line = ; - $pos = index($line, "Id: "); + $pos = index($line, "\$\FreeBSD"); last if ($pos >= 0); } @@ -100,14 +100,15 @@ sub check_version { ($id, $rname, $version) = split(' ', substr($line, $pos)); if ($cvsversion{$filename} == 0) { - if ($rname ne "\$") { + if (index($line, "\$\FreeBSD: \$") == -1 && + index($line, "\$\FreeBSD\$") == -1) { printf($NoName, $filename); return(1); } return(0); } - if ($rname ne "$filename,v") { + if ($rname ne "$directory/$filename,v") { printf($BadName, $filename, substr($rname, 0, length($rname)-2)); return(1); } @@ -154,7 +155,7 @@ if ($check_id != 0) { $failed = 0; foreach $arg (@ARGV) { next if (index($arg, ".") == 0); - $failed += &check_version($arg); + $failed += &check_version($arg, $directory, $cvsversion); } if ($failed) { print "\n"; -- cgit 4/files/minimist-1.2.2 FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)
aboutsummaryrefslogtreecommitdiffstats
Commit message (Expand)AuthorAgeFilesLines
* MASTER_SITES cleanup.mat2015-05-14