summaryrefslogtreecommitdiff
path: root/Porting/check-cpan-pollution
diff options
context:
space:
mode:
authorSteffen Mueller <smueller@cpan.org>2010-01-26 17:31:52 +0100
committerSteffen Mueller <smueller@cpan.org>2010-01-26 17:34:11 +0100
commita45a6dbc08e2d955a291bbec2304e04bf4a25c14 (patch)
tree631ec6470ce3e6897824725c17d8bff59b025082 /Porting/check-cpan-pollution
parent69c406f30530804d323330c2addaad54290ef3b8 (diff)
downloadperl-a45a6dbc08e2d955a291bbec2304e04bf4a25c14.tar.gz
Check for Maintainers.pl updates
Make Porting/check-cpan-pollution test whether a given, presumably safe commit to dual-lived modules also updated Porting/Maintainers.pl.
Diffstat (limited to 'Porting/check-cpan-pollution')
-rw-r--r--Porting/check-cpan-pollution21
1 files changed, 17 insertions, 4 deletions
diff --git a/Porting/check-cpan-pollution b/Porting/check-cpan-pollution
index fb2d50e8a3..231363495b 100644
--- a/Porting/check-cpan-pollution
+++ b/Porting/check-cpan-pollution
@@ -7,12 +7,13 @@ use constant GITCMD => 'git';
sub usage {
print <<HERE;
-Usage: $0 [options] [<start-commit> [<end-commit>]]
+Usage: $0 [options] [<start-commit> [<end-commit>]]
Scans the commit logs for commits that are potentially, illegitimately
touching modules that are primarily maintained outside of the perl core.
Also checks for commits that span multiple distributions in cpan/ or dist/.
-Ignores MANIFEST and Porting/Maintainers.pl.
+Makes sure that updated CPAN distributions also update Porting/Maintainers.pl,
+but otherwise ignores changes to that file (and MANIFEST).
Skip the <start-commit> to go back indefinitely. <end-commit> defaults to
HEAD.
@@ -104,7 +105,14 @@ sub check_commit {
my $safe = shift;
my $unsafe = shift;
- my @files = grep {$_ ne 'MANIFEST' and $_ ne 'Porting/Maintainers.pl'}
+ # Note to self: Adding any more greps and such will make this
+ # look even more silly. Just use a single foreach, smart guy!
+ my $touches_maintainers_pl = 0;
+ my @files = grep {
+ $touches_maintainers_pl = 1
+ if $_ eq 'Porting/Maintainers.pl';
+ $_ ne 'MANIFEST' and $_ ne 'Porting/Maintainers.pl'
+ }
@{$commit->{files}};
my @touching_cpan = grep {/^cpan\//} @files;
return if not @touching_cpan;
@@ -128,6 +136,11 @@ sub check_commit {
$commit->{msg} = 'Touched multiple directories under cpan/';
push @$unsafe, $commit;
}
+ elsif (not $touches_maintainers_pl) {
+ $commit->{msg} = 'Touched files under cpan/, but does not update '
+ . 'Porting/Maintainers.pl';
+ push @$unsafe, $commit;
+ }
elsif ($commit->{commit_msg} =~ /(?:up(?:grad|dat)|import)(?:ed?|ing)/i) {
$commit->{msg} = 'Touched files under cpan/ with '
. '"upgrading"-like commit message';
@@ -148,7 +161,7 @@ sub check_commit {
@touching_dist;
$touches_others = @files - @touching_dist;
my $touches_multiple_dists = (keys(%touched_dist_dirs) > 1);
-
+
if (@touching_dist) {
if ($touches_others) {
$commit->{msg} = 'Touched files under dist/ and other locations';