diff options
author | joe <joe@FreeBSD.org> | 2001-05-20 18:30:57 +0800 |
---|---|---|
committer | joe <joe@FreeBSD.org> | 2001-05-20 18:30:57 +0800 |
commit | 2e200bfc547d77db4b7b90fd22fd8a302c7eab08 (patch) | |
tree | 3beaa11534d6dd214cdc53e8b2e5d527127ad5b4 /CVSROOT/cfg.pm | |
parent | e7425acbb873bce800c175c443467655d59a052f (diff) | |
download | freebsd-ports-gnome-2e200bfc547d77db4b7b90fd22fd8a302c7eab08.tar.gz freebsd-ports-gnome-2e200bfc547d77db4b7b90fd22fd8a302c7eab08.tar.zst freebsd-ports-gnome-2e200bfc547d77db4b7b90fd22fd8a302c7eab08.zip |
Add a configuration file for customising the perl scripts. To use
it put the following at the top of the perl script:
use lib $ENV{CVSROOT};
use CVSROOT::cfg;
The config variables can then be referenced from the script by
refering to them in the cfg package space, i.e. $cfg::TEMPLATE_HEADER.
The choice was taken to write it in perl, instead of plain text,
because it saves extra code in each script to parse the file, and
additionally it allows the user extra flexibility enabling the user
to create a dynamic configuration file that depends upon the host
it's running on, for instance.
Please read the warning in the file about making sure that it passes
the perl syntax check (perl -c) before commiting updates to it.
Diffstat (limited to 'CVSROOT/cfg.pm')
-rwxr-xr-x | CVSROOT/cfg.pm | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/CVSROOT/cfg.pm b/CVSROOT/cfg.pm new file mode 100755 index 000000000000..373aa1f41bc6 --- /dev/null +++ b/CVSROOT/cfg.pm @@ -0,0 +1,43 @@ +# $FreeBSD$ + +#################################################################### +#################################################################### +# This file contains configuration for the CVSROOT perl scripts. +# WARNING: You are strongly adviced to check for syntax errors +# in this file before committing it. Use: perl -c cfg.pm +#################################################################### +#################################################################### + +package cfg; +use strict; +use vars qw(%TEMPLATE_HEADERS); + + +############################################################ +# +# Configurable options +# +############################################################ + + +################ +### logcheck ### +################ + +# These are the optional headers that can be filled at the end of +# each commit message. The associated value is a regular-expression +# that is used to type-check the entered value. If a match fails +# then the commit is rejected. (See rcstemplate). +# +# Make sure that these are also described in the rcstemplate to +# make their usage clear to committers. +%TEMPLATE_HEADERS = ( + "Reviewed by" => '.*', + "Submitted by" => '.*', + "Obtained from" => '.*', + "Approved by" => '.*', + "PR" => '.*', + "MFC after" => '\d+(\s+(days?|weeks?|months?))?' +); + +#end |