spackle-changes Mailing List for Spackle - CVS ACLs and Utilities
Status: Beta
Brought to you by:
coar
You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(5) |
Oct
(4) |
Nov
(36) |
Dec
(1) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(4) |
Feb
(5) |
Mar
(22) |
Apr
(2) |
May
(2) |
Jun
|
Jul
(2) |
Aug
(32) |
Sep
(3) |
Oct
|
Nov
|
Dec
(25) |
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2004 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Ken C. <co...@us...> - 2004-03-04 23:00:16
|
coar 04/03/04 14:38:47 Modified: . spackled.in Log: turn commentary into comments so the file is runnable Revision Changes Path 1.6 +14 -13 spackle/spackled.in Index: spackled.in =================================================================== RCS file: /cvsroot/spackle/spackle/spackled.in,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- spackled.in 11 Mar 2002 19:27:53 -0000 1.5 +++ spackled.in 4 Mar 2004 22:38:40 -0000 1.6 @@ -1,13 +1,14 @@ -Spackle version @PACKAGE_VERSION@ -@configure_input@ - -Configured at @CONFIGURED_AT@ with - Access control: @ENABLE_ACLS@ - Logging features: @ENABLE_LOGGING@ - Maintainer: @MAINTAINER@ - Maintainer email: @MAINTAINER_EMAIL@ - -Command line: - @CONFIGURE_CMDLINE@ - -See <URL:http://Spackle.SourceForge.Net/> for more info. +# Spackle version @PACKAGE_VERSION@ +# @configure_input@ +# +# Configured at @CONFIGURED_AT@ with +# Access control: @ENABLE_ACLS@ +# Logging features: @ENABLE_LOGGING@ +# Maintainer: @MAINTAINER@ +# Maintainer email: @MAINTAINER_EMAIL@ +# +# Command line: +# + @CONFIGURE_CMDLINE@ +# +# See <URL:http://Spackle.SourceForge.Net/> for more info. |
|
From: Ken C. <co...@us...> - 2003-10-30 13:15:19
|
coar 03/10/30 05:15:18
Modified: . SpackleConf.pm.in
Log:
Add a new flag, and clean up Boolean processing a bit
Revision Changes Path
1.8 +14 -10 spackle/SpackleConf.pm.in
Index: SpackleConf.pm.in
===================================================================
RCS file: /cvsroot/spackle/spackle/SpackleConf.pm.in,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- SpackleConf.pm.in 18 Dec 2002 11:34:22 -0000 1.7
+++ SpackleConf.pm.in 30 Oct 2003 13:15:16 -0000 1.8
@@ -1,7 +1,7 @@
package SpackleConf;
#
-# $Id: SpackleConf.pm.in,v 1.7 2002/12/18 11:34:22 coar Exp $
+# $Id: SpackleConf.pm.in,v 1.8 2003/10/30 13:15:16 coar Exp $
#
# Copyright (c) 2002 by Ken A L Coar. All rights reserved.
#
@@ -16,11 +16,11 @@
#
use strict;
-use vars qw($VERSION $REVISION $REVNUM);
+use vars qw($VERSION $REVISION $REVNUM @TRUEVALS @BOOLEAN_PARAMS);
use Carp;
$VERSION = '@PACKAGE_VERSION@';
-$REVISION = '$Id: SpackleConf.pm.in,v 1.7 2002/12/18 11:34:22 coar Exp $';
+$REVISION = '$Id: SpackleConf.pm.in,v 1.8 2003/10/30 13:15:16 coar Exp $';
($REVNUM = $REVISION) =~ s/.*,v\s+(\d+\.\d+)\s+.*/$1/;
#
@@ -33,7 +33,8 @@
);
my %canonical_configs = map { lc($_) => $_ } @canonical_configs;
-my @canonical_params = ('Enable_ACLs',
+my @canonical_params = ('AllowCommitWithoutEmail',
+ 'Enable_ACLs',
'Enable_Logging',
'Enable_passwd',
'Enable_readers',
@@ -54,11 +55,13 @@
#
# Normalise Boolean keywords into an integer value.
#
-my $TRUEVALS = qr/^(?:1|Yes|On|True)$/;
+@TRUEVALS = (1, 'Yes', 'On', 'True');
+my $TRUEVALS = join('|', @TRUEVALS);
+$TRUEVALS = qr/^(?:$TRUEVALS)$/;
sub _boolean {
my ($val) = @_;
- return ($val =~ /$TRUEVALS/i) ? 1 : 0;
+ return ((! defined($val)) || ($val !~ /$TRUEVALS/i)) ? 0 : 1;
}
#
@@ -401,7 +404,10 @@
=cut
-my $BOOLEANS = qr§^(?:Debug|ENABLE_\w*|ReadOnly)$§;
+@BOOLEAN_PARAMS = ('AllowCommitWithoutEmail', 'Debug',
+ 'Enable_\w+', 'ReadOnly');
+my $BOOLEANS = join('|', @BOOLEAN_PARAMS);
+$BOOLEANS = qr§^(?:$BOOLEANS)$§;
sub param {
my $self = shift;
@@ -421,9 +427,7 @@
# write this stuff back to disk.
#
if ($key =~ /$BOOLEANS/i) {
- if ($curval) {
- $curval = _boolean($curval);
- }
+ $curval = _boolean($curval);
if ($value) {
$value = _boolean($value) ? 'On' : 'Off';
}
|
|
From: Ken C. <co...@us...> - 2002-12-18 11:35:34
|
coar 02/12/18 03:35:34 Modified: test_00 spackle.conf Log: working up more new tests Revision Changes Path 1.2 +3 -3 spackle/test_00/spackle.conf Index: spackle.conf =================================================================== RCS file: /cvsroot/spackle/spackle/test_00/spackle.conf,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- spackle.conf 17 Dec 2002 22:30:47 -0000 1.1 +++ spackle.conf 18 Dec 2002 11:35:33 -0000 1.2 @@ -1,6 +1,6 @@ # # Spackle configuration file -# $Id: spackle.conf,v 1.1 2002/12/17 22:30:47 coar Exp $ +# $Id: spackle.conf,v 1.2 2002/12/18 11:35:33 coar Exp $ # Originally Generated automatically from spackle.conf.in by configure. # Edit to tailor your settings. # @@ -38,8 +38,8 @@ # # Settings initially defined by ./configure # -MAINTAINER = coar -MAINTAINER_EMAIL = Ken...@Go... +MAINTAINER = Guru Person +MAINTAINER_EMAIL = Mr_...@Ex... # # Major functions |
|
From: Ken C. <co...@us...> - 2002-12-18 11:35:34
|
coar 02/12/18 03:35:33
Added: t config.t
Log:
working up more new tests
Revision Changes Path
1.1 spackle/t/config.t
Index: config.t
===================================================================
#
# $id$
#
# Verify that the SpackleConf configuration methods work as expected.
#
use strict;
use Test::More(tests => 9); # Branch-tag insertion
my @expected; # Array of expected results per sequence
my $testnum = 1;
my $subtest;
my $cvsroot = './test_00';
use lib './test_00';
use SpackleConf;
my $sc = new SpackleConf($cvsroot);
#
# Pairs of test data: expected value, and description of test
#
#
# First test: SpackleConf::config() fetch, set, and known-only.
#
@expected = (
'', # 1
'config("automerge")',
'1', # 2
'config("automerge", 1) ; config("automerge")',
'', # 3
'config("strict")',
'1', # 4
'config("strict", 1) ; config("strict")',
'', # 5
'config("undefined")',
'', # 6
'config("undefined", 1) ; config("undefined")',
'1', # 7
'config("strict", 0) ; config("undefined", 1) ; config("undefined")',
);
my $cfgvalue;
#
# What's the default setting of the 'automerge' flag?
#
$cfgvalue = $sc->config('automerge') || '';
is($cfgvalue, $expected[$subtest++], $expected[$subtest++]);
#
# How about setting it and examining it afterward?
#
$sc->config('automerge', 1);
$cfgvalue = $sc->config('automerge') || '';
is($cfgvalue, $expected[$subtest++], $expected[$subtest++]);
#
# Repeat for the 'strict' flag.
#
$cfgvalue = $sc->config('strict') || '';
is($cfgvalue, $expected[$subtest++], $expected[$subtest++]);
$sc->config('strict', 1);
$cfgvalue = $sc->config('strict') || '';
is($cfgvalue, $expected[$subtest++], $expected[$subtest++]);
#
# Note that this should leave 'strict' set.
#
#
# Now work with a custom flag (non-canonical). Value for
# such before being defined should be, well, undefined.
#
$cfgvalue = $sc->config('undefined') || '';
is($cfgvalue, $expected[$subtest++], $expected[$subtest++]);
#
# Try to set it; remember, 'strict' is enabled.
#
$sc->config('undefined', 1);
$cfgvalue = $sc->config('undefined') || '';
is($cfgvalue, $expected[$subtest++], $expected[$subtest++]);
#
# Relax the restrictions and try it again.
#
$sc->config('strict', 0);
$sc->config('undefined', 1);
$cfgvalue = $sc->config('undefined') || '';
is($cfgvalue, $expected[$subtest++], $expected[$subtest++]);
#
# So much for SpackleConf::config(). Let's move on to SpackleConf::param().
#
my $paramvalue;
push(@expected, ('Mr_...@Ex...',
'param("Maintainer_EMail")',
'',
'param("undefined")',
));
#
# Check a known value.
#
$paramvalue = $sc->param('Maintainer_EMail') || '';
is($paramvalue, $expected[$subtest++], $expected[$subtest++]);
#
# Check an unknown value.
#
$paramvalue = $sc->param('undefined') || '';
is($paramvalue, $expected[$subtest++], $expected[$subtest++]);
|
|
From: Ken C. <co...@us...> - 2002-12-18 11:35:34
|
coar 02/12/18 03:35:33
Modified: . runtests.pl.in
Log:
working up more new tests
Revision Changes Path
1.2 +6 -1 spackle/runtests.pl.in
Index: runtests.pl.in
===================================================================
RCS file: /cvsroot/spackle/spackle/runtests.pl.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- runtests.pl.in 17 Dec 2002 22:31:29 -0000 1.1
+++ runtests.pl.in 18 Dec 2002 11:35:33 -0000 1.2
@@ -9,5 +9,10 @@
use Test::Harness;
+my @tests = ('t/config.t',
+ 't/per-module.t',
+ 't/branch-log.t',
+ 't/mailmap.t',
+ );
$Test::Harness::verbose = defined($ENV{'SPACKLE_TEST_VERBOSE'}) || 0;
-runtests('t/per-module.t', 't/mailmap.t', 't/branch-log.t');
+runtests(@tests);
|
|
From: Ken C. <co...@us...> - 2002-12-18 11:34:57
|
coar 02/12/18 03:34:56
Modified: . configure.in
Log:
don't need a shebang line, so don't need to be generated by configure
Revision Changes Path
1.20 +2 -2 spackle/configure.in
Index: configure.in
===================================================================
RCS file: /cvsroot/spackle/spackle/configure.in,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- configure.in 17 Dec 2002 22:32:38 -0000 1.19
+++ configure.in 18 Dec 2002 11:34:56 -0000 1.20
@@ -1,5 +1,5 @@
#
-# $Id: configure.in,v 1.19 2002/12/17 22:32:38 coar Exp $
+# $Id: configure.in,v 1.20 2002/12/18 11:34:56 coar Exp $
#
# Copyright (c) 2002 by Ken A L Coar. All rights reserved.
#
@@ -485,7 +485,7 @@
avail config mailmap passwd spackled spackle.conf
commitcheck.sh commit_prep.pl cvs_acls.pl cvsedit.pl log_accum.pl
checkoutlist commitinfo editinfo loginfo
- runtests.pl t/per-module.t t/mailmap.t t/branch-log.t)
+ runtests.pl)
#
# All done, say what we did.
|
|
From: Ken C. <co...@us...> - 2002-12-18 11:34:23
|
coar 02/12/18 03:34:22
Modified: . SpackleConf.pm.in
Log:
apply "strict" to config settings, too
Revision Changes Path
1.7 +11 -7 spackle/SpackleConf.pm.in
Index: SpackleConf.pm.in
===================================================================
RCS file: /cvsroot/spackle/spackle/SpackleConf.pm.in,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- SpackleConf.pm.in 17 Dec 2002 22:29:49 -0000 1.6
+++ SpackleConf.pm.in 18 Dec 2002 11:34:22 -0000 1.7
@@ -1,7 +1,7 @@
package SpackleConf;
#
-# $Id: SpackleConf.pm.in,v 1.6 2002/12/17 22:29:49 coar Exp $
+# $Id: SpackleConf.pm.in,v 1.7 2002/12/18 11:34:22 coar Exp $
#
# Copyright (c) 2002 by Ken A L Coar. All rights reserved.
#
@@ -20,7 +20,7 @@
use Carp;
$VERSION = '@PACKAGE_VERSION@';
-$REVISION = '$Id: SpackleConf.pm.in,v 1.6 2002/12/17 22:29:49 coar Exp $';
+$REVISION = '$Id: SpackleConf.pm.in,v 1.7 2002/12/18 11:34:22 coar Exp $';
($REVNUM = $REVISION) =~ s/.*,v\s+(\d+\.\d+)\s+.*/$1/;
#
@@ -28,6 +28,11 @@
# prettier reporting. (The same hash can be used for validity
# checking.)
#
+my @canonical_configs = ('automerge',
+ 'strict'
+ );
+my %canonical_configs = map { lc($_) => $_ } @canonical_configs;
+
my @canonical_params = ('Enable_ACLs',
'Enable_Logging',
'Enable_passwd',
@@ -40,10 +45,7 @@
'PatchThreshold',
'Subject_Prefix'
);
-my %canonical_params;
-for (@canonical_params) {
- $canonical_params{lc($_)} = $_;
-}
+my %canonical_params = map { lc($_) => $_ } @canonical_params;
#
# Some internal-use-only functions. Public methods get PODded below.
@@ -322,7 +324,9 @@
my $exists = defined($self->{_config}->{$key});
my $curval = $exists ? $self->{_config}->{$key} : undef;
if ($#_ > 0) {
- $self->{_config}->{$key} = $newval;
+ if ($canonical_configs{$key} || (! $self->{_config}->{'strict'})) {
+ $self->{_config}->{$key} = $newval;
+ }
}
return $curval;
}
|
|
From: Ken C. <co...@us...> - 2002-12-18 11:33:41
|
coar 02/12/18 03:33:40
Added: t branch-log.t mailmap.t per-module.t
Removed: t branch-log.t.in mailmap.t.in per-module.t.in
Log:
don't need a shebang line, so don't need to be generated by configure
Revision Changes Path
1.1 spackle/t/branch-log.t
Index: branch-log.t
===================================================================
#
# $id$
#
# Run tests of the SpackleConf.pm module and other aspects of the
# package.
#
use strict;
use Test::More(tests => (3 * 2)); # Branch-tag insertion
my @expected; # Array of expected results per sequence
my $testnum = 1;
my $subtest;
my $modnum = 0;
my $modname;
my $cvsroot = './test_00';
use lib './test_00';
use SpackleConf;
my $sc = new SpackleConf($cvsroot);
#
# First section: test the per-module parameter processing in the
# spackle.conf file.
#
my $subject_prefix;
#
# Test branch-tag subject insertion
#
$modnum = 3;
#
# List of pairs: expected results, explanation
#
@expected = ('[no branch] cvs commit: testmodule03',
'No branch effector, no tag',
'[no branch] cvs commit: testmodule03',
'No branch effector, tag',
'[prefix with tag: ] cvs commit: testmodule04',
'Simple branch effector, no tag',
'[prefix with tag: BRANCH] cvs commit: testmodule04',
'Simple branch effector, tag',
'[prefix] cvs commit: testmodule05',
'Complex branch effector, no tag',
'[prefix with tag] cvs commit: testmodule05',
'Complex branch effector, tag',
);
$subtest = 0;
for my $i (0..2) {
$modname = sprintf('testmodule%02d', $modnum + $i);
$subject_prefix = $sc->mail_subject($modname, '') || '';
is($subject_prefix, $expected[$subtest++], $expected[$subtest++]);
$testnum++;
$subject_prefix = $sc->mail_subject($modname, 'BRANCH') || '';
is($subject_prefix, $expected[$subtest++], $expected[$subtest++]);
$testnum++;
}
1.1 spackle/t/mailmap.t
Index: mailmap.t
===================================================================
#
# $id$
#
# Run tests of the SpackleConf.pm module and other aspects of the
# package.
#
use strict;
use Test::More(tests => (3 * 2)); # Branch-tag insertion
my @expected; # Array of expected results per sequence
my $testnum = 1;
my $subtest;
my $modnum = 0;
my $modname;
my $cvsroot = './test_00';
use lib './test_00';
use SpackleConf;
my $sc = new SpackleConf($cvsroot);
#
# First section: test the per-module parameter processing in the
# spackle.conf file.
#
my $subject_prefix;
my $distribution;
#
# Test branch-tag subject insertion
#
$modnum = 3;
#
# List of pairs: expected results, explanation
#
@expected = (('Li...@Ex..., '
. 'Li...@Ex...'),
'module name matches no patterns',
('Li...@Ex..., '
. 'Li...@Ex..., '
. 'Li...@Ex..., '
. 'Li...@Ex...'),
'module matches "", "last", ""',
('Li...@Ex..., '
. 'Li...@Ex...'),
'module matches an "always" and a "fallback"',
);
$subtest = 0;
$distribution = $sc->mail_to('random-module') || '';
is($distribution, $expected[$subtest++], $expected[$subtest++]);
$modname = sprintf('mailmap%02d', $testnum);
$distribution = $sc->mail_to($modname) || '';
is($distribution, $expected[$subtest++], $expected[$subtest++]);
$testnum++;
$modname = sprintf('mailmap%02d', $testnum);
$distribution = $sc->mail_to($modname) || '';
is($distribution, $expected[$subtest++], $expected[$subtest++]);
$testnum++;
1.1 spackle/t/per-module.t
Index: per-module.t
===================================================================
#
# $id$
#
# Run tests of the SpackleConf.pm module and other aspects of the
# package.
#
use strict;
use Test::More(tests => (1 + (3 * 2))); # Per-module parameter inheritance
my @expected; # Array of expected results per sequence
my $testnum = 1;
my $subtest;
my $modnum = 0;
my $modname;
my $cvsroot = './test_00';
use lib './test_00';
use SpackleConf;
my $sc = new SpackleConf($cvsroot);
#
# First section: test the per-module parameter processing in the
# spackle.conf file.
#
my $subject_prefix;
#
# List of pairs: expected results, explanation
#
@expected = ('[Global prefix]', # Global setting
'Global prefix',
'[testmodule00 prefix]', # Unmerged testmodule00
'Per- defined, no inheritance',
'[testmodule00 prefix]', # Merged testmodule00
'Per- defined, inheritance',
'', # Unmerged testmodule01
'Per- undefined, no inheritance',
'[Global prefix]', # Merged testmodule01
'Per- undefined, inheritance',
'', # Unmerged testmodule02
'Undefined module, no inheritance',
'[Global prefix]', # Unmerged testmodule02
'Undefined module, inheritance',
);
$subtest = 0;
#
# Find out the global prefix. (Should be set.)
#
$subject_prefix = $sc->param('Subject_Prefix') || '';
is($subject_prefix, $expected[$subtest++], $expected[$subtest++]);
$testnum++;
for my $i (0..2) {
my $testseq = sprintf('%02d', $i);
$modname = "testmodule$testseq";
for my $j (0..1) {
#
# Set the inheritance appropriately.
#
$sc->config('automerge', $j);
#
# Now, the prefix for testmodule??.
#
$subject_prefix = $sc->module_param($modname, 'Subject_Prefix') || '';
is($subject_prefix, $expected[$subtest++], $expected[$subtest++]);
$testnum++;
}
}
#
# End of per-module parameter tests
#
|
|
From: Ken C. <co...@us...> - 2002-12-18 11:33:41
|
coar 02/12/18 03:33:40 Modified: . .cvsignore Log: don't need a shebang line, so don't need to be generated by configure Revision Changes Path 1.10 +0 -1 spackle/.cvsignore Index: .cvsignore =================================================================== RCS file: /cvsroot/spackle/spackle/.cvsignore,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- .cvsignore 17 Dec 2002 22:24:44 -0000 1.9 +++ .cvsignore 18 Dec 2002 11:33:40 -0000 1.10 @@ -21,4 +21,3 @@ config.nice spackle.conf runtests.pl -*.t |
|
From: Ken C. <co...@us...> - 2002-12-17 22:32:56
|
coar 02/12/17 14:32:55 Modified: . ChangeLog Log: nuff said Revision Changes Path 1.14 +3 -0 spackle/ChangeLog Index: ChangeLog =================================================================== RCS file: /cvsroot/spackle/spackle/ChangeLog,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- ChangeLog 16 Dec 2002 21:09:48 -0000 1.13 +++ ChangeLog 17 Dec 2002 22:32:55 -0000 1.14 @@ -1,6 +1,9 @@ Changelog for Spackle; newest stuff at the top. + o Added 'always' and 'never' flags to mailmap + o Added methods to get the distribution and subject for a + commit to a module o Added module stanzas to spackle.conf, so things like the commit message subject can be tailored still further and not necessarily be repository-wide. |
|
From: Ken C. <co...@us...> - 2002-12-17 22:32:39
|
coar 02/12/17 14:32:39
Modified: . configure.in Makefile.in
Log:
the making of the tests
Revision Changes Path
1.19 +2 -2 spackle/configure.in
Index: configure.in
===================================================================
RCS file: /cvsroot/spackle/spackle/configure.in,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- configure.in 16 Dec 2002 21:09:49 -0000 1.18
+++ configure.in 17 Dec 2002 22:32:38 -0000 1.19
@@ -1,5 +1,5 @@
#
-# $Id: configure.in,v 1.18 2002/12/16 21:09:49 coar Exp $
+# $Id: configure.in,v 1.19 2002/12/17 22:32:38 coar Exp $
#
# Copyright (c) 2002 by Ken A L Coar. All rights reserved.
#
@@ -485,7 +485,7 @@
avail config mailmap passwd spackled spackle.conf
commitcheck.sh commit_prep.pl cvs_acls.pl cvsedit.pl log_accum.pl
checkoutlist commitinfo editinfo loginfo
- test_00.pl)
+ runtests.pl t/per-module.t t/mailmap.t t/branch-log.t)
#
# All done, say what we did.
1.18 +3 -3 spackle/Makefile.in
Index: Makefile.in
===================================================================
RCS file: /cvsroot/spackle/spackle/Makefile.in,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- Makefile.in 16 Dec 2002 21:09:49 -0000 1.17
+++ Makefile.in 17 Dec 2002 22:32:38 -0000 1.18
@@ -1,7 +1,7 @@
MANIFEST=@PACKAGE_FILES@
#
-# $Id: Makefile.in,v 1.17 2002/12/16 21:09:49 coar Exp $
+# $Id: Makefile.in,v 1.18 2002/12/17 22:32:38 coar Exp $
#
# Copyright (c) 2002 by Ken A L Coar. All rights reserved.
#
@@ -145,9 +145,9 @@
#
# Test the results.
#
-test :
+test : runtests.pl
@if test "x$(PERL)" = "xNOT-FOUND" ; then \
echo "No local Perl interpreter found; cannot run 'make test'" ; \
exit 1 ; \
fi
- echo 'Test, d00d!'
+ $(PERL) runtests.pl
|
|
From: Ken C. <co...@us...> - 2002-12-17 22:32:01
|
coar 02/12/17 14:32:00
Modified: . TODO
Log:
something off the list
Revision Changes Path
1.24 +0 -5 spackle/TODO
Index: TODO
===================================================================
RCS file: /cvsroot/spackle/spackle/TODO,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- TODO 16 Dec 2002 04:33:57 -0000 1.23
+++ TODO 17 Dec 2002 22:32:00 -0000 1.24
@@ -58,8 +58,3 @@
o add --enable-readonly to enhance the karma message to say 'no
commits allowed' (maybe specify another file to be displayed?)
-
-o {sigh} Subject_Prefix and the branch-tag labelling are currently
- repository-wide; it really should be customisable at the
- module level. should it be in the mailmap flag field, or
- in a separate modules.config file with '[modulename]' sections?
|
|
From: Ken C. <co...@us...> - 2002-12-17 22:31:31
|
coar 02/12/17 14:31:30
Added: t branch-log.t.in mailmap.t.in per-module.t.in
Log:
start prototyping the tests
Revision Changes Path
1.1 spackle/t/branch-log.t.in
Index: branch-log.t.in
===================================================================
#! @LOCAL_PERL@ -w
#
# $id$
#
# Run tests of the SpackleConf.pm module and other aspects of the
# package.
#
use strict;
use Test::More(tests => (3 * 2)); # Branch-tag insertion
my @expected; # Array of expected results per sequence
my $testnum = 1;
my $subtest;
my $modnum = 0;
my $modname;
my $cvsroot = './test_00';
use lib './test_00';
use SpackleConf;
my $sc = new SpackleConf($cvsroot);
#
# First section: test the per-module parameter processing in the
# spackle.conf file.
#
my $subject_prefix;
#
# Test branch-tag subject insertion
#
$modnum = 3;
#
# List of pairs: expected results, explanation
#
@expected = ('[no branch] cvs commit: testmodule03',
'No branch effector, no tag',
'[no branch] cvs commit: testmodule03',
'No branch effector, tag',
'[prefix with tag: ] cvs commit: testmodule04',
'Simple branch effector, no tag',
'[prefix with tag: BRANCH] cvs commit: testmodule04',
'Simple branch effector, tag',
'[prefix] cvs commit: testmodule05',
'Complex branch effector, no tag',
'[prefix with tag] cvs commit: testmodule05',
'Complex branch effector, tag',
);
$subtest = 0;
for my $i (0..2) {
$modname = sprintf('testmodule%02d', $modnum + $i);
$subject_prefix = $sc->mail_subject($modname, '') || '';
is($subject_prefix, $expected[$subtest++], $expected[$subtest++]);
$testnum++;
$subject_prefix = $sc->mail_subject($modname, 'BRANCH') || '';
is($subject_prefix, $expected[$subtest++], $expected[$subtest++]);
$testnum++;
}
1.1 spackle/t/mailmap.t.in
Index: mailmap.t.in
===================================================================
#! @LOCAL_PERL@ -w
#
# $id$
#
# Run tests of the SpackleConf.pm module and other aspects of the
# package.
#
use strict;
use Test::More(tests => (3 * 2)); # Branch-tag insertion
my @expected; # Array of expected results per sequence
my $testnum = 1;
my $subtest;
my $modnum = 0;
my $modname;
my $cvsroot = './test_00';
use lib './test_00';
use SpackleConf;
my $sc = new SpackleConf($cvsroot);
#
# First section: test the per-module parameter processing in the
# spackle.conf file.
#
my $subject_prefix;
my $distribution;
#
# Test branch-tag subject insertion
#
$modnum = 3;
#
# List of pairs: expected results, explanation
#
@expected = (('Li...@Ex..., '
. 'Li...@Ex...'),
'module name matches no patterns',
('Li...@Ex..., '
. 'Li...@Ex..., '
. 'Li...@Ex..., '
. 'Li...@Ex...'),
'module matches "", "last", ""',
('Li...@Ex..., '
. 'Li...@Ex...'),
'module matches an "always" and a "fallback"',
);
$subtest = 0;
$distribution = $sc->mail_to('random-module') || '';
is($distribution, $expected[$subtest++], $expected[$subtest++]);
$modname = sprintf('mailmap%02d', $testnum);
$distribution = $sc->mail_to($modname) || '';
is($distribution, $expected[$subtest++], $expected[$subtest++]);
$testnum++;
$modname = sprintf('mailmap%02d', $testnum);
$distribution = $sc->mail_to($modname) || '';
is($distribution, $expected[$subtest++], $expected[$subtest++]);
$testnum++;
1.1 spackle/t/per-module.t.in
Index: per-module.t.in
===================================================================
#! @LOCAL_PERL@ -w
#
# $id$
#
# Run tests of the SpackleConf.pm module and other aspects of the
# package.
#
use strict;
use Test::More(tests => (1 + (3 * 2))); # Per-module parameter inheritance
my @expected; # Array of expected results per sequence
my $testnum = 1;
my $subtest;
my $modnum = 0;
my $modname;
my $cvsroot = './test_00';
use lib './test_00';
use SpackleConf;
my $sc = new SpackleConf($cvsroot);
#
# First section: test the per-module parameter processing in the
# spackle.conf file.
#
my $subject_prefix;
#
# List of pairs: expected results, explanation
#
@expected = ('[Global prefix]', # Global setting
'Global prefix',
'[testmodule00 prefix]', # Unmerged testmodule00
'Per- defined, no inheritance',
'[testmodule00 prefix]', # Merged testmodule00
'Per- defined, inheritance',
'', # Unmerged testmodule01
'Per- undefined, no inheritance',
'[Global prefix]', # Merged testmodule01
'Per- undefined, inheritance',
'', # Unmerged testmodule02
'Undefined module, no inheritance',
'[Global prefix]', # Unmerged testmodule02
'Undefined module, inheritance',
);
$subtest = 0;
#
# Find out the global prefix. (Should be set.)
#
$subject_prefix = $sc->param('Subject_Prefix') || '';
is($subject_prefix, $expected[$subtest++], $expected[$subtest++]);
$testnum++;
for my $i (0..2) {
my $testseq = sprintf('%02d', $i);
$modname = "testmodule$testseq";
for my $j (0..1) {
#
# Set the inheritance appropriately.
#
$sc->config('automerge', $j);
#
# Now, the prefix for testmodule??.
#
$subject_prefix = $sc->module_param($modname, 'Subject_Prefix') || '';
is($subject_prefix, $expected[$subtest++], $expected[$subtest++]);
$testnum++;
}
}
#
# End of per-module parameter tests
#
|
|
From: Ken C. <co...@us...> - 2002-12-17 22:31:30
|
coar 02/12/17 14:31:30
Added: . runtests.pl.in
Log:
start prototyping the tests
Revision Changes Path
1.1 spackle/runtests.pl.in
Index: runtests.pl.in
===================================================================
#! @LOCAL_PERL@ -w
#
# $id$
#
# Run tests of the SpackleConf.pm module and other aspects of the
# package.
#
use strict;
use Test::Harness;
$Test::Harness::verbose = defined($ENV{'SPACKLE_TEST_VERBOSE'}) || 0;
runtests('t/per-module.t', 't/mailmap.t', 't/branch-log.t');
|
|
From: Ken C. <co...@us...> - 2002-12-17 22:30:50
|
coar 02/12/17 14:30:48
Added: test_00 avail mailmap spackle.conf spackled
Log:
fake CVSROOT for regression tests
Revision Changes Path
1.1 spackle/test_00/avail
Index: avail
===================================================================
unavail
avail|coar|CVSROOT
1.1 spackle/test_00/mailmap
Index: mailmap
===================================================================
. : :Li...@Ex...
nomatch :always :Li...@Ex...
mailmap01: :Li...@Ex...
mailmap01:last :Li...@Ex...
mailmap01: :Li...@Ex...
mailmap02:fallback:Li...@Ex...
#
# Combinations of:
# matching/non-matching module name,
# no-flags,
# last,
# fallback,
# never
#
1.1 spackle/test_00/spackle.conf
Index: spackle.conf
===================================================================
#
# Spackle configuration file
# $Id: spackle.conf,v 1.1 2002/12/17 22:30:47 coar Exp $
# Originally Generated automatically from spackle.conf.in by configure.
# Edit to tailor your settings.
#
#
# Allow user configuration of various run-time options.
#
#
# Enable/disable display of all sorts of debugging information.
# This may disappear in future versions; it's primarily for use
# by Spackle developers.
#
Debug = Off
#
# PatchThreshold: number of lines of patch text that will be
# included in the log email verbatim; more than this causes the
# email to shift to a different format.
#
# [Not yet implemented]
#
#PatchThreshold = 1024
#
# Where should the RCS ID and delta information appear?
#
# 0 = nowhere
# 1 = in email only
# 2 = in logs only [not yet implemented]
# 3 = in both email and logs
#
IncludeRCSinfo = 3
#
# Settings initially defined by ./configure
#
MAINTAINER = coar
MAINTAINER_EMAIL = Ken...@Go...
#
# Major functions
#
ENABLE_ACLS = yes
ENABLE_LOGGING = yes
#
# Minor options
#
ENABLE_PASSWD = no
ENABLE_READERS = no
ENABLE_WRITERS = no
#
# Other repository settings
#
#
# Text to prepend to the subjects of commit messages
#
Subject_Prefix = [Global prefix]
#
# Whether commit attempts should be turned away without even
# checking the karma file.
#
ReadOnly = Off
#
# Module with local settings
#
[testmodule00]
Subject_Prefix = [testmodule00 prefix]
#
# Module with *no* local settings, so they should always be either undef
# or inherited.
#
[testmodule01]
#
# Module 'testmodule02' is purposely omitted in order to inherit
# the defaults.
#
#
# Modules for testing inserted branch tags.
#
[testmodule03]
Subject_Prefix = [no branch]
[testmodule04]
Subject_Prefix = [prefix with tag: !B]
[testmodule05]
Subject_Prefix = [prefix%B{ with tag}B%]
#
# Placeholder dummy module to close the list.
#
[endmodule]
1.1 spackle/test_00/spackled
Index: spackled
===================================================================
Spackle version 0.1b3-dev
Generated automatically from spackled.in by configure.
Configured at Sat Sep 28 09:05:54 EDT 2002 with
Access control: yes
Logging features: yes
Maintainer: coar
Maintainer email: Ken...@Go...
Command line:
./configure '--with-cvsroot=/home/coar/mycvs/CVSROOT-projects' '--with-maintainer=coar' '--wit...@Go...' '--enable-logging' '--enable-acls' '--enable-comitlogs' '--with-perl=/usr/local/bin/perl' '--enable-readonly' '--disable-readonly'
See <URL:http://Spackle.SourceForge.Net/> for more info.
|
|
From: Ken C. <co...@us...> - 2002-12-17 22:29:51
|
coar 02/12/17 14:29:50
Modified: . SpackleConf.pm.in spackle-mailmap.5
Log:
add "always" and "never" flags to mailmap; some fixits to the mail_* methods
Revision Changes Path
1.6 +15 -7 spackle/SpackleConf.pm.in
Index: SpackleConf.pm.in
===================================================================
RCS file: /cvsroot/spackle/spackle/SpackleConf.pm.in,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- SpackleConf.pm.in 16 Dec 2002 21:09:48 -0000 1.5
+++ SpackleConf.pm.in 17 Dec 2002 22:29:49 -0000 1.6
@@ -1,7 +1,7 @@
package SpackleConf;
#
-# $Id: SpackleConf.pm.in,v 1.5 2002/12/16 21:09:48 coar Exp $
+# $Id: SpackleConf.pm.in,v 1.6 2002/12/17 22:29:49 coar Exp $
#
# Copyright (c) 2002 by Ken A L Coar. All rights reserved.
#
@@ -20,7 +20,7 @@
use Carp;
$VERSION = '@PACKAGE_VERSION@';
-$REVISION = '$Id: SpackleConf.pm.in,v 1.5 2002/12/16 21:09:48 coar Exp $';
+$REVISION = '$Id: SpackleConf.pm.in,v 1.6 2002/12/17 22:29:49 coar Exp $';
($REVNUM = $REVISION) =~ s/.*,v\s+(\d+\.\d+)\s+.*/$1/;
#
@@ -113,8 +113,10 @@
while (<MAILMAP>) {
chomp;
next if (/^\s*#/ or ($_ eq ''));
- my ($mapre, $flags, $eddress) = split(/:/, $_, 3);
+ my ($mapre, $flags, $eddress) = split(/\s*:\s*/, $_, 3);
+ $mapre =~ s/^\s*(\S.*\S)\s*$/$1/;
$eddress =~ s/^\s*(\S.*\S)\s*$/$1/;
+ $flags =~ s/^\s*(\S.*\S)\s*$/$1/;
push(@{$self->{'mailmap'}},
{ 'pattern' => $mapre,
'flags' => $flags,
@@ -580,7 +582,9 @@
sub mail_subject {
my $self = shift;
my ($module, $tag) = @_;
- my $prefix = $self->param('Subject_Prefix');
+ my $merge_was = $self->config('automerge', 1);
+ my $prefix = $self->module_param($module, 'Subject_Prefix');
+ $self->config('automerge', $merge_was);
my $string;
if ($prefix) {
@@ -626,15 +630,19 @@
my $to;
my $fallback;
- while (@maplines) {
+ for (@maplines) {
my %line = %{$_};
#
# See if the pattern matches the module name.
#
- next if ($module !~ qr/$line{'pattern'}/);
+ my $always = ($line{'flags'} =~ /\balways\b/i);
+ next if (($module !~ qr/$line{'pattern'}/)
+ && (! $always));
+ next if ($line{'flags'} =~ /\bnever\b/i);
my $eddress = $line{'eddress'};
- if ($line{'flags'} =~ qr:\bfallback\b:i) {
+ if (($line{'flags'} =~ qr:\bfallback\b:i)
+ && (! $always)) {
#
# If it's a fallback address (to be used if no explicit ones
# are found), save it for later.
1.5 +8 -0 spackle/spackle-mailmap.5
Index: spackle-mailmap.5
===================================================================
RCS file: /cvsroot/spackle/spackle/spackle-mailmap.5,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- spackle-mailmap.5 16 Dec 2002 05:37:00 -0000 1.4
+++ spackle-mailmap.5 17 Dec 2002 22:29:49 -0000 1.5
@@ -53,6 +53,9 @@
the contents of the \fIeddress\fP field is added to the mail
destination list, and scanning continues.
.TP
+.I always
+the record will always be used, whether the pattern matches or not.
+.TP
.I fallback
the contents of the \fIeddress\fP is added to a fallback list, and
scanning continues.
@@ -61,8 +64,13 @@
the contents of the \fIeddress\fP field is added to the mail
destination list, and reading of the \fBmailmap\fP file stops
immediately.
+.TP
+.I never
+an entry with \fInever\fP in the flags field will always be ignored;
+it's essentially equivalent to commenting the line out.
.PP
Multiple flags may be specified, separated by commas or whitespace.
+If \fIalways\fP and \fInever\fP appear together, \fInever\fP dominates.
The \fIlast\fP and \fIfallback\fP flags may be combined; the fallback
address will be processed and scanning will then stop.
If the email destination list is empty when scanning has been
|
|
From: Ken C. <co...@us...> - 2002-12-17 22:24:46
|
coar 02/12/17 14:24:45 Modified: . .cvsignore Log: more stuff to consider invisible Revision Changes Path 1.9 +2 -0 spackle/.cvsignore Index: .cvsignore =================================================================== RCS file: /cvsroot/spackle/spackle/.cvsignore,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- .cvsignore 11 Aug 2002 13:02:25 -0000 1.8 +++ .cvsignore 17 Dec 2002 22:24:44 -0000 1.9 @@ -20,3 +20,5 @@ spackled config.nice spackle.conf +runtests.pl +*.t |
|
From: Ken C. <co...@us...> - 2002-12-17 20:20:24
|
coar 02/12/17 12:20:23 spackle/t - New directory |
|
From: Ken C. <co...@us...> - 2002-12-16 21:09:53
|
coar 02/12/16 13:09:51
Modified: . ChangeLog spackle.conf.5 SpackleConf.pm.in
configure.in Makefile.in
Log:
add per-module settings capability in spackle.conf, and start on a "make test"
Revision Changes Path
1.13 +3 -0 spackle/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvsroot/spackle/spackle/ChangeLog,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ChangeLog 15 Dec 2002 05:01:43 -0000 1.12
+++ ChangeLog 16 Dec 2002 21:09:48 -0000 1.13
@@ -1,6 +1,9 @@
Changelog for Spackle; newest stuff at the top.
+ o Added module stanzas to spackle.conf, so things like the
+ commit message subject can be tailored still further and
+ not necessarily be repository-wide.
o Add !B and %B{}B% effectors to allow inserting branch tags
in Subject_Prefix
o Add 'make clean' to get rid of the files generated by
1.5 +50 -1 spackle/spackle.conf.5
Index: spackle.conf.5
===================================================================
RCS file: /cvsroot/spackle/spackle/spackle.conf.5,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- spackle.conf.5 15 Dec 2002 05:00:52 -0000 1.4
+++ spackle.conf.5 16 Dec 2002 21:09:48 -0000 1.5
@@ -23,6 +23,55 @@
the equals symbol is ignored. Continuation lines are \fBnot\fP
supported.
.SH
+STANZAS
+By default, all parameters in the \fIspackle.conf\fP file are
+\fIglobal\fP, meaning that they apply in all situations. However,
+you can change parameter settings on a module-by-module basis by
+adding \fIstanzas\fP.
+.PP
+A stanza begins with either
+.IP
+[\fImodule-name\fP]
+.PP
+or
+.IP
+[module \fImodule-name\fP]
+.PP
+and ends when the processor encounters
+.IP o 2
+the end of the file, or
+.IP o 2
+a new module stanza, or
+.IP o 2
+the special marker '\fB[endmodule]\fP'
+.PP
+The processor will switch back to making definitions in the global
+scope if it encounters either a '\fB[endmodule]\fP' or the start of
+a stanza with the special module name '\fBglobal\fP'. So the following are
+equivalent:
+.IP "1." 5
+[module temp]
+.br
+Subject_Prefix = [temp]
+.br
+[endmodule]
+.br
+Subject_Prefix = [repo]
+.PP
+.IP "2." 5
+[module temp]
+.br
+Subject_Prefix = [temp]
+.br
+[global]
+.br
+Subject_Prefix = [repo]
+.PP
+Not all parameters make sense in \fIper\fP-module stanzas; the
+\fBDebug\fP and \fBKarma_File\fP parameters are examples. Such
+definitions encountered within a module stanza are ignored, and
+only the global setting is used.
+.SH
PARAMETERS
Parameters may take either integer, string, or Boolean values. Integer
and string values are pretty straightforward, but Boolean settings
@@ -113,7 +162,7 @@
text will only be included if the commit was on a branch. For
exmaple:
.IP
-.B Subject_Prefix = [Repo A] %B{[branch tag !B}B%
+.B Subject_Prefix = [Repo A] %B{[branch tag !B]}B%
.IP
would result in a subject prefix of '\fB[Repo A] commit: ...\fP' for
a main-line commit, and '\fB[Repo A] [branch tag BR1] commit: ...\fP'
1.5 +108 -20 spackle/SpackleConf.pm.in
Index: SpackleConf.pm.in
===================================================================
RCS file: /cvsroot/spackle/spackle/SpackleConf.pm.in,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SpackleConf.pm.in 16 Dec 2002 05:37:35 -0000 1.4
+++ SpackleConf.pm.in 16 Dec 2002 21:09:48 -0000 1.5
@@ -1,7 +1,7 @@
package SpackleConf;
#
-# $Id: SpackleConf.pm.in,v 1.4 2002/12/16 05:37:35 coar Exp $
+# $Id: SpackleConf.pm.in,v 1.5 2002/12/16 21:09:48 coar Exp $
#
# Copyright (c) 2002 by Ken A L Coar. All rights reserved.
#
@@ -20,7 +20,7 @@
use Carp;
$VERSION = '@PACKAGE_VERSION@';
-$REVISION = '$Id: SpackleConf.pm.in,v 1.4 2002/12/16 05:37:35 coar Exp $';
+$REVISION = '$Id: SpackleConf.pm.in,v 1.5 2002/12/16 21:09:48 coar Exp $';
($REVNUM = $REVISION) =~ s/.*,v\s+(\d+\.\d+)\s+.*/$1/;
#
@@ -76,7 +76,7 @@
my @results;
if (@ids > 1) {
for (@ids) {
- push(@results, _resolve_id($self, $_));
+ push(@results, $self->_resolve_id($_));
}
}
else {
@@ -103,7 +103,7 @@
#
return 1;
}
- my $mapfile = "$CVSROOT/CVSROOT/mailmap";
+ my $mapfile = $self->config('cvsroot') . '/mailmap';
if (-r $mapfile) {
my $opened = open(MAILMAP, "< $mapfile");
if (! $opened) {
@@ -154,7 +154,7 @@
}
else {
$self->{_karma}->{_groups}->{$who} =
- [_resolve_id($self, $what)];
+ [$self->_resolve_id($what)];
}
}
else {
@@ -162,7 +162,7 @@
# Use any group definitions as they exist at this point.
#
$self->{_karma}->{$lkey}->{_who} =
- join(',', _resolve_id($self, $who));
+ join(',', $self->_resolve_id($who));
}
}
close(KFILE);
@@ -233,18 +233,41 @@
#
my @config = <CONF>;
chomp(@config);
+ my $module;
+ my $mkey;
+
for (my $i = 0; $i <= $#config; $i++) {
my $line = $config[$i];
next if (($line =~ /^\s*#/) || ($line =~ /^\s*$/));
- if ($line !~ /=/) {
+ if ($line =~ /^\s*\[(.*)\]\s*(?:#.*)?$/) {
+ #
+ # Start of a [new] module-specific stanza, or possibly a
+ # reversion to the global one..
+ #
+ $module = $1;
+ if ($module =~ /^(?:global|endmodule)$/) {
+ $module = undef;
+ }
+ else {
+ $module =~ s/^module\s+//i;
+ $mkey = "module $module";
+ }
+ }
+ elsif ($line !~ /=/) {
#
- # Some sort of error; not a key=value line
+ # Some sort of error; not a key=value line nor the
+ # start of a module stanza
#
}
else {
my ($key, $value) = split(/\s*=\s*/, $line, 2);
$value =~ s/^\s*(.*\S)\s*$/$1/;
- $params{lc($key)} = $value;
+ if ($module) {
+ ${$params{$mkey}}{lc($key)} = $value;
+ }
+ else {
+ $params{lc($key)} = $value;
+ }
}
}
if (! defined($params{'karma_file'})) {
@@ -268,11 +291,18 @@
=over 4
+=item B<automerge>
+
+This control affects the operation of the B<module_param>() method.
+If set to a TRUE value, the B<module_param>() method will return
+the global setting of the parameter if no module-specific one
+exists.
+
=item B<strict>
-If this control is set to a TRUE value, the B<param>() method
-cannot store nor access keywords that aren't in its known set
-of parameters. Default setting is FALSE.
+If this control is set to a TRUE value, the B<param>() and
+B<module_param>() methods cannot store nor access keywords
+that aren't in the known set of parameters. Default setting is FALSE.
=back
@@ -289,7 +319,7 @@
my $exists = defined($self->{_config}->{$key});
my $curval = $exists ? $self->{_config}->{$key} : undef;
- if ($#_ > 1) {
+ if ($#_ > 0) {
$self->{_config}->{$key} = $newval;
}
return $curval;
@@ -372,7 +402,7 @@
my ($key, $value) = @_;
my $rkey = lc($key);
- if (config($self, 'strict') && (! defined($canonical_params{$rkey}))) {
+ if ($self->config('strict') && (! defined($canonical_params{$rkey}))) {
carp("Unknown parameter '$key'");
return undef;
}
@@ -392,7 +422,7 @@
$value = _boolean($value) ? 'On' : 'Off';
}
}
- if ($#_ > 1) {
+ if ($#_ > 0) {
$self->{_params}->{$rkey} = $value;
$canonical_params{$rkey} = $key if (! $exists);
}
@@ -401,6 +431,64 @@
=pod
+=head2 module_param($modulename, $keyword [, $newvalue])
+
+Similar to the C<param()> method, but returns parameter
+settings specific to the named module. If the
+C<automerge> control is not set, C<undef> will be returned
+for any parameter that doesn't have a module-specific value;
+if C<automerge> I<is> set, any global setting will be returned
+if there is none specific to the module.
+
+Returns the current setting of the specified configuration parameter,
+or C<undef> if there is no such parameter defined. If a second
+argument is passed, the parameter will be set to the specified
+value; the return value is I<still> the original setting or C<undef>.
+Previously nonexistent parameters may be created this way.
+
+Parameter names are case-insensitive.
+
+=cut
+
+sub module_param {
+ my $self = shift;
+ my ($module, $key, $value) = @_;
+ my $mkey = "module $module";
+
+ my $rkey = lc($key);
+ if ($self->config('strict') && (! defined($canonical_params{$rkey}))) {
+ carp("Unknown parameter '$key'");
+ return undef;
+ }
+ my $exists = defined($self->{_params}->{$mkey}->{$rkey}) || 0;
+ my $curval = ($exists
+ ? $self->{_params}->{$mkey}->{$rkey}
+ : ($self->config('automerge')
+ ? $self->param($rkey)
+ : undef));
+ #
+ # Special treatment for Booleans. If they're one of the
+ # true keywords, return 1; else 0. When setting, use
+ # 'On' and 'Off' respectively -- just in case we ever
+ # write this stuff back to disk.
+ #
+ if ($key =~ /$BOOLEANS/i) {
+ if ($curval) {
+ $curval = _boolean($curval);
+ }
+ if ($value) {
+ $value = _boolean($value) ? 'On' : 'Off';
+ }
+ }
+ if ($#_ > 1) {
+ $self->{_params}->{$mkey}->{$rkey} = $value;
+ $canonical_params{$rkey} = $key if (! $exists);
+ }
+ return $curval;
+}
+
+=pod
+
=head2 report_groups([*FILE])
Simply displays a list of the groups as they exist at the time of the
@@ -413,7 +501,7 @@
sub report_groups {
my $self = shift;
my ($fh) = @_;
- if ($#_ < 1) {
+ if ($#_ < 0) {
$fh = \*STDOUT;
}
print $fh 'Groups from file: '
@@ -440,7 +528,7 @@
sub report_karma {
my $self = shift;
my ($fh) = @_;
- if ($#_ < 1) {
+ if ($#_ < 0) {
$fh = \*STDOUT;
}
print $fh 'Karma from file: '
@@ -467,7 +555,7 @@
sub report_params {
my $self = shift;
my ($file) = @_;
- if ($#_ < 1) {
+ if ($#_ < 0) {
$file = \*STDOUT;
}
my %params = %{$self->{_params}};
@@ -577,8 +665,8 @@
#
if (! $to) {
$to = $self->param('Maintainer_Email')
- or '@MAINTAINER_EMAIL@'
- or 'Ken...@Go...';
+ || '@MAINTAINER_EMAIL@'
+ || 'Ken...@Go...';
}
return $to;
}
1.18 +20 -8 spackle/configure.in
Index: configure.in
===================================================================
RCS file: /cvsroot/spackle/spackle/configure.in,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- configure.in 29 Sep 2002 12:51:29 -0000 1.17
+++ configure.in 16 Dec 2002 21:09:49 -0000 1.18
@@ -1,5 +1,5 @@
#
-# $Id: configure.in,v 1.17 2002/09/29 12:51:29 coar Exp $
+# $Id: configure.in,v 1.18 2002/12/16 21:09:49 coar Exp $
#
# Copyright (c) 2002 by Ken A L Coar. All rights reserved.
#
@@ -172,21 +172,32 @@
AC_MSG_CHECKING(for perl)
if test "$withval" = "no" ; then
AC_MSG_RESULT(none)
- AC_MSG_ERROR(A Perl interpreter is required; unable to continue)
- else
- AC_MSG_RESULT($withval (assumed valid on repository system))
+ AC_MSG_ERROR(Perl interpreter required, cannot proceed)
fi
+ AC_MSG_RESULT($withval (assumed valid on repository system))
AC_CACHE_VAL(ac_cv_path_PERL, [ac_cv_path_PERL=$withval])
PERL=$withval
],
[
- AC_PATH_PROG(PERL, perl, "NOT-FOUND")
- if test "x${ac_cv_path_PERL}" = "xNOT-FOUND" ; then
- AC_MSG_ERROR(Perl interpreter not found; unable to continue)
+ AC_PATH_PROG(PERL, perl, "no")
+ if test "x${ac_cv_path_PERL}" = "xno" ; then
+ AC_MSG_WARN(Perl interpreter required but not found; assuming /usr/bin/perl)
+ withval="/usr/bin/perl"
+ PERL=$withval
fi
])
AC_SUBST(PERL)
+#
+# We need the local Perl interpreter in order to run tests later.
+#
+AC_PATH_PROG(LOCAL_PERL, perl, "no")
+if test "x${ac_cv_path_LOCAL_PERL}" = "xno" ; then
+ AC_MSG_WARN(No local Perl interpreter; won't be able to run 'make test')
+ LOCAL_PERL="NOT-FOUND"
+fi
+AC_SUBST(LOCAL_PERL)
+
AC_ARG_WITH(sendmail,
[ --with-sendmail[=FILE] Indicate where the sendmail binary is located on
the CVS repository system.],
@@ -473,7 +484,8 @@
AC_OUTPUT(Makefile SpackleConf.pm
avail config mailmap passwd spackled spackle.conf
commitcheck.sh commit_prep.pl cvs_acls.pl cvsedit.pl log_accum.pl
- checkoutlist commitinfo editinfo loginfo)
+ checkoutlist commitinfo editinfo loginfo
+ test_00.pl)
#
# All done, say what we did.
1.17 +12 -1 spackle/Makefile.in
Index: Makefile.in
===================================================================
RCS file: /cvsroot/spackle/spackle/Makefile.in,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- Makefile.in 29 Sep 2002 14:34:58 -0000 1.16
+++ Makefile.in 16 Dec 2002 21:09:49 -0000 1.17
@@ -1,7 +1,7 @@
MANIFEST=@PACKAGE_FILES@
#
-# $Id: Makefile.in,v 1.16 2002/09/29 14:34:58 coar Exp $
+# $Id: Makefile.in,v 1.17 2002/12/16 21:09:49 coar Exp $
#
# Copyright (c) 2002 by Ken A L Coar. All rights reserved.
#
@@ -33,6 +33,7 @@
srcdir=@srcdir@
top_srcdir=@top_srcdir@
INSTALL=@INSTALL@
+PERL=@LOCAL_PERL@
ENABLE_COMMITLOGS=@ENABLE_COMMITLOGS@
DESTDIR=
VPATH=@srcdir@
@@ -140,3 +141,13 @@
#
writers :
echo $(MAINTAINER) > $@
+
+#
+# Test the results.
+#
+test :
+ @if test "x$(PERL)" = "xNOT-FOUND" ; then \
+ echo "No local Perl interpreter found; cannot run 'make test'" ; \
+ exit 1 ; \
+ fi
+ echo 'Test, d00d!'
|
|
From: Ken C. <co...@us...> - 2002-12-16 18:18:21
|
coar 02/12/16 10:18:20 spackle/test_00 - New directory |
|
From: Ken C. <co...@us...> - 2002-12-16 05:37:37
|
coar 02/12/15 21:37:36
Modified: . SpackleConf.pm.in log_accum.pl.in
Log:
move the mailmap processing into the perl module
Revision Changes Path
1.4 +164 -14 spackle/SpackleConf.pm.in
Index: SpackleConf.pm.in
===================================================================
RCS file: /cvsroot/spackle/spackle/SpackleConf.pm.in,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- SpackleConf.pm.in 29 Sep 2002 12:51:29 -0000 1.3
+++ SpackleConf.pm.in 16 Dec 2002 05:37:35 -0000 1.4
@@ -1,7 +1,7 @@
package SpackleConf;
#
-# $Id: SpackleConf.pm.in,v 1.3 2002/09/29 12:51:29 coar Exp $
+# $Id: SpackleConf.pm.in,v 1.4 2002/12/16 05:37:35 coar Exp $
#
# Copyright (c) 2002 by Ken A L Coar. All rights reserved.
#
@@ -20,7 +20,7 @@
use Carp;
$VERSION = '@PACKAGE_VERSION@';
-$REVISION = '$Id: SpackleConf.pm.in,v 1.3 2002/09/29 12:51:29 coar Exp $';
+$REVISION = '$Id: SpackleConf.pm.in,v 1.4 2002/12/16 05:37:35 coar Exp $';
($REVNUM = $REVISION) =~ s/.*,v\s+(\d+\.\d+)\s+.*/$1/;
#
@@ -69,7 +69,8 @@
# are used.
#
sub _resolve_id {
- my ($self, $idlist) = @_;
+ my $self = shift;
+ my ($idlist) = @_;
return '' if (! defined($idlist));
my (@ids) = split(/\s*,\s*/, $idlist);
my @results;
@@ -91,11 +92,45 @@
}
#
+# Load the mailmap file, which describes how messages should
+# be distributed.
+#
+sub _load_mailmap {
+ my $self = shift;
+ if ($self->{'mailmap'}) {
+ #
+ # Already loaded..
+ #
+ return 1;
+ }
+ my $mapfile = "$CVSROOT/CVSROOT/mailmap";
+ if (-r $mapfile) {
+ my $opened = open(MAILMAP, "< $mapfile");
+ if (! $opened) {
+ carp("Can't open $mapfile: $!");
+ return 0;
+ }
+ while (<MAILMAP>) {
+ chomp;
+ next if (/^\s*#/ or ($_ eq ''));
+ my ($mapre, $flags, $eddress) = split(/:/, $_, 3);
+ $eddress =~ s/^\s*(\S.*\S)\s*$/$1/;
+ push(@{$self->{'mailmap'}},
+ { 'pattern' => $mapre,
+ 'flags' => $flags,
+ 'eddress' => $eddress });
+ }
+ }
+ close(MAILMAP);
+ return 1;
+}
+
+#
# Actually read the karma file and store it internally.
#
sub _load_karma {
- my ($self) = @_;
+ my $self = shift;
my $kfile = $self->karma_file();
open(KFILE, "< $kfile")
@@ -150,6 +185,8 @@
$bool = $sc->is_member_of('username', 'groupname');
$bool = $sc->module_matches('module', 'repository list');
$sc->report_params(\*STDERR);
+ $string = $sc->mail_to('modulename');
+ $string = $sc->mail_subject('modulename');
=head1 DESCRIPTION
@@ -234,7 +271,7 @@
=item B<strict>
If this control is set to a TRUE value, the B<param>() method
-cannot store nor access keywords that aren't in it's known set
+cannot store nor access keywords that aren't in its known set
of parameters. Default setting is FALSE.
=back
@@ -246,7 +283,8 @@
=cut
sub config {
- my ($self, $kw, $newval) = @_;
+ my $self = shift;
+ my ($kw, $newval) = @_;
my $key = lc($kw);
my $exists = defined($self->{_config}->{$key});
@@ -269,7 +307,8 @@
=cut
sub is_member_of {
- my ($self, $user, $group) = @_;
+ my $self = shift;
+ my ($user, $group) = @_;
return grep(/^$user$/, $self->_resolve_id($group)) ? 1 : 0;
}
@@ -287,7 +326,7 @@
=cut
sub karma_file {
- my ($self) = @_;
+ my $self = shift;
return $self->config('cvsroot')
. '/' . $self->param('Karma_File');
}
@@ -304,7 +343,8 @@
=cut
sub module_matches {
- my ($self, $mname, $pattern) = @_;
+ my $self = shift;
+ my ($mname, $pattern) = @_;
return 1 if (! $pattern);
my $suffix = '(?:/|$)';
$pattern =~ s:,:\|:g;
@@ -328,7 +368,8 @@
my $BOOLEANS = qr§^(?:Debug|ENABLE_\w*|ReadOnly)$§;
sub param {
- my ($self, $key, $value) = @_;
+ my $self = shift;
+ my ($key, $value) = @_;
my $rkey = lc($key);
if (config($self, 'strict') && (! defined($canonical_params{$rkey}))) {
@@ -370,7 +411,8 @@
=cut
sub report_groups {
- my ($self, $fh) = @_;
+ my $self = shift;
+ my ($fh) = @_;
if ($#_ < 1) {
$fh = \*STDOUT;
}
@@ -396,7 +438,8 @@
=cut
sub report_karma {
- my ($self, $fh) = @_;
+ my $self = shift;
+ my ($fh) = @_;
if ($#_ < 1) {
$fh = \*STDOUT;
}
@@ -422,7 +465,8 @@
=cut
sub report_params {
- my ($self, $file) = @_;
+ my $self = shift;
+ my ($file) = @_;
if ($#_ < 1) {
$file = \*STDOUT;
}
@@ -434,6 +478,111 @@
return 1;
}
+=pod
+
+=head2 mail_subject($modulename [, $branch-tag])
+
+Returns the canonical subject for the commit message.
+This is determined from the module name, repository
+parameters, and possibly I<per>-module settings as
+well. See the I<spackle.conf(5)> man page for details.
+
+=cut
+
+sub mail_subject {
+ my $self = shift;
+ my ($module, $tag) = @_;
+ my $prefix = $self->param('Subject_Prefix');
+ my $string;
+
+ if ($prefix) {
+ if (! $tag) {
+ #
+ # No tag, so elide the effectors from the string.
+ #
+ $prefix =~ s/!B//g;
+ $prefix =~ s/%B{.*?}B%//g;
+ }
+ else {
+ #
+ # First, substitute the tag name.
+ #
+ $prefix =~ s/!B/$tag/g;
+ #
+ # Now remove the effector delimiters, since their content is
+ # to stay.
+ #
+ $prefix =~ s/(?:%B{|}B%)//g;
+ }
+ }
+ my $subject = (($prefix ? "$prefix " : '')
+ . 'cvs commit: ' . $module);
+ return $subject;
+}
+
+=pod
+
+=head2 mail_to($modulename)
+
+Returns the canonical distribution list for commit messages
+for the specified module, as determined from the
+C<mailmap> file. See the I<mailmap(5)> man page for details.
+
+=cut
+
+sub mail_to {
+ my $self = shift;
+ my ($module) = @_;
+ $self->_load_mailmap();
+ my @maplines = @{$self->{'mailmap'}};
+ my $to;
+ my $fallback;
+
+ while (@maplines) {
+ my %line = %{$_};
+ #
+ # See if the pattern matches the module name.
+ #
+ next if ($module !~ qr/$line{'pattern'}/);
+ my $eddress = $line{'eddress'};
+
+ if ($line{'flags'} =~ qr:\bfallback\b:i) {
+ #
+ # If it's a fallback address (to be used if no explicit ones
+ # are found), save it for later.
+ #
+ $fallback .= ($fallback ? ', ' : '') . $eddress;
+ }
+ else {
+ #
+ # It's an explicit mapping, so record it.
+ #
+ $to .= ($to ? ', ' : '') . $eddress;
+ }
+ #
+ # Endit if the matching line said "I'm the last".
+ #
+ last if ($line{'flags'} =~ qr:\blast\b:i);
+ }
+ #
+ # Use the fallback list if no explicit list was found.
+ #
+ if ((! $to) && $fallback) {
+ $to = $fallback;
+ }
+ #
+ # Of course, if there's no fallback list either, we might
+ # end up returning nothing. Use the administrator's eddress
+ # in such a case.
+ #
+ if (! $to) {
+ $to = $self->param('Maintainer_Email')
+ or '@MAINTAINER_EMAIL@'
+ or 'Ken...@Go...';
+ }
+ return $to;
+}
+
1;
=pod
@@ -445,7 +594,8 @@
=head1 SEE ALSO
L<spackle(5)>,
-L<spackle.conf(5)>
+L<spackle.conf(5)>,
+L<spackle-mailmap(5)>
=cut
#
1.30 +3 -74 spackle/log_accum.pl.in
Index: log_accum.pl.in
===================================================================
RCS file: /cvsroot/spackle/spackle/log_accum.pl.in,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- log_accum.pl.in 15 Dec 2002 05:06:56 -0000 1.29
+++ log_accum.pl.in 16 Dec 2002 05:37:35 -0000 1.30
@@ -1,6 +1,6 @@
#! @PERL@ -w
#
-# $Id: log_accum.pl.in,v 1.29 2002/12/15 05:06:56 coar Exp $
+# $Id: log_accum.pl.in,v 1.30 2002/12/16 05:37:35 coar Exp $
#
# Copyright (c) 2002 by Ken A L Coar. All rights reserved.
#
@@ -114,7 +114,6 @@
#
############################################################
-my $DEFAULT_MAIL_TO = $maintainer_email || 'Ken...@Go...';
my $MAIL_TO = '';
my $rcsidinfo = $sc->param('IncludeRCSinfo') || 3;
@@ -131,46 +130,7 @@
#
# Figure out where mail should *really* be sent.
#
-my $mapfile = "$CVSROOT/CVSROOT/mailmap";
-if (-r "$mapfile") {
- my($mapline, $mapre, $flags, $eddress, $fallback);
- $fallback = '';
- if (open(MAILMAP, "< $mapfile")) {
- while ($mapline = <MAILMAP>) {
- next if ($mapline =~ /^\s*#/);
- chomp($mapline);
- ($mapre, $flags, $eddress) = split(/:/, $mapline, 3);
- if ($ARGV[1] =~ qr/$mapre/) {
- $eddress =~ s:^\s+::;
- #
- # If this is a last-resort address, save it.
- #
- if ($flags =~ qr:\bfallback\b:i) {
- $fallback .= ", $eddress";
- }
- #
- # Otherwise, use it.
- #
- else {
- $MAIL_TO .= ", $eddress";
- }
- last if ($flags =~ qr:\blast\b:i);
- }
- }
- close(MAILMAP);
- #
- # Use the last-resort address if we had one and nothing else
- # matched.
- #
- if ((! $MAIL_TO) && $fallback) {
- $MAIL_TO = $fallback;
- }
- }
-}
-if (! $MAIL_TO) {
- $MAIL_TO = $DEFAULT_MAIL_TO;
-}
-$MAIL_TO =~ s:^,\s*::g;
+$MAIL_TO = $sc->mail_to($ARGV[1]);
############################################################
#
@@ -429,12 +389,7 @@
. "*** Commit mail not sent!\n";
}
else {
- my $prefix = $sc->param('Subject_Prefix');
- if ($prefix) {
- $prefix = insert_tag($prefix, $branch_tag);
- }
- my $subject = ($prefix ? "$prefix " : '')
- . 'cvs commit: ' . $ARGV[1];
+ my $subject = $sc->mail_subject($ARGV[1], $branch_tag);
print(MAIL "From: $FROM\n");
print(MAIL "To: $MAIL_TO\n");
print(MAIL "Subject: $subject\n");
@@ -675,29 +630,3 @@
mail_notification(@text) if defined($MAIL_TO);
cleanup_tmpfiles;
exit 0;
-
-#
-# Handle branch tag substitution.
-#
-sub insert_tag {
- my ($string, $tag) = @_;
- if (! $tag) {
- #
- # No tag, so elide the effectors from the string.
- #
- $string =~ s/!B//g;
- $string =~ s/%B{.*?}B%//g;
- }
- else {
- #
- # First, substitute the tag name.
- #
- $string =~ s/!B/$tag/g;
- #
- # Now remove the effector delimiters, since their content is
- # to stay.
- #
- $string =~ s/(?:%B{|}B%)//g;
- }
- return $string;
-}
|
|
From: Ken C. <co...@us...> - 2002-12-16 05:37:01
|
coar 02/12/15 21:37:00 Modified: . spackle-mailmap.5 Log: a minor tweak/clarification Revision Changes Path 1.4 +3 -0 spackle/spackle-mailmap.5 Index: spackle-mailmap.5 =================================================================== RCS file: /cvsroot/spackle/spackle/spackle-mailmap.5,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- spackle-mailmap.5 11 Aug 2002 13:01:47 -0000 1.3 +++ spackle-mailmap.5 16 Dec 2002 05:37:00 -0000 1.4 @@ -62,6 +62,9 @@ destination list, and reading of the \fBmailmap\fP file stops immediately. .PP +Multiple flags may be specified, separated by commas or whitespace. +The \fIlast\fP and \fIfallback\fP flags may be combined; the fallback +address will be processed and scanning will then stop. If the email destination list is empty when scanning has been completed, the value of the fallback list is used as the destination list. This permits an entry such as |
|
From: Ken C. <co...@us...> - 2002-12-16 04:34:00
|
coar 02/12/15 20:33:58
Modified: . TODO
Log:
just thought of this one..
Revision Changes Path
1.23 +5 -0 spackle/TODO
Index: TODO
===================================================================
RCS file: /cvsroot/spackle/spackle/TODO,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- TODO 15 Dec 2002 05:01:43 -0000 1.22
+++ TODO 16 Dec 2002 04:33:57 -0000 1.23
@@ -58,3 +58,8 @@
o add --enable-readonly to enhance the karma message to say 'no
commits allowed' (maybe specify another file to be displayed?)
+
+o {sigh} Subject_Prefix and the branch-tag labelling are currently
+ repository-wide; it really should be customisable at the
+ module level. should it be in the mailmap flag field, or
+ in a separate modules.config file with '[modulename]' sections?
|
|
From: Ken C. <co...@us...> - 2002-12-15 05:06:56
|
coar 02/12/14 21:06:56
Modified: . log_accum.pl.in
Log:
clean up a little, and add branch-tag-in-mail-subject code
Revision Changes Path
1.29 +75 -44 spackle/log_accum.pl.in
Index: log_accum.pl.in
===================================================================
RCS file: /cvsroot/spackle/spackle/log_accum.pl.in,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- log_accum.pl.in 12 Aug 2002 00:18:35 -0000 1.28
+++ log_accum.pl.in 15 Dec 2002 05:06:56 -0000 1.29
@@ -1,6 +1,6 @@
#! @PERL@ -w
#
-# $Id: log_accum.pl.in,v 1.28 2002/08/12 00:18:35 coar Exp $
+# $Id: log_accum.pl.in,v 1.29 2002/12/15 05:06:56 coar Exp $
#
# Copyright (c) 2002 by Ken A L Coar. All rights reserved.
#
@@ -31,6 +31,7 @@
my $sc = new SpackleConf;
my $debug = $sc->param('Debug') || 0;
+my $branch_tag;
#
# Setting DEBUG to a non-zero value will enable stackdumping on receipt
@@ -73,7 +74,7 @@
sub {
my $signame = @_;
Carp::confess("caught signal $signame");
- Carp::cluck("exiting");
+ Carp::cluck('exiting');
exit(1000);
};
}
@@ -105,7 +106,7 @@
my $SENDMAIL = '@SENDMAIL@';
my $CVS = '@CVS@';
-my $COMMITLOGS = "@ENABLE_COMMITLOGS@";
+my $COMMITLOGS = '@ENABLE_COMMITLOGS@';
############################################################
#
@@ -134,7 +135,7 @@
if (-r "$mapfile") {
my($mapline, $mapre, $flags, $eddress, $fallback);
$fallback = '';
- if (open(MAILMAP, "<$mapfile")) {
+ if (open(MAILMAP, "< $mapfile")) {
while ($mapline = <MAILMAP>) {
next if ($mapline =~ /^\s*#/);
chomp($mapline);
@@ -181,12 +182,12 @@
my($dir, @files) = @_;
my(@lines, $file);
- $lines[0] = sprintf(" %-08s", $dir);
+ $lines[0] = sprintf(' %-08s', $dir);
foreach $file (@files) {
if (length($lines[$#lines]) + length($file) > 60) {
- $lines[++$#lines] = sprintf(" %8s", " ");
+ $lines[++$#lines] = sprintf(' %8s', ' ');
}
- $lines[$#lines] .= " ".$file;
+ $lines[$#lines] .= ' ' . $file;
}
@lines;
}
@@ -198,14 +199,14 @@
push(@files, grep(/^${FILE_PREFIX}.*\.${id}$/, readdir(DIR)));
closedir(DIR);
foreach (@files) {
- unlink "$TMPDIR/$_";
+ unlink("$TMPDIR/$_");
}
}
sub write_logfile {
my ($filename, @lines) = @_;
- open(FILE, ">$filename") || die ("Cannot open log file $filename: $!\n");
+ open(FILE, "> $filename") || die ("Cannot open log file $filename: $!\n");
print(FILE join("\n", @lines), "\n");
close(FILE);
}
@@ -215,7 +216,7 @@
if (@files) {
my(@lines) = format_names($dir, @files);
- open(FILE, ">>$filename") || die ("Cannot open file $filename: $!\n");
+ open(FILE, ">> $filename") || die ("Cannot open file $filename: $!\n");
print(FILE join("\n", @lines), "\n");
close(FILE);
}
@@ -224,7 +225,7 @@
sub write_line {
my($filename, $line) = @_;
- open(FILE, ">$filename") || die("Cannot open file $filename: $!\n");
+ open(FILE, "> $filename") || die("Cannot open file $filename: $!\n");
print(FILE $line, "\n");
close(FILE);
}
@@ -232,7 +233,7 @@
sub append_line {
my($filename, $line) = @_;
- open(FILE, ">>$filename") || die("Cannot open file $filename: $!\n");
+ open(FILE, ">> $filename") || die("Cannot open file $filename: $!\n");
print(FILE $line, "\n");
close(FILE);
}
@@ -241,7 +242,7 @@
my($filename) = @_;
my($line);
- open(FILE, "<$filename") || die("Cannot open file $filename: $!\n");
+ open(FILE, "< $filename") || die("Cannot open file $filename: $!\n");
$line = <FILE>;
close(FILE);
chomp($line);
@@ -252,10 +253,10 @@
my($filename, $leader) = @_;
my(@text) = ();
- open(FILE, "<$filename") || return ();
+ open(FILE, "< $filename") || return ();
while (<FILE>) {
chomp;
- push(@text, sprintf(" %-10s %s", $leader, $_));
+ push(@text, sprintf(' %-10s %s', $leader, $_));
$leader = '';
}
close(FILE);
@@ -266,10 +267,10 @@
my($filename, $leader) = @_;
my(@text) = ();
- open(FILE, "<$filename") || die ("Cannot open log file $filename: $!\n");
+ open(FILE, "< $filename") || die ("Cannot open log file $filename: $!\n");
while (<FILE>) {
chomp;
- push(@text, $leader.$_);
+ push(@text, $leader . $_);
}
close(FILE);
@text;
@@ -290,7 +291,7 @@
next;
}
- open(RCS, "-|") || exec($CVS, '-Qn', 'status', $file);
+ open(RCS, '-|') || exec($CVS, '-Qn', 'status', $file);
$rev = '';
$delta = '';
@@ -298,7 +299,7 @@
while (<RCS>) {
- if (/^[ \t]*Repository revision/) {
+ if (/^\s*Repository revision/) {
chomp;
@revline = split(' ', $_);
$rev = $revline[2];
@@ -311,7 +312,7 @@
if (($rev ne '') && ($rcsfile ne '')) {
- open(RCS, "-|") || exec($CVS, '-Qn', 'log', "-r$rev", $file);
+ open(RCS, '-|') || exec($CVS, '-Qn', 'log', "-r$rev", $file);
while (<RCS>) {
if (/^date:/) {
chomp;
@@ -342,19 +343,19 @@
#
if ($rev =~ /^(.*)\.([0-9]+)$/) {
my $prev = $2 - 1;
- my $prev_rev = $1 . '.' . $prev;
+ my $prev_rev = $1 . '.' . $prev;
$prev_rev =~ s/\.[0-9]+\.0$//;# Truncate if first rev on branch
if ($rev eq '1.1') {
- open(DIFF, "-|")
+ open(DIFF, '-|')
|| exec($CVS, '-Qn', 'update', '-p', '-r1.1',
$file);
$diff .= "Index: $file\n=================================="
. "=================================\n";
}
else {
- open(DIFF, "-|")
+ open(DIFF, '-|')
|| exec($CVS, '-Qn', 'diff', '-u',
"-r$prev_rev", "-r$rev", $file);
}
@@ -367,7 +368,7 @@
}
}
- append_line($out, sprintf("%-9s%-12s%s%s", $rev, $delta,
+ append_line($out, sprintf('%-9s%-12s%s%s', $rev, $delta,
$rcsfile, $diff));
}
}
@@ -378,7 +379,7 @@
delete $ENV{'TZ'};
my($sec, $min, $hour, $mday, $mon, $year) = localtime(time);
- $header = sprintf("%-8s %02d/%02d/%02d %02d:%02d:%02d",
+ $header = sprintf('%-8s %02d/%02d/%02d %02d:%02d:%02d',
$login, $year%100, $mon+1, $mday,
$hour, $min, $sec);
}
@@ -397,17 +398,17 @@
else {
return undef;
}
-}
+}
sub do_changes_file {
- return if ($COMMITLOGS ne "yes");
+ return if ($COMMITLOGS ne 'yes');
my($category, @text) = @_;
my($changes);
$changes = "$CVSROOT/CVSROOT/commitlogs/$category";
- if (open(CHANGES, ">>$changes")) {
+ if (open(CHANGES, ">> $changes")) {
print(CHANGES join("\n", @text), "\n\n");
close(CHANGES);
}
@@ -419,7 +420,7 @@
sub mail_notification {
my(@text) = @_;
- print "Mailing the commit message"
+ print 'Mailing the commit message'
. ($debug ? " (to '$MAIL_TO')" : '')
. "...\n";
@@ -429,8 +430,11 @@
}
else {
my $prefix = $sc->param('Subject_Prefix');
+ if ($prefix) {
+ $prefix = insert_tag($prefix, $branch_tag);
+ }
my $subject = ($prefix ? "$prefix " : '')
- . "cvs commit: $ARGV[1]";
+ . 'cvs commit: ' . $ARGV[1];
print(MAIL "From: $FROM\n");
print(MAIL "To: $MAIL_TO\n");
print(MAIL "Subject: $subject\n");
@@ -459,7 +463,7 @@
|| $ENV{'USER'}
|| getlogin
|| (getpwuid($<))[0]
- || sprintf("uid#%d", $<);
+ || sprintf('uid#%d', $<);
#
# Try to form a unique signature for our temporary files from the
# committing user's name and attributes of the log message.
@@ -489,11 +493,11 @@
my $dir = ($#path != 0)
? join('/', @path[1..$#path])
: '.';
-#print("ARGV - ", join(":", @ARGV), "\n");
-#print("files - ", join(":", @files), "\n");
-#print("path - ", join(":", @path), "\n");
-#print("dir - ", $dir, "\n");
-#print("id - ", $id, "\n");
+#print('ARGV - ', join(':', @ARGV), "\n");
+#print('files - ', join(':', @files), "\n");
+#print('path - ', join(':', @path), "\n");
+#print('dir - ', $dir, "\n");
+#print('id - ', $id, "\n");
#
# Map the repository directory to a name for commitlogs.
@@ -505,7 +509,7 @@
# Make sure that at least commits to the CVSROOT get mailed *some*where..
# to the default owner if nowhere else.
#
-if ((! defined($MAIL_TO)) && ($mlist eq "CVSROOT")) {
+if ((! defined($MAIL_TO)) && ($mlist eq 'CVSROOT')) {
$MAIL_TO = ('@MAINTAINER_EMAIL@' || 'Ken...@Go...');
}
@@ -519,10 +523,10 @@
my @text;
push(@text, $header);
push(@text, '');
- push(@text, " " . $ARGV[1]);
+ push(@text, ' ' . $ARGV[1]);
do_changes_file($mlist, @text);
mail_notification(@text) if defined($MAIL_TO);
- exit 0;
+ exit(0);
}
#
@@ -536,13 +540,14 @@
push (@branch_lines, split);
next;
}
-# next if (/^[ \t]+Tag:/ && $state != $STATE_LOG);
+ if (/^\s+Tag:\s+(\S+)/ && ($state != $STATE_LOG))
+ { $branch_tag = $1; next; }
if (/^Modified Files/) { $state = $STATE_CHANGED; next; }
if (/^Added Files/) { $state = $STATE_ADDED; next; }
if (/^Removed Files/) { $state = $STATE_REMOVED; next; }
if (/^Log Message/) { $state = $STATE_LOG; next; }
- s/[ \t\n]+$//; # delete trailing space
-
+ s/[\s\n]+$//; # delete trailing space
+
push (@changed_files, split) if ($state == $STATE_CHANGED);
push (@added_files, split) if ($state == $STATE_ADDED);
push (@removed_files, split) if ($state == $STATE_REMOVED);
@@ -608,8 +613,8 @@
my $tmpfiles = $files[0];
$tmpfiles =~ s,([^a-zA-Z0-9_/]),\\$1,g;
if (! grep(/$tmpfiles$/, $_)) {
- print "More commits to come...\n";
- exit 0
+ print "More commits to come...\n";
+ exit(0);
}
}
@@ -670,3 +675,29 @@
mail_notification(@text) if defined($MAIL_TO);
cleanup_tmpfiles;
exit 0;
+
+#
+# Handle branch tag substitution.
+#
+sub insert_tag {
+ my ($string, $tag) = @_;
+ if (! $tag) {
+ #
+ # No tag, so elide the effectors from the string.
+ #
+ $string =~ s/!B//g;
+ $string =~ s/%B{.*?}B%//g;
+ }
+ else {
+ #
+ # First, substitute the tag name.
+ #
+ $string =~ s/!B/$tag/g;
+ #
+ # Now remove the effector delimiters, since their content is
+ # to stay.
+ #
+ $string =~ s/(?:%B{|}B%)//g;
+ }
+ return $string;
+}
|
|
From: Ken C. <co...@us...> - 2002-12-15 05:01:43
|
coar 02/12/14 21:01:43
Modified: . TODO ChangeLog
Log:
note that it is essentially done
Revision Changes Path
1.22 +0 -3 spackle/TODO
Index: TODO
===================================================================
RCS file: /cvsroot/spackle/spackle/TODO,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- TODO 10 Dec 2002 17:47:42 -0000 1.21
+++ TODO 15 Dec 2002 05:01:43 -0000 1.22
@@ -58,6 +58,3 @@
o add --enable-readonly to enhance the karma message to say 'no
commits allowed' (maybe specify another file to be displayed?)
-
-o add a way to customise the subject of commit messages according
- to the branch (if any) involved
1.12 +2 -0 spackle/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvsroot/spackle/spackle/ChangeLog,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- ChangeLog 29 Sep 2002 14:34:58 -0000 1.11
+++ ChangeLog 15 Dec 2002 05:01:43 -0000 1.12
@@ -1,6 +1,8 @@
Changelog for Spackle; newest stuff at the top.
+ o Add !B and %B{}B% effectors to allow inserting branch tags
+ in Subject_Prefix
o Add 'make clean' to get rid of the files generated by
./configure, and 'make distclean' to get rid of all
generated files except the output from autoconf
|