#! /usr/bin/perl -w # # $FreeBSD$ # # This hack is to sanitise the results of what the user may have # "done" while editing the commit log message.. :-) Peter Wemm. # # Note: this uses an enhancement to cvs's verifymsg functionality. # Normally, the check is advisory only, the FreeBSD version reads # back the file after the verifymsg file so that this script can # make changes. # use strict; use lib $ENV{CVSROOT}; use CVSROOT::cfg; ############################################################# # # Main Body # ############################################################ my $filename = shift; die "Usage: logcheck filename\n" unless $filename; # Read the log file in, stripping 'CVS:' lines and removing trailing # white spaces. open IN, "< $filename" or die "logcheck: Cannot open for reading: $filename: $!\n"; my @log_in = map { s/^(.*?)\s*$/$1/; $1 } grep { !/^CVS:/ } ; close IN; # Remove duplicate blank lines. my $i = 0; while ($i < scalar(@log_in) - 1) { if ($log_in[$i] eq "" && $log_in[$i + 1] eq "") { splice(@log_in, $i, 1); next; } ++$i; } # Remove leading and trailing blank lines. (There will be at most # one because of the duplicate removal above). shift @log_in if $log_in[0] eq ""; pop @log_in if $log_in[-1] eq ""; # Scan through the commit message looking for templated headers # as defined in the configuration file, and rcstemplate. # Assume that these only exist in the last paragraph. # Filter out blank entries, and type check if necessary. my $j = $#log_in; # The index of the last entry in the commit msg. my $error = 0; while ($j >= 0) { my $logline = $log_in[$j]; --$j; # Hitting a blank line means that we've seen all of the last paragraph. last if $logline eq ""; unless ($logline =~ /^(.*?):\s*(.*)$/) { ### XXX # We're here because we saw a line that didn't match # a template header (no ':'). This could be a continuation # line from the previous header, or the log message proper. # We don't know, so run the risk of checking the last paragraph # of the log message for headers. next; } my $header = $1; my $value = $2; my $pattern = $cfg::TEMPLATE_HEADERS{$header}; # Ignore unrecognised headers. unless (defined($pattern)) { ### print "Warning: unknown template header: $header\n"; next; } # Filter out the template header if it's blank. if ($value eq "") { splice(@log_in, $j + 1, 1); next; } # Type check the header unless ($value =~ /^$pattern$/) { print "Error: $header: should match '$pattern'.\n"; ++$error; next; } } # Make sure that there is some content in the log message. # XXX Note that logcheck isn't evoked if the log message is # completely empty. This is a bug in cvs. my $log = "@log_in"; die "Log message contains no content!\n" if $log =~ /^\s*$/; # Write the modified log file back out. my $tmpfile = $filename . "tmp"; open OUT, "> $tmpfile" or die "logcheck: Cannot open for writing: $tmpfile: $!\n"; print OUT map { "$_\n" } @log_in; close OUT; # Stop the commit if there was a problem with the template headers. if ($error) { print "There were $error errors in the template headers.\n"; print "Please fix the log message and commit again.\n"; print "A copy of your log message was saved in $tmpfile.\n"; exit 1; } # Nuke likely editor backups. unlink "$filename.~"; unlink "$filename.bak"; # Overwrite the log message with our sanitised one. (See the comment # block at the top of this script for an explaination of why.) rename($tmpfile, $filename) or die "logcheck: Could not rename $tmpfile to $filename: $!"; exit 0; h-4.17.19 FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)
aboutsummaryrefslogtreecommitdiffstats
path: root/games
Commit message (Expand)AuthorAgeFilesLines
* - Convert USE_GMAKE to USESamdmi32014-01-291-4/+1
* - Convert USE_GMAKE to USESamdmi32014-01-291-7/+3
* -Add forget Bump PORTREVISION for dependency changenemysis2014-01-292-0/+2
* - Fix graphics/glfw2 dependency due to recent commitnemysis2014-01-292-2/+2
* - Bring back hosted directory for games to be placed intoamdmi32014-01-281-0/+4
* Simon Tatham's Portable Puzzle Collection is a set of popular puzzleamdmi32014-01-284-0/+73
* - Update to 0.4.9.3amdmi32014-01-285-11/+17
* - Update to 2.0.1amdmi32014-01-287-110/+27
* Deprecate ports broken for more than 6 monthbapt2014-01-281-0/+2
* - Stagifydecke2014-01-281-3/+4
* - Stagifydecke2014-01-282-15/+14
* - Stagifydecke2014-01-282-11/+10
* - Update to 1.1.1madpilot2014-01-274-32/+4
* - Bump PORTREVISIONnemysis2014-01-274-11/+17
* games/opensonic:makc2014-01-274-41/+30
* - Switch to OPTIONS_MULTI [1]ak2014-01-261-37/+14
* games/armagetron: Update to version 0.2.8.3.2 and support stage.marino2014-01-2610-149/+30
* - Mark DEPRECATED, set EXPIRATION_DATE for deps of deprecated pysolnemysis2014-01-262-0/+6
* - Mark DEPRECATED, set EXPIRATION_DATEnemysis2014-01-261-0/+3
* Switch to use lua 5.2bapt2014-01-261-4/+4
* Enable stage supportjohans2014-01-263-12/+98
* - Fix the build on 10 and beyond.rakuco2014-01-262-2/+2
* Add missing build dependencyjohans2014-01-261-0/+1
* - Update MASTER_SITES and WWW: linemiwi2014-01-267-90/+69
* - Fix buildmiwi2014-01-262-10/+66
* - Bump PORTREVISIONnemysis2014-01-252-28/+15
* - Update to 6.02.00eadler2014-01-253-4854/+6605
* - Mark DEPRECATED, set EXPIRATION_DATEnemysis2014-01-241-0/+3
* - Update to 2.0.21nemysis2014-01-232-4/+5
* Fix properties on pkg-plistbapt2014-01-2211-11/+0
* - Change REINPLACE_CMD, make PREFIX safenemysis2014-01-201-3/+3
* - Support stagingamdmi32014-01-201-16/+13
* - Change Makefile headernemysis2014-01-202-6/+22
* - Change Desktop entry filenemysis2014-01-201-7/+11
* - Update from 2.5.0.0 to 2.6.0.0danilo2014-01-203-34/+32
* games/nsnake: games/nsnake: fix permissions and fix score filemarino2014-01-202-9/+16
* Mark IGNORE on < 9.1amdmi32014-01-201-0/+6
* - FIx build with clangmiwi2014-01-193-9/+19
* Add forgotten WWW update on previous commit.bar2014-01-191-1/+1
* - Fix build with clangmiwi2014-01-195-6/+54
* - Support STAGEDIRbar2014-01-193-15/+13
* - Update to 0.831bar2014-01-193-496/+161
* - Update to version 1.4.1.18mva2014-01-194-12/+9
* - Bump PORTREVISIONnemysis2014-01-195-207/+211
* Fix `make fetch' after r339985.rakuco2014-01-191-1/+1
* Remove reference to NOPORTDATAbapt2014-01-181-16/+4
* - Update from 1.13 to 1.14danilo2014-01-182-3/+6
* - Update to 1.3.2amdmi32014-01-184-99/+35
* - Enable stagedir supportmva2014-01-182-3029/+11
* - Do not remove the bin/rt2_demo symlink twicemva2014-01-181-1/+0
* - Enable stagedir supportmva2014-01-183-10/+11
* - Set EXTRACT_SUFX and dismiss USE_ZIPdanfe2014-01-181-23/+20
* - Enable stagedir supportmva2014-01-1812-98/+80
* - Convert deprecated +DOS2UNIX_FILES to USES= dos2unix and stagifydanfe2014-01-181-20/+22
* I'll take it.cs2014-01-171-1/+1
* - Follow upstream and rename games/deng to doomsdaymakc2014-01-1711-99/+159
* - enable stagedir supportmva2014-01-171-7/+6
* - Add master site SFnemysis2014-01-164-33/+35
* - Change master sitesnemysis2014-01-162-7/+20
* games/exult: Update to latest 1.5.x snapshot (Unbreaks F10+)marino2014-01-1612-127/+60
* - Back to the poolgahr2014-01-161-1/+1
* - Set EXTRACT_SUFX and dismiss USE_ZIPdanfe2014-01-162-6/+2
* - Update to 0.9.2nemysis2014-01-164-31/+54
* - Fix installamdmi32014-01-161-1/+1
* - Unbreakantoine2014-01-1610-14/+256
* - Update to 1.14-1nemysis2014-01-163-10/+11
* - Disable all warnings with -wnemysis2014-01-161-4/+10
* - Update to 2.0.20nemysis2014-01-154-27/+11
* Use vendor's installation logic for the game libraries, it works fine.danfe2014-01-152-46/+0
* Remove debugging left-over that crept in.danfe2014-01-151-9/+0
* - Unbreak the build with Clang and remove disgusting USE_GCC knobdanfe2014-01-156-20/+115
* - Bump PORTREVISIONnemysis2014-01-153-23/+34
* Economic development in the land of the balls has rendered communism annemysis2014-01-156-0/+149
* - Change master sitesnemysis2014-01-152-8/+6
* - Change Desktop entry filenemysis2014-01-152-6/+12
* - Change master sitesnemysis2014-01-143-19/+18
* - Fix symlink for the iconnemysis2014-01-141-1/+1
* games/py-fife: Update to 0.3.5, fix make packagekoobs2014-01-144-29/+39
* The engine solves sudokus by applying complex logical rules a few times,nemysis2014-01-147-0/+213
* - Change Desktop entry filenemysis2014-01-141-13/+11
* - Change Desktop entry filenemysis2014-01-141-14/+11
* - USES dos2unix and DOS2UNIX_FILES instead of USE_DOS2UNIXnemysis2014-01-142-16/+16
* Python cleanup:rene2014-01-1422-22/+22
* - Support STAGEDIRnemysis2014-01-141-14/+5
* - Change Makefile headernemysis2014-01-145-30/+60
* - Beta is too unstable, rollback to latest stable versionamdmi32014-01-136-78/+11
* - Support stagingamdmi32014-01-132-124/+17
* - Support stagingamdmi32014-01-131-17/+13
* - Update to 0.4.9amdmi32014-01-132-5/+10
* - Update to 0.4.9amdmi32014-01-132-4/+4
* - Fix build on recent FreeBSD (10, 11)martymac2014-01-1328-1862/+1846
* archivers/xz is in base for all versions and has been removed from the ports ...bapt2014-01-131-4/+0
* PolyGlot is a "UCI adapter". It connects a UCI chess engine to annivit2014-01-139-0/+96
* - Use automatic plist generationamdmi32014-01-132-159/+18
* - USES dos2unix and DOS2UNIX_FILES instead of USE_DOS2UNIXnemysis2014-01-139-43/+42
* - Change Desktop entry filenemysis2014-01-132-16/+16
* - Update to 0.9.20.5amdmi32014-01-134-32/+15
* - Support stage directorybar2014-01-132-38/+22
* - Update to 1.2.0tota2014-01-122-12/+12
* - Change Desktop entry filenemysis2014-01-111-13/+12
* - Use BROKEN_sparc64 and avoid <bsd.port.pre.mk>johans2014-01-111-6/+4
* - Add LICENSEamdmi32014-01-111-0/+2
* - Add LICENSEamdmi32014-01-111-0/+2
* - Update xboard to 4.7.3 (bugfix release)johans2014-01-112-34/+12
* - Change Desktop entry filenemysis2014-01-102-23/+18