){
- next unless m{ ^ root .*
- (
- perl .* /bin/paused \s # before we set arg0
- |
- paused:
- )
- }x;
- $running++;
-}
-close P or die "Could not close P";
-unless ($running){
- print "Process paused not found\n";
- exit 1;
-}
diff --git a/etc/puppet/modules/pause/files/usr/lib64/mon/mon.d/rersyncrecent.monitor b/etc/puppet/modules/pause/files/usr/lib64/mon/mon.d/rersyncrecent.monitor
deleted file mode 100755
index 73d00796c..000000000
--- a/etc/puppet/modules/pause/files/usr/lib64/mon/mon.d/rersyncrecent.monitor
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-
-my $aumu = shift or die "Usage: ... ){
- next unless m{ ^ PAUSE | authors | modules | scripts }x;
- $running++;
-}
-close P or die "Could not close P";
-unless ($running >= 4){
- print "Some rsync target missing\n";
- exit 1;
-}
diff --git a/etc/puppet/modules/pause/files/usr/lib64/mon/mon.d/rsyncd2.monitor b/etc/puppet/modules/pause/files/usr/lib64/mon/mon.d/rsyncd2.monitor
deleted file mode 100755
index 0b18191f5..000000000
--- a/etc/puppet/modules/pause/files/usr/lib64/mon/mon.d/rsyncd2.monitor
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/perl
-#
-use strict;
-$ENV{USER} = "andk";
-$ENV{RSYNC_PASSWD} = "not_the_password";
-
-open my $P, "rsync --port=8732 localhost::PAUSE 2>&1 |" or die "Could not fork: $!";
-my $running;
-my @got;
-while (<$P>){
- push @got, $_;
- next unless m{ ERROR }ix;
- $running++;
-}
-close $P; # must fail, rsync asks for password and refuses to run! # or die "Could not close: $!";
-unless ($running >= 1){
- local $"="";
- print "error message missing, got[@got]\n";
- exit 1;
-}
diff --git a/etc/rsyncd2.conf b/etc/rsyncd2.conf
deleted file mode 100644
index b57dbe3a1..000000000
--- a/etc/rsyncd2.conf
+++ /dev/null
@@ -1,10 +0,0 @@
-max connections = 16
-log file = /var/log/rsyncd2
-transfer logging = true
-use chroot = true
-port = 8732
-
-[PAUSE]
- path = /home/ftp/pub/PAUSE
- auth users = *
- secrets file = /etc/rsyncd.passwd
diff --git a/ftpd/messages/incoming.txt b/ftpd/messages/incoming.txt
deleted file mode 100644
index 648269f87..000000000
--- a/ftpd/messages/incoming.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-Upload into this directory
-==========================
-
-is only allowed to registered CPAN developers for files that are
-to be uploaded into the CPAN.
-
-If you have any questions regarding this policy, please contact
-modules@perl.org.
-
-Thank you,
-andreas koenig
-2003-01-11
-
diff --git a/mirror/.cvsignore b/mirror/.cvsignore
deleted file mode 100644
index a9fbf991f..000000000
--- a/mirror/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-mymirror.config
diff --git a/mirror/mirror.defaults b/mirror/mirror.defaults
deleted file mode 100644
index d533cce77..000000000
--- a/mirror/mirror.defaults
+++ /dev/null
@@ -1,34 +0,0 @@
-
-package=defaults
- compress_excl+|\.sig|\.html$|^\.notar$|-z|\.tgz$|\.taz$|\.tar.Z|\.arc$|\.zip$|\.lzh$|\.zoo$|\.exe$|\.lha$|\.zom$|\.gif$|\.jpeg$|\.jpg$|\.mpeg$|\.au$|read.*me|index|\.message|info|faq|gzip|compress|\.png$|(^|/)\.\.?$
- compress_patt=.
- compress_prog=gzip
- delete_excl=((^|/)\.(mirror|notar)|\.meta)$
- mode_copy=false
- dir_mode=0755
- do_deletes=true
- exclude_patt=(^|/)(\.mirror|core$|\.cap|\.in\..*\.$|MIRROR.LOG|#.*#|\.FSP|\.cache|\.zipped|\.notar|\.message|lost+found/|.*[~ ])
- file_mode=0644
-# follow_local_symlinks=.
-# from jost krieger:
- get_newer=yes
-# from jost krieger:
- get_size_change=yes
- group=0
- hostname=pause.perl.org
- local_dir=/home/ftp/pub/PAUSE/
- local_ignore=.*(readme|CHECKSUMS)$
- mail_prog=/home/k/PAUSE/bin/mirrormail.pl
- mail_to=k
- max_days=60
- max_delete_files=50%
- max_delete_dirs=50%
- name_mappings=s:\.\./:__/:g
- remote_password=k@pause.perl.org
- update_log=
- user=0
-# passive_ftp=true
-# trying with squid...NOPE
-# proxy=true
-# proxy_ftp_port=3128
-# proxy_gateway=localhost
diff --git a/mirror/mirror.defaults-pause-us b/mirror/mirror.defaults-pause-us
deleted file mode 100644
index c8b14ce48..000000000
--- a/mirror/mirror.defaults-pause-us
+++ /dev/null
@@ -1,34 +0,0 @@
-
-package=defaults
- compress_excl+|\.sig|\.html$|^\.notar$|-z|\.tgz$|\.taz$|\.tar.Z|\.arc$|\.zip$|\.lzh$|\.zoo$|\.exe$|\.lha$|\.zom$|\.gif$|\.jpeg$|\.jpg$|\.mpeg$|\.au$|read.*me|index|\.message|info|faq|gzip|compress|\.png$|(^|/)\.\.?$
- compress_patt=.
- compress_prog=gzip
- delete_excl=((^|/)\.(mirror|notar)|\.meta)$
- mode_copy=false
- dir_mode=0755
- do_deletes=true
- exclude_patt=(^|/)(\.mirror|core$|\.cap|\.in\..*\.$|MIRROR.LOG|#.*#|\.FSP|\.cache|\.zipped|\.notar|\.message|lost+found/|.*[~ ])
- file_mode=0644
-# follow_local_symlinks=.
-# from jost krieger:
- get_newer=yes
-# from jost krieger:
- get_size_change=yes
- group=0
- hostname=pause.perl.org
- local_dir=/home/ftp/pub/PAUSE/
- local_ignore=.*(readme|CHECKSUMS)$
- mail_prog=/home/puppet/pause/bin/mirrormail.pl
- mail_to=k
- max_days=60
- max_delete_files=50%
- max_delete_dirs=50%
- name_mappings=s:\.\./:__/:g
- remote_password=k@pause.perl.org
- update_log=
- user=0
-# passive_ftp=true
-# trying with squid...NOPE
-# proxy=true
-# proxy_ftp_port=3128
-# proxy_gateway=localhost
diff --git a/mirror/mymirror.config b/mirror/mymirror.config
deleted file mode 100644
index 424de9135..000000000
--- a/mirror/mymirror.config
+++ /dev/null
@@ -1,355 +0,0 @@
-# $Id: mymirror.config,v 1.13 2000/12/31 12:01:57 k Exp k $
-
-package =msql
- site =bond.edu.au
- remote_dir =/pub/Minerva/msql
- local_dir +pub/etc/msql
- get_patt =^[fm]
- recursive =false
- max_days =22
- skip =moved to hughes
-
-package =cpantxt
- site =ftp.funet.fi
- remote_dir =/pub/languages/perl/CPAN/
- local_dir =/home/ftp/pub/from.CPAN/
- # CPAN.html links into authors/ and that's not there,
- # but I prefer to see the symlink as a reminder
- make_bad_symlinks=true
- compress_patt=
- do_deletes =true
- local_ignore=src|ports
- get_patt =.
- recursive =false
- max_days =9999
- mail_prog =/bin/true
- skip =
-
-package =cpanports
- site =ftp.funet.fi
- remote_dir =/pub/languages/perl/CPAN/ports/
- local_dir =/home/ftp/pub/from.CPAN/ports/
- compress_patt=
- #local_ignore=
- #exclude_patt+\.mirror\.log
- do_deletes=true
- max_delete_files=25%
- get_patt =.
- recursive =true
- max_days =9999
- skip =no yet ready, timestamp problems
-
-package =cpansrc
- site =ftp.funet.fi
- remote_dir =/pub/languages/perl/CPAN/src/
- local_dir =/home/ftp/pub/from.CPAN/src/
- get_patt =.
- # exclude_patt=FTP_LS_
- max_days =30
- recursive =true
- skip =mirroring not yet ready
-
-package =AMOSS
- site =ftp.huji.ac.il
- remote_dir =/users/amoss/
- local_dir +authors/id/A/AM/AMOSS
- get_patt =^SGI
- recursive =false
- max_days =22
- skip =
-
-package =FMC
- site =ftp.pasteur.fr
- remote_dir =/pub/Perl/
- local_dir +authors/id/F/FM/FMC
- get_patt =^Sx[-D]
- recursive =false
- max_days =22
- skip =
-
-package =MICB
- site =ftp.ox.ac.uk
- remote_dir =/pub/perl/for-CPAN
- local_dir +authors/id/M/MI/MICB
- get_patt =\.(gz|pm)$
- max_days =22
- recursive =false
- flags_nonrecursive+L
- skip =
-
-# Ilya's ftp directories are a constant cause for grief for the mirror
-# program and its relation to symlinks. I get by far to many emails
-# about a symlink being created, but I see no clear pattern...
-
-package =ILYAZ
- site =ftp.math.ohio-state.edu
- remote_dir =/pub/users/ilya/perl
- local_dir +authors/id/I/IL/ILYAZ
- get_patt =.
- compress_patt=
- do_deletes =false
-# do_deletes must be false for ilya, because of the many old files there
- follow_local_symlinks=.
- max_days =222
- recursive =true
- # make_bad_symlinks=true
- skip =
-
-package =emacs
- site =ftp.math.ohio-state.edu
- remote_dir =/pub/users/ilya/emacs
- local_dir +etc/emacs/ilyaz
- get_patt =.
- max_days =22
- recursive =true
- flags_recursive+L
- skip =no space on emergency disk
-
-
-package =DMEGG
- site =aix1.uottawa.ca
- remote_dir =/pub/dmeggins/
- local_dir +authors/id/D/DM/DMEGG
- get_patt =^SGMLSpm-
- max_days =22
- recursive =false
- skip =
-
-package =MEWP
- site =ftp.demon.co.uk
- remote_dir =/pub/perl/db/mod/Sybase/
- local_dir +authors/id/M/ME/MEWP
- get_patt =^syb
- max_days =22
- recursive =false
- skip =now uses CPAN directly
-
-package =GSM
- site =ftp.wellfleet.com
- remote_dir =/netman/snmp/perl5/
- local_dir +authors/id/G/GS/GSM
- get_patt =.
- do_deletes =true
- max_days =3222
- recursive =false
- skip =
-
-package =ADESC
- site =ftp.mcqueen.com
- remote_dir =/pub/hermetica/descarte/perl/modules/
- local_dir +authors/id/A/AD/ADESC
- get_patt =.
- max_days =22
- recursive =false
- flags_nonrecursive+L
- skip =Al has moved
-
-package =LDS
- site =ftp-genome.wi.mit.edu
- remote_dir =/pub/software/WWW/
- local_dir +authors/id/L/LD/LDS
- get_patt =^(CGI|GD)[\.\-](modules-|pm-)?\d+\.[\d\w]+\.tar\.gz$
- do_deletes =false
- max_days =22
- max_delete_files =3
- recursive =false
- flags_nonrecursive+L
- skip =
-
-package =AKSTE
- site =hub.ucsb.edu
- remote_dir =/pub/prog/perl/
- local_dir +authors/id/A/AK/AKSTE
- get_patt =^(PrintArray-|Term-Query-)\d.*\.tar.gz$
- max_days =22
- recursive =false
- skip =too many error messages recently
-
-package =TIMB
- site =ftp.demon.co.uk
- remote_dir =/pub/perl/db
- local_dir +authors/id/T/TI/TIMB
- get_patt =^(D|perl5)
- do_deletes =false
- max_days =22
- recursive =true
- flags_recursive+L
- skip =Tim said "you can stop mirroring demon all together"
-
-package =YVESP
- site =ftp.demon.co.uk
- remote_dir =/pub/perl/db/mod/Pg95
- local_dir +authors/id/Y/YV/YVESP
- get_patt =.
- max_days =22
- recursive =false
- skip =disabled since 1996-02-19. Dead directroy?
-
-package =MERGL
- site =ftp.demon.co.uk
- remote_dir =/pub/perl/db/mod/Pg95
- local_dir +authors/id/M/ME/MERGL
- get_patt =.
- max_days =22
- recursive =false
- skip =edmund now loads up directly to pause
-
-
-package =GUYDX
- site =moulon.inra.fr
- remote_dir =/pub/pTk/
- local_dir +authors/id/G/GU/GUYDX
- follow_local_symlinks=.
- get_patt =.
- make_bad_symlinks=true
- max_days =22
- recursive =false
- skip =
-
-package =TOMC_scripts
- site =perl.com
- remote_dir =/perl/scripts/
- local_dir +authors/id/T/TO/TOMC/scripts
- get_patt =.
- exclude_patt =ghindex\.html
- max_days =90
- recursive =true
- skip =
-
-package =TOMC_modules
- site =ftp.perl.com
- remote_dir =/pub/perl/tchrist/modules/
- local_dir +authors/id/T/TO/TOMC/modules
- get_patt =.
- exclude_patt =ghindex\.html
- max_days =90
- recursive =true
- skip =
-
-package =ULPFR
- site =ls6-www.informatik.uni-dortmund.de
- remote_dir =/pub/perl/perl5/modules/
- local_dir +authors/id/U/UL/ULPFR
- do_deletes =true
- get_patt =.
- delete_patt =.
- max_delete_files=10%
- max_days =22
- recursive =false
- skip =Cancelled because unreliable
-
-# memo 2003-02-20: I just got rid of accumulated old files with
-# perl /usr/local/mirror/mirror.pl -p MUIR -kmax_days=0 \
-# -kmax_delete_files=60 /usr/local/mirror/mymirror.config
-# but after that I still had to delete manually dozens of README files
-package =MUIR
- site =ftp.idiom.com
- remote_dir =/users/muir/CPAN/
- local_dir +authors/id/M/MU/MUIR
- do_deletes =true
- get_patt =.
- max_days =42
- recursive =true
- skip =
-
-package =GREGG
- site =fruitfly.berkeley.edu
- remote_dir =/pub/bioTk/
- local_dir +authors/id/G/GR/GREGG
- get_patt =.
- max_days =22
- recursive =false
- skip =not yet verified
-
-package =KGB
- site =ftp.ast.cam.ac.uk
- remote_dir =/pgperl/perl5/
- local_dir +authors/id/K/KG/KGB
- get_patt =PGPLOT.*_src.*
- max_days =22
- recursive =false
- skip =
-
-package =STANM
- site =skyler.arc.ab.ca
- remote_dir =/pub/perl/
- local_dir +authors/id/S/ST/STANM
- get_patt =.
- max_days =22
- recursive =false
- skip =
-
-package =NEILB
- site =ftp.khoral.com
- remote_dir =/pub/weblint/
- local_dir +authors/id/N/NE/NEILB
- get_patt =weblint.*(\.tar\.gz|\.ps)
- max_days =22
- recursive =false
- skip =because Neil has moved away from khoros
-
-package =FSG
- site =coriolan.amicus.com
- remote_dir =/pub/
- local_dir +authors/id/F/FS/FSG
- get_patt =^Penguin-
- max_days =22
- recursive =false
- skip =seems to be dead
-
-package =SHUTTON
- site =habanero.ucs.indiana.edu
- remote_dir =/pub/perl/SHUTTON/
- local_dir +authors/id/S/SH/SHUTTON
- get_patt =.
- max_days =22
- recursive =false
- skip =he recently uploaded something, have to clarify status
-
-package =SPIDB
- site =ftp.ma.ultranet.com
- remote_dir =~spiderb/public_html/perl/ext/
- local_dir +authors/id/S/SP/SPIDB
- get_patt =.
- max_days =22
- recursive =false
- skip =
-
-package =DSTALDER
- site =ftp.daft.com
- remote_dir =/pub/Perl5/pause/debian/
- local_dir +authors/id/D/DS/DSTALDER
- get_patt =.
- max_days =22
- recursive =false
- skip =not yet verified
-
-package =PHENSON
- site =www.intranet.csupomona.edu
- remote_dir =/~henson/www/projects/File-LockFile-Lock-0.15.tar.gzf/dist/
- local_dir +authors/id/P/PH/PHENSON
- get_patt =.
- max_days =22
- recursive =false
- skip =not yet verified
-
-package =FTASSIN
- site =ftp.oleane.net
- remote_dir =/private/fta/perl/cpan/
- local_dir +authors/id/F/FT/FTASSIN
- get_patt =.
- max_days =22
- recursive =false
- skip =
-
-package =HAKANARDO
- site =hobbe.ub2.lu.se
- remote_dir =/pub/CPAN/
- local_dir +authors/id/H/HA/HAKANARDO
- follow_local_symlinks=.
- do_deletes =true
- get_patt =.
- max_days =44
- recursive =false
- skip =
-
diff --git a/svn/cpanpm/hooks/post-commit b/svn/cpanpm/hooks/post-commit
deleted file mode 100755
index 154836029..000000000
--- a/svn/cpanpm/hooks/post-commit
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/sh
-
-# POST-COMMIT HOOK
-#
-# The post-commit hook is invoked after a commit. Subversion runs
-# this hook by invoking a program (script, executable, binary,
-# etc.) named `post-commit' (for which
-# this file is a template) with the following ordered arguments:
-#
-# [1] REPOS-PATH (the path to this repository)
-# [2] REV (the number of the revision just committed)
-#
-# Because the commit has already completed and cannot be undone,
-# the exit code of the hook program is ignored. The hook program
-# can use the `svnlook' utility to help it examine the
-# newly-committed tree.
-#
-# On a Unix system, the normal procedure is to have `post-commit'
-# invoke other programs to do the real work, though it may do the
-# work itself too.
-#
-# Note that `post-commit' must be executable by the user(s) who will
-# invoke it (typically the user httpd runs as), and that user must
-# have filesystem-level permission to access the repository.
-#
-# On a Windows system, you should name the hook program
-# `post-commit.bat' or `post-commit.exe',
-# but the basic idea is the same.
-#
-# Here is an example hook script, for a Unix /bin/sh interpreter:
-
-REPOS="$1"
-REV="$2"
-
-/home/SVN/repos/pause/hooks/commit-email.pl "$REPOS" "$REV" cpanpm-code-commits
-# log-commit.py --repository "$REPOS" --revision "$REV"
-
-# -commit-email.pl "$REPOS" "$REV" commit-watchers@example.org
-# -log-commit.py --repository "$REPOS" --revision "$REV"
-# +/usr/local/public-svn/Perl-Repository-APC/hooks/commit-email.pl "$REPOS" "$REV"
- # k@k242.linux.bogus
-# +# log-commit.py --repository "$REPOS" --revision "$REV"
diff --git a/svn/pause/hooks/commit-email.pl b/svn/pause/hooks/commit-email.pl
deleted file mode 100755
index 7fd69092e..000000000
--- a/svn/pause/hooks/commit-email.pl
+++ /dev/null
@@ -1,583 +0,0 @@
-#!/usr/bin/perl -w
-
-# ====================================================================
-# commit-email.pl: send a commit email for commit REVISION in
-# repository REPOS to some email addresses.
-#
-# For usage, see the usage subroutine or run the script with no
-# command line arguments.
-#
-# $HeadURL: http://svn.collab.net/repos/svn/http://svn.collab.net/repos/svn/branches/release-0.19.1/tools/hook-scripts/commit-email.pl.in $
-# $LastChangedDate: 2003-02-08 12:26:25 -0500 (Sat, 08 Feb 2003) $
-# $LastChangedBy: dwhedon $
-# $LastChangedRevision: 4797 $
-#
-# ====================================================================
-# Copyright (c) 2000-2003 CollabNet. All rights reserved.
-#
-# This software is licensed as described in the file COPYING, which
-# you should have received as part of this distribution. The terms
-# are also available at http://subversion.tigris.org/license-1.html.
-# If newer versions of this license are posted there, you may use a
-# newer version instead, at your option.
-#
-# This software consists of voluntary contributions made by many
-# individuals. For exact contribution history, see the revision
-# history and logs, available at http://subversion.tigris.org/.
-# ====================================================================
-
-use strict;
-use Carp;
-
-######################################################################
-# Configuration section.
-
-# Sendmail path.
-my $sendmail = "/usr/sbin/sendmail";
-
-# Svnlook path.
-my $svnlook = "/usr/bin/svnlook";
-
-# By default, when a file is deleted from the repository, svnlook diff
-# prints the entire contents of the file. If you want to save space
-# in the log and email messages by not printing the file, then set
-# $no_diff_deleted to 1.
-my $no_diff_deleted = 0;
-
-# Since the path to svnlook depends upon the local installation
-# preferences, check that the required programs exist to insure that
-# the administrator has set up the script properly.
-{
- my $ok = 1;
- foreach my $program ($sendmail, $svnlook)
- {
- if (-e $program)
- {
- unless (-x $program)
- {
- warn "$0: required program `$program' is not executable, ",
- "edit $0.\n";
- $ok = 0;
- }
- }
- else
- {
- warn "$0: required program `$program' does not exist, edit $0.\n";
- $ok = 0;
- }
- }
- exit 1 unless $ok;
-}
-
-
-######################################################################
-# Initial setup/command-line handling.
-
-# Each value in this array holds a hash reference which contains the
-# associated email information for one project. Start with an
-# implicit rule that matches all paths.
-my @project_settings_list = (&new_project);
-
-# Process the command line arguments till there are none left. The
-# first two arguments that are not used by a command line option are
-# the repository path and the revision number.
-my $repos;
-my $rev;
-
-# Use the reference to the first project to populate.
-my $current_project = $project_settings_list[0];
-
-# This hash matches the command line option to the hash key in the
-# project. If a key exists but has a false value (''), then the
-# command line option is allowed but requires special handling.
-my %opt_to_hash_key = ('--from' => 'from_address',
- '-h' => 'hostname',
- '-l' => 'log_file',
- '-m' => '',
- '-r' => 'reply_to',
- '-s' => 'subject_prefix');
-
-while (@ARGV)
- {
- my $arg = shift @ARGV;
- if ($arg =~ /^-/)
- {
- my $hash_key = $opt_to_hash_key{$arg};
- unless (defined $hash_key)
- {
- die "$0: command line option `$arg' is not recognized.\n";
- }
-
- unless (@ARGV)
- {
- die "$0: command line option `$arg' is missing a value.\n";
- }
- my $value = shift @ARGV;
-
- if ($hash_key)
- {
- $current_project->{$hash_key} = $value;
- }
- else
- {
- # Here handle -m.
- unless ($arg eq '-m')
- {
- die "$0: internal error: should only handle -m here.\n";
- }
- $current_project = &new_project;
- $current_project->{match_regex} = $value;
- push(@project_settings_list, $current_project);
- }
- }
- elsif ($arg =~ /^-/)
- {
- die "$0: command line option `$arg' is not recognized.\n";
- }
- else
- {
- if (! defined $repos)
- {
- $repos = $arg;
- }
- elsif (! defined $rev)
- {
- $rev = $arg;
- }
- else
- {
- push(@{$current_project->{email_addresses}}, $arg);
- }
- }
- }
-
-# If the revision number is undefined, then there were not enough
-# command line arguments.
-&usage("$0: too few arguments.") unless defined $rev;
-
-# Check the validity of the command line arguments. Check that the
-# revision is an integer greater than 0 and that the repository
-# directory exists.
-unless ($rev =~ /^\d+/ and $rev > 0)
- {
- &usage("$0: revision number `$rev' must be an integer > 0.");
- }
-unless (-e $repos)
- {
- &usage("$0: repos directory `$repos' does not exist.");
- }
-unless (-d _)
- {
- &usage("$0: repos directory `$repos' is not a directory.");
- }
-
-# Check that all of the regular expressions can be compiled and
-# compile them.
-{
- my $ok = 1;
- for (my $i=0; $i<@project_settings_list; ++$i)
- {
- my $match_regex = $project_settings_list[$i]->{match_regex};
-
- # To help users that automatically write regular expressions
- # that match the root directory using ^/, remove the / character
- # because subversion paths, while they start at the root level,
- # do not begin with a /.
- $match_regex =~ s#^\^/#^#;
-
- my $match_re;
- eval { $match_re = qr/$match_regex/ };
- if ($@)
- {
- warn "$0: -m regex #$i `$match_regex' does not compile:\n$@\n";
- $ok = 0;
- next;
- }
- $project_settings_list[$i]->{match_re} = $match_re;
- }
- exit 1 unless $ok;
-}
-
-######################################################################
-# Harvest data using svnlook.
-
-# Change into /tmp so that svnlook diff can create its .svnlook
-# directory.
-my $tmp_dir = '/tmp';
-chdir($tmp_dir)
- or die "$0: cannot chdir `$tmp_dir': $!\n";
-
-# Get the author, date, and log from svnlook.
-my @svnlooklines = &read_from_process($svnlook, 'info', $repos, '-r', $rev);
-my $author = shift @svnlooklines;
-my $date = shift @svnlooklines;
-shift @svnlooklines;
-my @log = map { "$_\n" } @svnlooklines;
-
-# Figure out what directories have changed using svnlook.
-my @dirschanged = &read_from_process($svnlook, 'dirs-changed', $repos,
- '-r', $rev);
-
-# Lose the trailing slash in the directory names if one exists, except
-# in the case of '/'.
-my $rootchanged = 0;
-for (my $i=0; $i<@dirschanged; ++$i)
- {
- if ($dirschanged[$i] eq '/')
- {
- $rootchanged = 1;
- }
- else
- {
- $dirschanged[$i] =~ s#^(.+)[/\\]$#$1#;
- }
- }
-
-# Figure out what files have changed using svnlook.
-@svnlooklines = &read_from_process($svnlook, 'changed', $repos, '-r', $rev);
-
-# Parse the changed nodes.
-my @adds;
-my @dels;
-my @mods;
-foreach my $line (@svnlooklines)
- {
- my $path = '';
- my $code = '';
-
- # Split the line up into the modification code and path, ignoring
- # property modifications.
- if ($line =~ /^(.). (.*)$/)
- {
- $code = $1;
- $path = $2;
- }
-
- if ($code eq 'A')
- {
- push(@adds, $path);
- }
- elsif ($code eq 'D')
- {
- push(@dels, $path);
- }
- else
- {
- push(@mods, $path);
- }
- }
-
-# Get the diff from svnlook.
-my @no_diff_deleted = $no_diff_deleted ? ('--no-diff-deleted') : ();
-my @difflines = &read_from_process($svnlook, 'diff', $repos,
- '-r', $rev, @no_diff_deleted);
-
-######################################################################
-# Modified directory name collapsing.
-
-# Collapse the list of changed directories only if the root directory
-# was not modified, because otherwise everything is under root and
-# there's no point in collapsing the directories, and only if more
-# than one directory was modified.
-my $commondir = '';
-if (!$rootchanged and @dirschanged > 1)
- {
- my $firstline = shift @dirschanged;
- my @commonpieces = split('/', $firstline);
- foreach my $line (@dirschanged)
- {
- my @pieces = split('/', $line);
- my $i = 0;
- while ($i < @pieces and $i < @commonpieces)
- {
- if ($pieces[$i] ne $commonpieces[$i])
- {
- splice(@commonpieces, $i, @commonpieces - $i);
- last;
- }
- $i++;
- }
- }
- unshift(@dirschanged, $firstline);
-
- if (@commonpieces)
- {
- $commondir = join('/', @commonpieces);
- my @new_dirschanged;
- foreach my $dir (@dirschanged)
- {
- if ($dir eq $commondir)
- {
- $dir = '.';
- }
- else
- {
- $dir =~ s#^$commondir/##;
- }
- push(@new_dirschanged, $dir);
- }
- @dirschanged = @new_dirschanged;
- }
- }
-my $dirlist = join(' ', @dirschanged);
-
-######################################################################
-# Assembly of log message.
-
-# Put together the body of the log message.
-my @body;
-push(@body, "Author: $author\n");
-push(@body, "Date: $date\n");
-push(@body, "New Revision: $rev\n");
-push(@body, "\n");
-if (@adds)
- {
- @adds = sort @adds;
- push(@body, "Added:\n");
- push(@body, map { " $_\n" } @adds);
- }
-if (@dels)
- {
- @dels = sort @dels;
- push(@body, "Removed:\n");
- push(@body, map { " $_\n" } @dels);
- }
-if (@mods)
- {
- @mods = sort @mods;
- push(@body, "Modified:\n");
- push(@body, map { " $_\n" } @mods);
- }
-push(@body, "Log:\n");
-push(@body, @log);
-push(@body, "\n");
-push(@body, map { /[\r\n]+$/ ? $_ : "$_\n" } @difflines);
-
-# Go through each project and see if there are any matches for this
-# project. If so, send the log out.
-foreach my $project (@project_settings_list)
- {
- my $match_re = $project->{match_re};
- my $match = 0;
- foreach my $path (@dirschanged, @adds, @dels, @mods)
- {
- if ($path =~ $match_re)
- {
- $match = 1;
- last;
- }
- }
-
- next unless $match;
-
- my @email_addresses = @{$project->{email_addresses}};
- my $userlist = join(' ', @email_addresses);
- my $from_address = $project->{from_address};
- my $hostname = $project->{hostname};
- my $log_file = $project->{log_file};
- my $reply_to = $project->{reply_to};
- my $subject_prefix = $project->{subject_prefix};
- my $subject;
-
- if ($commondir ne '')
- {
- $subject = "rev $rev - in $commondir: $dirlist";
- }
- else
- {
- $subject = "rev $rev - $dirlist";
- }
- if ($subject_prefix =~ /\w/)
- {
- $subject = "$subject_prefix $subject";
- }
- my $mail_from = $author;
-
- if ($from_address =~ /\w/)
- {
- $mail_from = $from_address;
- }
- elsif ($hostname =~ /\w/)
- {
- $mail_from = "$mail_from\@$hostname";
- }
-
- my @head;
- push(@head, "To: $userlist\n");
- push(@head, "From: $mail_from\n");
- push(@head, "Subject: $subject\n");
- push(@head, "Reply-to: $reply_to\n") if $reply_to;
-
- ### Below, we set the content-type etc, but see these comments
- ### from Greg Stein on why this is not a full solution.
- #
- # From: Greg Stein