[Bps-public-commit] RT-Integration-VersionControl branch, master, created. 47252f4026db7081da554becd1b5d174e4d6e60b
Thomas Sibley
trs at bestpractical.com
Mon May 27 02:02:30 EDT 2013
The branch, master has been created
at 47252f4026db7081da554becd1b5d174e4d6e60b (commit)
- Log -----------------------------------------------------------------
commit 6fdce8f64a70e44e77be69d49fd6b577ee930d96
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Mon May 31 13:21:49 2004 +0000
Creating a blank template directory
commit f9f80c98af30e4efa7f584285385cf88003fbdd9
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Tue Jun 1 02:46:53 2004 +0000
Initial check. anyone wanna try it?
diff --git a/MANIFEST b/MANIFEST
new file mode 100644
index 0000000..01d8e61
--- /dev/null
+++ b/MANIFEST
@@ -0,0 +1,15 @@
+html/SVN/PullUpdate.html
+inc/Module/Install.pm
+inc/Module/Install/Base.pm
+inc/Module/Install/Can.pm
+inc/Module/Install/Fetch.pm
+inc/Module/Install/Makefile.pm
+inc/Module/Install/Metadata.pm
+inc/Module/Install/RTx.pm
+inc/Module/Install/Win32.pm
+inc/Module/Install/WriteAll.pm
+lib/RT/Integration/SVN.pm
+Makefile.PL
+MANIFEST This list of files
+META.yml
+README
diff --git a/META.yml b/META.yml
new file mode 100644
index 0000000..b13e805
--- /dev/null
+++ b/META.yml
@@ -0,0 +1,13 @@
+name: RT-Integration-SVN
+version: 0.01_01
+abstract: RT Integration-SVN Extension
+author: Jesse Vincent <jesse at bestpractical.com>
+license: GPLv2
+distribution_type: module
+build_requires:
+ Module::Install::RTx: 0
+no_index:
+ directory:
+ - html
+ - inc
+generated_by: Module::Install version 0.33
diff --git a/Makefile.PL b/Makefile.PL
new file mode 100644
index 0000000..2b5171b
--- /dev/null
+++ b/Makefile.PL
@@ -0,0 +1,9 @@
+use inc::Module::Install;
+
+RTx('RT-Integration-SVN');
+license('GPLv2');
+version('0.01_01');
+build_requires('Module::Install::RTx');
+author('Jesse Vincent <jesse at bestpractical.com>');
+
+&WriteAll;
diff --git a/README b/README
new file mode 100644
index 0000000..485acaf
--- /dev/null
+++ b/README
@@ -0,0 +1,67 @@
+This tool allows an RT 3.x instance to integrate with a Subversion revision
+control system.
+
+To configure your subversion server to talk to an RT instance, you'll need
+to do a bit of setup.
+
+
+In your RT::SiteConfig, set up the following variables:
+
+Set($RT::PathToSvn, '/usr/bin/svn'); # or wherever your svn(1) binary lives
+
+Set($RT::SvnRepository, 'http://svn.example.org/repository/');
+# or
+Set($RT::SvnRepository, 'svn://svn.example.org/repository/');
+
+
+You also need to add a "post-commit" hook to your svn repository
+so that it knows how to talk to RT. Basically, it does a simple
+HTTP "GET" request to tell RT to query the svn server for an update.
+We use this provoked poll method so that RT doesn't need to trust
+arbitrary incoming pings. RT is careful to only apply each commit
+once.
+
+Create a _privileged_ RT user for the svn integration to use. It doesn't matter
+if that user has no specific rights; they just need to be able to log into RT's
+web interface.
+
+Add the following line (assuming you use curl) to your repository's
+hooks/post-commit script:
+
+curl -O "http://rt.example.org/SVN/PullUpdate.html?user=guest&pass=guest&rev=$REV" &
+
+
+To tell RT which ticket a commit is associated with, put an RT-Ticket:
+line in your commit message. if there's no RT-Ticket: line, rt will
+ignore the commit message. If you put "rtname#" before the ticket id, RT
+instances whose rtnames don't match what you've put in will act as if they
+haven't seen a ticket id. This can be useful if you use svk to move subversion
+commits between repositories and want to track commit history across multiple
+RT instances.
+
+
+A couple simple examples:
+
+=====cut here======
+
+RT-Ticket: fsck.com#123
+RT-Ticket: elixus.org#1525
+RT-Ticket: openfoundry.org#2113
+RT-Status: resolved
+RT-Update: comment
+
+This is a simple comment.
+
+======cut here=======
+
+ OR
+
+======cut here=======
+
+RT-Ticket: 123
+RT-Status: open
+RT-Update: correspond
+
+We've commmited a fix to your problem. Is it fixed in -HEAD?
+
+======cut here=======
diff --git a/html/SVN/PullUpdate.html b/html/SVN/PullUpdate.html
new file mode 100755
index 0000000..f4a4e4f
--- /dev/null
+++ b/html/SVN/PullUpdate.html
@@ -0,0 +1,85 @@
+<%ARGS>
+$rev => 1
+</%ARGS>
+<%init>
+
+unless ( $rev =~ /^(\d+)$/ ) {
+ $m->out("Numeric revision needed");
+ $m->abort();
+}
+
+my $REPO = $RT::SvnRepository || "svn://localhost/";
+my $LOOK = $RT::PathToSvn;
+
+my $CHANGE_URI = $REPO . "@" . $rev;
+
+open( SVNLOOK, "$LOOK log $REPO -r $rev|" ) || die $@;
+
+my $dashes = <SVNLOOK>;
+my $data = <SVNLOOK>;
+my ( $revision, $actor, $foo );
+if ( $data =~ /^r(\d+)\s*\|\s*(.*?)\s*\|/ ) {
+ $revision = $1;
+ $actor = $2;
+
+}
+die "$rev is not $revision" unless ( $rev == $revision );
+
+my @msg = <SVNLOOK>;
+$dashes = pop(@msg);
+
+close(SVNLOOK);
+
+my $user = RT::CurrentUser->new($actor);
+unless ( $user->id ) {
+ $user->LoadByCols( Gecos => $actor );
+}
+
+unless ( $user->id ) {
+ die "Unknown user";
+}
+
+my $ticket;
+my $update_msg = '';
+my $update_type = 'comment';
+my $update_status = '';
+foreach my $line (@msg) {
+ if ( $line =~ /^RT-Ticket: (\w*?)(?:\#?)(\d*)/ ) {
+ next if ($1 && $1 !~ =/^$RT::rtname$/i);
+ $ticket = RT::Ticket->new($user);
+ $ticket->Load($2);
+ }
+ elsif ( $line =~ /^RT-Status:.*(new|open|stalled|resolved|rejected)/i ) {
+ $update_status = lc($1);
+ }
+ elsif ( $line =~ /^RT-Update:\s*(comment|correspond)/i ) {
+ $update_type = lc($1);
+ }
+ else {
+ $update_msg .= $line;
+ }
+
+}
+
+if ( $ticket->id ) {
+ my $refers_to = $ticket->RefersTo;
+ while ( my $refer = $refers_to->Next ) {
+ if ( $refer->TargetURI->URI eq $CHANGE_URI ) {
+ $RT::Logger->error(
+ "Attempt to apply $CHANGE_URI which was already applied");
+ $m->out("Attempt to apply $CHANGE_URI which was already applied");
+ $m->abort();
+ return ();
+ }
+ }
+ $ticket->AddLink( Type => 'RefersTo', Target => $CHANGE_URI );
+
+ $update_msg = "Subversion update $REPO\@$rev \n" . $update_msg;
+ $update_type = ucfirst($update_type);
+ $ticket->$update_type( Content => $update_msg );
+ if ($update_status) {
+ $ticket->SetStatus($update_status);
+ }
+}
+$m->abort();
+</%init>
diff --git a/lib/RT/Integration/SVN.pm b/lib/RT/Integration/SVN.pm
new file mode 100644
index 0000000..e69de29
commit 65ed6aecba0149aec52d7108a2a314bf1651cfa3
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Fri Jun 4 01:10:55 2004 +0000
Specified the M::I::RTx version
diff --git a/META.yml b/META.yml
index b13e805..3edef63 100644
--- a/META.yml
+++ b/META.yml
@@ -5,7 +5,7 @@ author: Jesse Vincent <jesse at bestpractical.com>
license: GPLv2
distribution_type: module
build_requires:
- Module::Install::RTx: 0
+ Module::Install::RTx: 0.08
no_index:
directory:
- html
diff --git a/Makefile.PL b/Makefile.PL
index 2b5171b..e2bb882 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -3,7 +3,7 @@ use inc::Module::Install;
RTx('RT-Integration-SVN');
license('GPLv2');
version('0.01_01');
-build_requires('Module::Install::RTx');
+build_requires('Module::Install::RTx' => 0.08);
author('Jesse Vincent <jesse at bestpractical.com>');
&WriteAll;
commit a1ded0f7058234c9720e9c4079e06b4e291a8872
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Fri Jun 4 01:39:52 2004 +0000
Additional bulletproofing and error reporting. now in production for rt3.fsck.com
diff --git a/Makefile.PL b/Makefile.PL
index e2bb882..53dbec6 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -2,7 +2,7 @@ use inc::Module::Install;
RTx('RT-Integration-SVN');
license('GPLv2');
-version('0.01_01');
+version('0.01');
build_requires('Module::Install::RTx' => 0.08);
author('Jesse Vincent <jesse at bestpractical.com>');
diff --git a/README b/README
index 485acaf..9d904ab 100644
--- a/README
+++ b/README
@@ -7,11 +7,11 @@ to do a bit of setup.
In your RT::SiteConfig, set up the following variables:
-Set($RT::PathToSvn, '/usr/bin/svn'); # or wherever your svn(1) binary lives
+Set($PathToSvn, '/usr/bin/svn'); # or wherever your svn(1) binary lives
-Set($RT::SvnRepository, 'http://svn.example.org/repository/');
+Set($SvnRepository, 'http://svn.example.org/repository/');
# or
-Set($RT::SvnRepository, 'svn://svn.example.org/repository/');
+Set($SvnRepository, 'svn://svn.example.org/repository/');
You also need to add a "post-commit" hook to your svn repository
@@ -28,7 +28,7 @@ web interface.
Add the following line (assuming you use curl) to your repository's
hooks/post-commit script:
-curl -O "http://rt.example.org/SVN/PullUpdate.html?user=guest&pass=guest&rev=$REV" &
+curl "http://rt.example.org/SVN/PullUpdate.html?user=guest&pass=guest&rev=$REV" &
To tell RT which ticket a commit is associated with, put an RT-Ticket:
diff --git a/html/SVN/PullUpdate.html b/html/SVN/PullUpdate.html
index f4a4e4f..ca33b60 100755
--- a/html/SVN/PullUpdate.html
+++ b/html/SVN/PullUpdate.html
@@ -1,5 +1,5 @@
<%ARGS>
-$rev => 1
+$rev
</%ARGS>
<%init>
@@ -13,6 +13,10 @@ my $LOOK = $RT::PathToSvn;
my $CHANGE_URI = $REPO . "@" . $rev;
+unless (-f $LOOK && -x $LOOK ) {
+ die "Couldn't find your svn binary ('$LOOK')";
+}
+
open( SVNLOOK, "$LOOK log $REPO -r $rev|" ) || die $@;
my $dashes = <SVNLOOK>;
@@ -23,8 +27,9 @@ if ( $data =~ /^r(\d+)\s*\|\s*(.*?)\s*\|/ ) {
$actor = $2;
}
-die "$rev is not $revision" unless ( $rev == $revision );
-
+unless ( $rev == $revision ) {
+die "$LOOK log $REPO -r $rev\n$rev is not $revision\n$data" ;
+}
my @msg = <SVNLOOK>;
$dashes = pop(@msg);
@@ -44,15 +49,15 @@ my $update_msg = '';
my $update_type = 'comment';
my $update_status = '';
foreach my $line (@msg) {
- if ( $line =~ /^RT-Ticket: (\w*?)(?:\#?)(\d*)/ ) {
- next if ($1 && $1 !~ =/^$RT::rtname$/i);
+ if ( $line =~ /^\s*RT-Ticket: (\w*?)(?:\#?)(\d*)/ ) {
+ next if ($1 && $1 !~ /^$RT::rtname$/i);
$ticket = RT::Ticket->new($user);
$ticket->Load($2);
}
- elsif ( $line =~ /^RT-Status:.*(new|open|stalled|resolved|rejected)/i ) {
+ elsif ( $line =~ /^\s*RT-Status:.*(\w+)/i ) {
$update_status = lc($1);
}
- elsif ( $line =~ /^RT-Update:\s*(comment|correspond)/i ) {
+ elsif ( $line =~ /^\s*RT-Update:\s*(comment|correspond)/i ) {
$update_type = lc($1);
}
else {
@@ -61,7 +66,7 @@ foreach my $line (@msg) {
}
-if ( $ticket->id ) {
+if ( $ticket && $ticket->id ) {
my $refers_to = $ticket->RefersTo;
while ( my $refer = $refers_to->Next ) {
if ( $refer->TargetURI->URI eq $CHANGE_URI ) {
@@ -77,7 +82,7 @@ if ( $ticket->id ) {
$update_msg = "Subversion update $REPO\@$rev \n" . $update_msg;
$update_type = ucfirst($update_type);
$ticket->$update_type( Content => $update_msg );
- if ($update_status) {
+ if ($update_status && $ticket->QueueObj->IsValidStatus($update_status)) {
$ticket->SetStatus($update_status);
}
}
commit 7274b794a3526a3c65d875acdea756759dc2dcfc
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Mon Jun 7 18:39:39 2004 +0000
Fixing a bug in the regexps for ticket status
diff --git a/META.yml b/META.yml
index 3edef63..99fa06a 100644
--- a/META.yml
+++ b/META.yml
@@ -1,5 +1,5 @@
name: RT-Integration-SVN
-version: 0.01_01
+version: 0.01
abstract: RT Integration-SVN Extension
author: Jesse Vincent <jesse at bestpractical.com>
license: GPLv2
diff --git a/html/SVN/PullUpdate.html b/html/SVN/PullUpdate.html
index ca33b60..53b0572 100755
--- a/html/SVN/PullUpdate.html
+++ b/html/SVN/PullUpdate.html
@@ -54,7 +54,7 @@ foreach my $line (@msg) {
$ticket = RT::Ticket->new($user);
$ticket->Load($2);
}
- elsif ( $line =~ /^\s*RT-Status:.*(\w+)/i ) {
+ elsif ( $line =~ /^\s*RT-Status:\s*(\w+)/i ) {
$update_status = lc($1);
}
elsif ( $line =~ /^\s*RT-Update:\s*(comment|correspond)/i ) {
commit c33c5ca12cd028fda0ce95447ebb6224dccfd5c7
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Tue Jun 15 06:28:03 2004 +0000
Pull the version from RT/Integration/SVN.pm
diff --git a/Makefile.PL b/Makefile.PL
index 53dbec6..6a1e77e 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -2,7 +2,7 @@ use inc::Module::Install;
RTx('RT-Integration-SVN');
license('GPLv2');
-version('0.01');
+version_from('lib/RT/Integration/SVN.pm');
build_requires('Module::Install::RTx' => 0.08);
author('Jesse Vincent <jesse at bestpractical.com>');
diff --git a/lib/RT/Integration/SVN.pm b/lib/RT/Integration/SVN.pm
index e69de29..3dc498b 100644
--- a/lib/RT/Integration/SVN.pm
+++ b/lib/RT/Integration/SVN.pm
@@ -0,0 +1,6 @@
+use strict;
+use warnings;
+
+package RT::Integration::SVN;
+
+our $VERSION = '0.02';
commit 9dd93fbfd2d63da3f7c36726b39b90b24c62e203
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Thu Jun 17 22:23:23 2004 +0000
Add RT-Action as an alias for RT-Update
Update docs to be a little more thorough
diff --git a/README b/README
index 9d904ab..a6a1123 100644
--- a/README
+++ b/README
@@ -39,6 +39,10 @@ haven't seen a ticket id. This can be useful if you use svk to move subversion
commits between repositories and want to track commit history across multiple
RT instances.
+The other recognized commands are RT-Status and RT-Update. RT-Action
+is an alias for RT-Update, if preferred. Commands are
+case-insensitive and may occur in any order, at any point in the
+commit message.
A couple simple examples:
diff --git a/html/SVN/PullUpdate.html b/html/SVN/PullUpdate.html
index 53b0572..88a44ab 100755
--- a/html/SVN/PullUpdate.html
+++ b/html/SVN/PullUpdate.html
@@ -49,7 +49,7 @@ my $update_msg = '';
my $update_type = 'comment';
my $update_status = '';
foreach my $line (@msg) {
- if ( $line =~ /^\s*RT-Ticket: (\w*?)(?:\#?)(\d*)/ ) {
+ if ( $line =~ /^\s*RT-Ticket:\s*(\w*?)(?:\#?)(\d*)/ ) {
next if ($1 && $1 !~ /^$RT::rtname$/i);
$ticket = RT::Ticket->new($user);
$ticket->Load($2);
@@ -57,7 +57,7 @@ foreach my $line (@msg) {
elsif ( $line =~ /^\s*RT-Status:\s*(\w+)/i ) {
$update_status = lc($1);
}
- elsif ( $line =~ /^\s*RT-Update:\s*(comment|correspond)/i ) {
+ elsif ( $line =~ /^\s*RT-(?:Update|Action):\s*(comment|correspond)/i ) {
$update_type = lc($1);
}
else {
commit 3c6b3d30711ea13698beead448e85f94eb0141fe
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Mon Oct 4 20:31:44 2004 +0000
added docs about what clkao wants
diff --git a/doc/rt-svk-integration-notes b/doc/rt-svk-integration-notes
new file mode 100644
index 0000000..f83099b
--- /dev/null
+++ b/doc/rt-svk-integration-notes
@@ -0,0 +1,12 @@
+23:15 [freenode] <obra:#svk> oh. clkao: patch integration.
+23:15 [freenode] <obra:#svk> with RT
+23:15 [freenode] <obra:#svk> if you send me a wishlist, I may be encouraged to
+ haxx0r on it
+23:22 [freenode] <clkao:#svk> the most thing i want is probably auto update
+ unapplied patches to apply cleanly for latest trunk. and send
+ notification to originator when it's causing conflicts.
+23:23 [freenode] <obra:#svk> what's the svk magic from that side?
+23:23 [freenode] <clkao:#svk> if it's already svk patch format, you can just
+ ->update for it
+23:24 [freenode] <clkao:#svk> and we want unidiff -> svk patch convertor
+
commit 15dcdb8363fbf88f820906d5575169a963eaaa89
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Fri Feb 11 02:00:12 2005 +0000
From Dave Rolsky
This patch adds the following:
RT-Owner: foo
RT-TicketProperty: X
^^ doesn't work with custom fields though, but it's darn handy to set
TimeWorked
Output when it's successful, which makes testing way easier.
diff --git a/html/SVN/PullUpdate.html b/html/SVN/PullUpdate.html
index 88a44ab..e81a8c6 100755
--- a/html/SVN/PullUpdate.html
+++ b/html/SVN/PullUpdate.html
@@ -48,6 +48,8 @@ my $ticket;
my $update_msg = '';
my $update_type = 'comment';
my $update_status = '';
+my $update_owner = '';
+my %set;
foreach my $line (@msg) {
if ( $line =~ /^\s*RT-Ticket:\s*(\w*?)(?:\#?)(\d*)/ ) {
next if ($1 && $1 !~ /^$RT::rtname$/i);
@@ -60,6 +62,12 @@ foreach my $line (@msg) {
elsif ( $line =~ /^\s*RT-(?:Update|Action):\s*(comment|correspond)/i ) {
$update_type = lc($1);
}
+ elsif ( $line =~ /^\s*RT-Owner:\s*(\w+)/i ) {
+ $update_owner = $1;
+ }
+ elsif ( $line =~ /^\s*RT-(\w+):\s*(\w+)/i ) {
+ $set{$1} = $2;
+ }
else {
$update_msg .= $line;
}
@@ -78,12 +86,30 @@ if ( $ticket && $ticket->id ) {
}
}
$ticket->AddLink( Type => 'RefersTo', Target => $CHANGE_URI );
+ $m->out( "Added link to $CHANGE_URI\n" );
$update_msg = "Subversion update $REPO\@$rev \n" . $update_msg;
$update_type = ucfirst($update_type);
$ticket->$update_type( Content => $update_msg );
+ $m->out( "Added commit text as $update_type\n" );
+
+ if ($update_owner) {
+ my ($status, $msg) = $ticket->SetOwner($update_owner);
+ $m->out( "Set owner to $update_owner\n" );
+ $m->out( "Failed: $msg\n" ) unless $status;
+ }
+
if ($update_status && $ticket->QueueObj->IsValidStatus($update_status)) {
$ticket->SetStatus($update_status);
+ $m->out( "Set status to $update_status\n" );
+ }
+
+ if (keys %set) {
+ for my $k (keys %set) {
+ my $meth = "Set$k";
+ $ticket->$meth($set{$k});
+ $m->out( "Set $k to $set{$k}\n" );
+ }
}
}
$m->abort();
commit 4af5a3c061274adfaafe026077faf87a6ab112f8
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Sun Mar 6 01:12:07 2005 +0000
manifest
diff --git a/MANIFEST b/MANIFEST
index 01d8e61..8d97117 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,3 +1,5 @@
+Changes
+SIGNATURE
html/SVN/PullUpdate.html
inc/Module/Install.pm
inc/Module/Install/Base.pm
diff --git a/META.yml b/META.yml
index 99fa06a..4a5d9c4 100644
--- a/META.yml
+++ b/META.yml
@@ -1,5 +1,5 @@
name: RT-Integration-SVN
-version: 0.01
+version: 0.03
abstract: RT Integration-SVN Extension
author: Jesse Vincent <jesse at bestpractical.com>
license: GPLv2
@@ -10,4 +10,4 @@ no_index:
directory:
- html
- inc
-generated_by: Module::Install version 0.33
+generated_by: Module::Install version 0.36
diff --git a/lib/RT/Integration/SVN.pm b/lib/RT/Integration/SVN.pm
index 3dc498b..a69d685 100644
--- a/lib/RT/Integration/SVN.pm
+++ b/lib/RT/Integration/SVN.pm
@@ -3,4 +3,4 @@ use warnings;
package RT::Integration::SVN;
-our $VERSION = '0.02';
+our $VERSION = '0.03';
commit 81bfbfd6586073d505042f1554eb62ffefc08803
Author: Kevin Riggle <kevinr at bestpractical.com>
Date: Thu May 26 03:45:18 2005 +0000
"RT-Ticket" flag is now case-insensitive
diff --git a/html/SVN/PullUpdate.html b/html/SVN/PullUpdate.html
index e81a8c6..cd781c2 100755
--- a/html/SVN/PullUpdate.html
+++ b/html/SVN/PullUpdate.html
@@ -51,7 +51,7 @@ my $update_status = '';
my $update_owner = '';
my %set;
foreach my $line (@msg) {
- if ( $line =~ /^\s*RT-Ticket:\s*(\w*?)(?:\#?)(\d*)/ ) {
+ if ( $line =~ /^\s*RT-Ticket:\s*(\w*?)(?:\#?)(\d*)/i ) {
next if ($1 && $1 !~ /^$RT::rtname$/i);
$ticket = RT::Ticket->new($user);
$ticket->Load($2);
commit fea19a73c39e8fdf20c11107378c500b98fedde0
Author: Kevin Riggle <kevinr at bestpractical.com>
Date: Mon Jul 18 15:31:18 2005 +0000
Merged SVN URI handling back into trunk
diff --git a/lib/RT/URI/svn.pm b/lib/RT/URI/svn.pm
new file mode 100755
index 0000000..cf50bbb
--- /dev/null
+++ b/lib/RT/URI/svn.pm
@@ -0,0 +1,252 @@
+# BEGIN BPS TAGGED BLOCK {{{
+#
+# COPYRIGHT:
+#
+# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+# <jesse at bestpractical.com>
+#
+# (Except where explicitly superseded by other copyright notices)
+#
+#
+# LICENSE:
+#
+# This work is made available to you under the terms of Version 2 of
+# the GNU General Public License. A copy of that license should have
+# been provided with this software, but in any event can be snarfed
+# from www.gnu.org.
+#
+# This work is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#
+# CONTRIBUTION SUBMISSION POLICY:
+#
+# (The following paragraph is not intended to limit the rights granted
+# to you to modify and distribute this software under the terms of
+# the GNU General Public License and is only of importance to you if
+# you choose to contribute your changes and enhancements to the
+# community by submitting them to Best Practical Solutions, LLC.)
+#
+# By intentionally submitting any modifications, corrections or
+# derivatives to this work, or any other work intended for use with
+# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+# you are the copyright holder for those contributions and you grant
+# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
+# royalty-free, perpetual, license to use, copy, create derivative
+# works based on those contributions, and sublicense and distribute
+# those contributions and any derivatives thereof.
+#
+# END BPS TAGGED BLOCK }}}
+package RT::URI::svn;
+
+use RT::Ticket;
+
+use RT::URI::base;
+
+use strict;
+use vars qw(@ISA);
+ at ISA = qw/RT::URI::base/;
+
+
+=head1 LocalURIPrefix
+
+Returns the prefix for a local SVN URI.
+
+=begin testing
+
+use_ok("RT::URI::svn");
+my $uri = RT::URI::svn->new($RT::SystemUser);
+
+ok(ref($uri));
+
+use Data::Dumper;
+
+
+ok (UNIVERSAL::isa($uri,RT::URI::svn), "It's an RT::URI::svn");
+
+ok ($uri->isa('RT::URI::base'), "It's an RT::URI::base");
+ok ($uri->isa('RT::Base'), "It's an RT::Base");
+
+=end testing
+
+
+
+=cut
+
+BEGIN { $RT::Logger->debug("Loaded svn URI parser"); }
+
+sub LocalURIPrefix {
+ my $self = shift;
+
+ my $scheme = $self->Scheme;
+
+ my $prefix;
+ if (defined $RT::SvnRepository && $RT::SvnRepository =~ /^$scheme/) {
+ $prefix = $RT::SvnRepository;
+ } else {
+ $prefix = 'svn://localhost/';
+ }
+
+ $RT::Logger->debug("Prefix looks like: $prefix");
+ #$RT::Logger->debug("SVN lives at ". $RT::SvnRepository);
+
+ return ($prefix);
+}
+
+=head2 ObjectType
+
+=cut
+
+sub ObjectType {
+ my $self = shift;
+ return undef;
+}
+
+
+=head2 ParseURI URI
+
+When handed an svn: URI, figures out whether it's a commit to the local SVN
+server.
+
+=cut
+
+
+sub ParseURI {
+ my $self = shift;
+ my $uri = shift;
+
+ # if we were passed a URI, store it for later use; if not, retrieve it
+ if ($uri) {
+ $self->{'uri'} = $uri;
+ } else {
+ $uri = $self->{'uri'};
+ }
+
+ #If it's a local SVN commit URI, return the revision number
+ if ( $self->_IsLocalSvn ) {
+ my $scheme = $self->Scheme;
+ if ( $uri =~ /^$scheme:\/\/(.+)\/(.+)?\@(\d+)$/i ) {
+ $self->{'svn_server'} = $1;
+ $self->{'repository_path'} = $2;
+ $self->{'revision'} = $3;
+ return $self->{'revision'};
+ }
+ } else {
+ return $uri || $self->{'uri'};
+ }
+
+}
+
+=head2 IsLocal
+
+Returns true if this URI is for a commit to the local SVN repository.
+Returns undef otherwise.
+
+
+
+=cut
+
+sub _IsLocalSvn {
+ my $self = shift;
+ my $local_uri_prefix = $self->LocalURIPrefix;
+ if ($self->{'uri'} =~ /^$local_uri_prefix/i) {
+ $RT::Logger->debug("Local URI ". $self->{'uri'});
+ return 1;
+ }
+ else {
+ $RT::Logger->debug("Not a local URI ". $self->{'uri'});
+ return undef;
+ }
+}
+
+sub IsLocal {
+ my $self = shift;
+ return $self->SUPER::IsLocal;
+}
+
+sub URI {
+ my $self = shift;
+ return $self->{'uri'};
+}
+
+=head2 Scheme
+
+Return the URI scheme for SVN commits
+
+=cut
+
+sub Scheme {
+ my $self = shift;
+ return "svn";
+}
+
+=head2 HREF
+
+If this is a local ticket, return an HTTP url to it.
+Otherwise, return its URI.
+
+By default, this assumes that your SVN repository lives at svn://localhost,
+which can be changed by setting the $SvnRepository configuration
+variable.
+
+Most svn:// URIs look like
+svn://svn.example.com/path/to/repository/@1234
+
+RT will assume that this means the Web view of the revision lives at
+http://svn.example.com/cgi-bin/index.cgi/path/to/repository/?rev=1234
+
+This URL can be changed in RT_SiteConfig.pm with the directive
+Set( $SvnRepositoryWebView, 'http://svn.example.com/path/to/?rev=');
+and the correct revision number will be appended.
+
+=cut
+
+
+sub HREF {
+ my $self = shift;
+
+ if ($self->_IsLocalSvn) {
+ # we can assume that ParseURI has already run and stored its
+ # information in $self
+ my $web_url;
+ if ($RT::SvnRepositoryWebView) {
+ $web_url = ($RT::SvnRepositoryWebView . $self->{'revision'});
+ } else {
+ $web_url = ('http://'. $self->{'svn_server'}. '/cgi-bin/index.cgi/'. $self->{'repository_path'}. '?rev='. $self->{'revision'});
+ }
+ $RT::Logger->debug("Web URL: $web_url");
+ return $web_url;
+ }
+ else {
+ return ($self->URI);
+ }
+}
+
+=head2 AsString
+
+Returns either a localized string 'SVN revision 1234 (svn://svn.bestpractical.com)' or the full URI if the object is not local
+
+=cut
+
+sub AsString {
+ my $self = shift;
+ if ($self->_IsLocalSvn) {
+ return $self->loc("SVN revision [_1] ([_2])", $self->ParseURI, $self->LocalURIPrefix);
+ }
+ else {
+ return $self->URI;
+ }
+}
+
+eval "require RT::URI::svn_Vendor";
+die $@ if ($@ && $@ !~ qr{^Can't locate RT/URI/svn_Vendor.pm});
+eval "require RT::URI::svn_Local";
+die $@ if ($@ && $@ !~ qr{^Can't locate RT/URI/svn_Local.pm});
+
+1;
commit a888a1325f35ce03ba16152565fb66db8e8599ef
Author: Kevin Riggle <kevinr at bestpractical.com>
Date: Mon Jul 18 23:29:42 2005 +0000
Updated README to reflect new configuration option for URI handler
added a Changelog
diff --git a/Changes b/Changes
new file mode 100644
index 0000000..55ddeff
--- /dev/null
+++ b/Changes
@@ -0,0 +1,5 @@
+Changes since 0.03
+
+* Made the RT-Ticket: field case-insensitive
+
+* Added handling for svn:// URIs
diff --git a/README b/README
index a6a1123..b028740 100644
--- a/README
+++ b/README
@@ -14,6 +14,25 @@ Set($SvnRepository, 'http://svn.example.org/repository/');
Set($SvnRepository, 'svn://svn.example.org/repository/');
+If you do not wish to use the extension's URI-handling capabilities,
+remove /opt/rt3/local/lib/RT/URI/svn.pm
+
+Most svn:// URIs look like
+svn://svn.example.com/path/to/repository/@1234
+
+This extension will assume that this means the Web view of the revision
+lives at:
+http://svn.example.com/cgi-bin/index.cgi/path/to/repository/?rev=1234
+(this is where SVN::Web puts it).
+
+If you aren't using SVN::Web or if your view lives elsewhere, you need
+to add the following line to RT::SiteConfig:
+
+Set( $SvnRepositoryWebView, 'http://svn.example.com/path/to/?rev=');
+
+The correct revision number will be appended.
+
+
You also need to add a "post-commit" hook to your svn repository
so that it knows how to talk to RT. Basically, it does a simple
HTTP "GET" request to tell RT to query the svn server for an update.
diff --git a/lib/RT/Integration/SVN.pm b/lib/RT/Integration/SVN.pm
index a69d685..1b4fc17 100644
--- a/lib/RT/Integration/SVN.pm
+++ b/lib/RT/Integration/SVN.pm
@@ -3,4 +3,4 @@ use warnings;
package RT::Integration::SVN;
-our $VERSION = '0.03';
+our $VERSION = '0.04';
commit f0971a340660beb8c503edeb69bf4a7fe594ce90
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Thu Dec 29 20:46:45 2005 +0000
Patch from Dave Rolsky to add RT-Set-Queue and a debug flag
diff --git a/html/SVN/PullUpdate.html b/html/SVN/PullUpdate.html
index cd781c2..fe2f4b4 100755
--- a/html/SVN/PullUpdate.html
+++ b/html/SVN/PullUpdate.html
@@ -1,7 +1,9 @@
<%ARGS>
$rev
+$debug => 0
</%ARGS>
<%init>
+$r->content_type('text/plain');
unless ( $rev =~ /^(\d+)$/ ) {
$m->out("Numeric revision needed");
@@ -28,7 +30,7 @@ if ( $data =~ /^r(\d+)\s*\|\s*(.*?)\s*\|/ ) {
}
unless ( $rev == $revision ) {
-die "$LOOK log $REPO -r $rev\n$rev is not $revision\n$data" ;
+ die "$LOOK log $REPO -r $rev\n$rev is not $revision\n$data";
}
my @msg = <SVNLOOK>;
$dashes = pop(@msg);
@@ -40,6 +42,9 @@ unless ( $user->id ) {
$user->LoadByCols( Gecos => $actor );
}
+$m->out("DEBUG: Found user " . $user->Name() . " as SVN committer\n")
+ if $debug;
+
unless ( $user->id ) {
die "Unknown user";
}
@@ -49,31 +54,49 @@ my $update_msg = '';
my $update_type = 'comment';
my $update_status = '';
my $update_owner = '';
+my $update_queue = '';
my %set;
foreach my $line (@msg) {
if ( $line =~ /^\s*RT-Ticket:\s*(\w*?)(?:\#?)(\d*)/i ) {
next if ($1 && $1 !~ /^$RT::rtname$/i);
$ticket = RT::Ticket->new($user);
$ticket->Load($2);
+ $m->out("DEBUG: loaded ticket $2\n")
+ if $debug;
+ }
+ elsif ( $line =~ /^\s*RT-Queue:\s*(.+\w)\s*/i ) {
+ $update_queue = $1;
+ $m->out("DEBUG: set queue to $1\n")
+ if $debug;
}
elsif ( $line =~ /^\s*RT-Status:\s*(\w+)/i ) {
$update_status = lc($1);
+ $m->out("DEBUG: set status to $1\n")
+ if $debug;
}
elsif ( $line =~ /^\s*RT-(?:Update|Action):\s*(comment|correspond)/i ) {
$update_type = lc($1);
+ $m->out("DEBUG: update type is $1\n")
+ if $debug;
}
elsif ( $line =~ /^\s*RT-Owner:\s*(\w+)/i ) {
$update_owner = $1;
+ $m->out("DEBUG: set owner to $1\n")
+ if $debug;
}
elsif ( $line =~ /^\s*RT-(\w+):\s*(\w+)/i ) {
$set{$1} = $2;
+ $m->out("DEBUG: set $1 to $2\n")
+ if $debug;
}
else {
$update_msg .= $line;
}
-
}
+$m->out("DEBUG: update message is ...\n$update_msg\n")
+ if $debug;
+
if ( $ticket && $ticket->id ) {
my $refers_to = $ticket->RefersTo;
while ( my $refer = $refers_to->Next ) {
@@ -93,6 +116,12 @@ if ( $ticket && $ticket->id ) {
$ticket->$update_type( Content => $update_msg );
$m->out( "Added commit text as $update_type\n" );
+ if ($update_queue) {
+ my ($status, $msg) = $ticket->SetQueue($update_queue);
+ $m->out( "Set queue to $update_queue\n" );
+ $m->out( "Failed: $msg\n" ) unless $status;
+ }
+
if ($update_owner) {
my ($status, $msg) = $ticket->SetOwner($update_owner);
$m->out( "Set owner to $update_owner\n" );
commit 8c06d1887919656c3cc3744224e9ae015b03bb0e
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Tue Mar 14 17:38:20 2006 +0000
added doc
diff --git a/README b/README
index b028740..506831d 100644
--- a/README
+++ b/README
@@ -1,6 +1,11 @@
This tool allows an RT 3.x instance to integrate with a Subversion revision
control system.
+To install the package in your RT instance, run the following commands:
+
+ perl Makefile.PL
+ make install
+
To configure your subversion server to talk to an RT instance, you'll need
to do a bit of setup.
commit 3b07747a2df5e394d129ab302eb917cd637ca19a
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Tue Mar 14 17:40:11 2006 +0000
0.04
diff --git a/Changes b/Changes
index 55ddeff..0c6fc5b 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,9 @@
+
+Changes since 0.04
+
+* README updates
+
+
Changes since 0.03
* Made the RT-Ticket: field case-insensitive
diff --git a/MANIFEST b/MANIFEST
index 8d97117..d91ed92 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,5 +1,5 @@
Changes
-SIGNATURE
+doc/rt-svk-integration-notes
html/SVN/PullUpdate.html
inc/Module/Install.pm
inc/Module/Install/Base.pm
@@ -11,7 +11,9 @@ inc/Module/Install/RTx.pm
inc/Module/Install/Win32.pm
inc/Module/Install/WriteAll.pm
lib/RT/Integration/SVN.pm
+lib/RT/URI/svn.pm
Makefile.PL
MANIFEST This list of files
META.yml
README
+SIGNATURE
diff --git a/META.yml b/META.yml
index 4a5d9c4..eecbb11 100644
--- a/META.yml
+++ b/META.yml
@@ -1,13 +1,14 @@
-name: RT-Integration-SVN
-version: 0.03
abstract: RT Integration-SVN Extension
-author: Jesse Vincent <jesse at bestpractical.com>
-license: GPLv2
-distribution_type: module
+author: 'Jesse Vincent <jesse at bestpractical.com>'
build_requires:
Module::Install::RTx: 0.08
+distribution_type: module
+generated_by: Module::Install version 0.52
+license: GPLv2
+name: RT-Integration-SVN
no_index:
directory:
- html
- inc
-generated_by: Module::Install version 0.36
+ - t
+version: 0.04
diff --git a/SIGNATURE b/SIGNATURE
new file mode 100644
index 0000000..1823d07
--- /dev/null
+++ b/SIGNATURE
@@ -0,0 +1,41 @@
+This file contains message digests of all files listed in MANIFEST,
+signed via the Module::Signature module, version 0.50.
+
+To verify the content in this distribution, first make sure you have
+Module::Signature installed, then type:
+
+ % cpansign -v
+
+It will check each file's integrity, as well as the signature's
+validity. If "==> Signature verified OK! <==" is not displayed,
+the distribution may already have been compromised, and you should
+not run its Makefile.PL or Build.PL.
+
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+SHA1 f3282b4e10e7849a7e44df9af8328613563b77b4 Changes
+SHA1 48515b4c57d6e4ba24097df1aa9af9f1b0d33498 MANIFEST
+SHA1 23f549d78739a8b7c0c4d0f49766b26563a3e1cb META.yml
+SHA1 8fb636a5f8a5eb2b96982879ab864365a168bafd Makefile.PL
+SHA1 4fb6e87a81210bc717d864cf9412291a8e5cd15f README
+SHA1 7cf6724342489786c52e72d5341815d57c44e949 doc/rt-svk-integration-notes
+SHA1 48d7b99e6680a47fbc3b07611697153cf4b2dbee html/SVN/PullUpdate.html
+SHA1 cb8e59948a7f4f5c83c66588f8bab2ddfa1e62ca inc/Module/Install.pm
+SHA1 9dbed9ff1790473ec3136a606f062fa050326c43 inc/Module/Install/Base.pm
+SHA1 d37430abee4687a4861b1312e5bea6953e6afe4d inc/Module/Install/Can.pm
+SHA1 a784ba7d2b096084b2ffed3a7d853e2847f4dedb inc/Module/Install/Fetch.pm
+SHA1 044cd2f160364fe36eca2ba35e16e7cf46c79138 inc/Module/Install/Makefile.pm
+SHA1 49e0d839edeb0f3e9af12fd2444b98365393a23e inc/Module/Install/Metadata.pm
+SHA1 f502de0d0610ec3a8a2dd0e32c9e12e2971a96aa inc/Module/Install/RTx.pm
+SHA1 2a1b494a7e5adaa3216e86d909dd5bf87d084c80 inc/Module/Install/Win32.pm
+SHA1 4a23fafe534363a99f0d936df9086ad243e692c9 inc/Module/Install/WriteAll.pm
+SHA1 662516a66169fac62144a44290e93232af9aa67b lib/RT/Integration/SVN.pm
+SHA1 272c53e6377bdcf08fa83693dfdfa8302ad6306b lib/RT/URI/svn.pm
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.1 (GNU/Linux)
+
+iD8DBQFEFv9GEi9d9xCOQEYRAuECAJ4tu4lvl7NQAJANXaQMeqlpD5kmQQCcDyS9
+6lifsRQGyednXikZW0HPr+A=
+=O+dS
+-----END PGP SIGNATURE-----
diff --git a/inc/Module/Install.pm b/inc/Module/Install.pm
new file mode 100644
index 0000000..801a8a4
--- /dev/null
+++ b/inc/Module/Install.pm
@@ -0,0 +1,222 @@
+#line 1 "/home/jesse/svk/RT-Integration-SVN/inc/Module/Install.pm - /usr/local/share/perl/5.8.7/Module/Install.pm"
+package Module::Install;
+
+use 5.004;
+use strict 'vars';
+use vars qw{$VERSION};
+BEGIN {
+ # Don't forget to update Module::Install::Admin too!
+ $VERSION = '0.52';
+}
+
+# inc::Module::Install must be loaded first
+unless ( $INC{join('/', inc => split(/::/, __PACKAGE__)).'.pm'} ) {
+ die <<"END_DIE";
+Please invoke ${\__PACKAGE__} with:
+
+ use inc::${\__PACKAGE__};
+
+not:
+
+ use ${\__PACKAGE__};
+
+END_DIE
+}
+
+use Cwd ();
+use FindBin;
+use File::Find ();
+use File::Path ();
+
+*inc::Module::Install::VERSION = *VERSION;
+ at inc::Module::Install::ISA = 'Module::Install';
+
+sub autoload {
+ my $self = shift;
+ my $caller = $self->_caller;
+ my $cwd = Cwd::cwd();
+ my $sym = "$caller\::AUTOLOAD";
+
+ $sym->{$cwd} = sub {
+ my $pwd = Cwd::cwd();
+ if ( my $code = $sym->{$pwd} ) {
+ # delegate back to parent dirs
+ goto &$code unless $cwd eq $pwd;
+ }
+ $$sym =~ /([^:]+)$/ or die "Cannot autoload $caller - $sym";
+ unshift @_, ($self, $1);
+ goto &{$self->can('call')} unless uc($1) eq $1;
+ };
+}
+
+sub import {
+ my $class = shift;
+ my $self = $class->new(@_);
+
+ unless ( -f $self->{file} ) {
+ require "$self->{path}/$self->{dispatch}.pm";
+ File::Path::mkpath("$self->{prefix}/$self->{author}");
+ $self->{admin} =
+ "$self->{name}::$self->{dispatch}"->new(_top => $self);
+ $self->{admin}->init;
+ @_ = ($class, _self => $self);
+ goto &{"$self->{name}::import"};
+ }
+
+ *{$self->_caller . "::AUTOLOAD"} = $self->autoload;
+ $self->preload;
+
+ # Unregister loader and worker packages so subdirs can use them again
+ delete $INC{"$self->{file}"};
+ delete $INC{"$self->{path}.pm"};
+}
+
+sub preload {
+ my ($self) = @_;
+
+ unless ( $self->{extentions} ) {
+ $self->load_extensions(
+ "$self->{prefix}/$self->{path}", $self
+ );
+ }
+
+ my @exts = @{$self->{extensions}};
+ unless ( @exts ) {
+ my $admin = $self->{admin};
+ @exts = $admin->load_all_extensions;
+ }
+
+ my %seen_method;
+ foreach my $obj ( @exts ) {
+ while (my ($method, $glob) = each %{ref($obj) . '::'}) {
+ next unless defined *{$glob}{CODE};
+ next if $method =~ /^_/;
+ next if $method eq uc($method);
+ $seen_method{$method}++;
+ }
+ }
+
+ my $caller = $self->_caller;
+ foreach my $name (sort keys %seen_method) {
+ *{"${caller}::$name"} = sub {
+ ${"${caller}::AUTOLOAD"} = "${caller}::$name";
+ goto &{"${caller}::AUTOLOAD"};
+ };
+ }
+}
+
+sub new {
+ my ($class, %args) = @_;
+
+ # ignore the prefix on extension modules built from top level.
+ my $base_path = Cwd::abs_path($FindBin::Bin);
+ unless ( Cwd::abs_path(Cwd::cwd()) eq $base_path ) {
+ delete $args{prefix};
+ }
+
+ return $args{_self} if $args{_self};
+
+ $args{dispatch} ||= 'Admin';
+ $args{prefix} ||= 'inc';
+ $args{author} ||= '.author';
+ $args{bundle} ||= 'inc/BUNDLES';
+ $args{base} ||= $base_path;
+
+ $class =~ s/^\Q$args{prefix}\E:://;
+ $args{name} ||= $class;
+ $args{version} ||= $class->VERSION;
+
+ unless ($args{path}) {
+ $args{path} = $args{name};
+ $args{path} =~ s!::!/!g;
+ }
+ $args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm";
+
+ bless(\%args, $class);
+}
+
+sub call {
+ my $self = shift;
+ my $method = shift;
+ my $obj = $self->load($method) or return;
+
+ unshift @_, $obj;
+ goto &{$obj->can($method)};
+}
+
+sub load {
+ my ($self, $method) = @_;
+
+ $self->load_extensions(
+ "$self->{prefix}/$self->{path}", $self
+ ) unless $self->{extensions};
+
+ foreach my $obj (@{$self->{extensions}}) {
+ return $obj if $obj->can($method);
+ }
+
+ my $admin = $self->{admin} or die <<"END_DIE";
+The '$method' method does not exist in the '$self->{prefix}' path!
+Please remove the '$self->{prefix}' directory and run $0 again to load it.
+END_DIE
+
+ my $obj = $admin->load($method, 1);
+ push @{$self->{extensions}}, $obj;
+
+ $obj;
+}
+
+sub load_extensions {
+ my ($self, $path, $top_obj) = @_;
+
+ unshift @INC, $self->{prefix}
+ unless grep { $_ eq $self->{prefix} } @INC;
+
+ local @INC = ($path, @INC);
+ foreach my $rv ($self->find_extensions($path)) {
+ my ($file, $pkg) = @{$rv};
+ next if $self->{pathnames}{$pkg};
+
+ local $@;
+ my $new = eval { require $file; $pkg->can('new') };
+ unless ( $new ) {
+ warn $@ if $@;
+ next;
+ }
+ $self->{pathnames}{$pkg} = delete $INC{$file};
+ push @{$self->{extensions}}, &{$new}($pkg, _top => $top_obj );
+ }
+
+ $self->{extensions} ||= [];
+}
+
+sub find_extensions {
+ my ($self, $path) = @_;
+
+ my @found;
+ File::Find::find( sub {
+ my $file = $File::Find::name;
+ return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is;
+ return if $1 eq $self->{dispatch};
+
+ $file = "$self->{path}/$1.pm";
+ my $pkg = "$self->{name}::$1"; $pkg =~ s!/!::!g;
+ push @found, [ $file, $pkg ];
+ }, $path ) if -d $path;
+
+ @found;
+}
+
+sub _caller {
+ my $depth = 0;
+ my $caller = caller($depth);
+
+ while ($caller eq __PACKAGE__) {
+ $depth++;
+ $caller = caller($depth);
+ }
+
+ $caller;
+}
+
+1;
diff --git a/inc/Module/Install/Base.pm b/inc/Module/Install/Base.pm
new file mode 100644
index 0000000..8fa3819
--- /dev/null
+++ b/inc/Module/Install/Base.pm
@@ -0,0 +1,63 @@
+#line 1 "inc/Module/Install/Base.pm - /usr/local/share/perl/5.8.7/Module/Install/Base.pm"
+package Module::Install::Base;
+
+# Suspend handler for "redefined" warnings
+BEGIN { my $w = $SIG{__WARN__}; $SIG{__WARN__} = sub { $w } };
+
+#line 30
+
+sub new {
+ my ($class, %args) = @_;
+
+ foreach my $method (qw(call load)) {
+ *{"$class\::$method"} = sub {
+ +shift->_top->$method(@_);
+ } unless defined &{"$class\::$method"};
+ }
+
+ bless(\%args, $class);
+}
+
+#line 48
+
+sub AUTOLOAD {
+ my $self = shift;
+
+ local $@;
+ my $autoload = eval { $self->_top->autoload } or return;
+ goto &$autoload;
+}
+
+#line 62
+
+sub _top { $_[0]->{_top} }
+
+#line 73
+
+sub admin {
+ my $self = shift;
+ $self->_top->{admin} or Module::Install::Base::FakeAdmin->new;
+}
+
+sub is_admin {
+ my $self = shift;
+ $self->admin->VERSION;
+}
+
+sub DESTROY {}
+
+package Module::Install::Base::FakeAdmin;
+
+my $Fake;
+sub new { $Fake ||= bless(\@_, $_[0]) }
+sub AUTOLOAD {}
+sub DESTROY {}
+
+1;
+
+# Restore warning handler
+BEGIN { $SIG{__WARN__} = $SIG{__WARN__}->() };
+
+__END__
+
+#line 120
diff --git a/inc/Module/Install/Can.pm b/inc/Module/Install/Can.pm
new file mode 100644
index 0000000..899f23c
--- /dev/null
+++ b/inc/Module/Install/Can.pm
@@ -0,0 +1,69 @@
+#line 1 "inc/Module/Install/Can.pm - /usr/local/share/perl/5.8.7/Module/Install/Can.pm"
+package Module::Install::Can;
+use Module::Install::Base; @ISA = qw(Module::Install::Base);
+$VERSION = '0.01';
+
+use strict;
+use Config ();
+use File::Spec ();
+use ExtUtils::MakeMaker ();
+
+# check if we can load some module
+sub can_use {
+ my ($self, $mod, $ver) = @_;
+ $mod =~ s{::|\\}{/}g;
+ $mod .= ".pm" unless $mod =~ /\.pm$/i;
+
+ my $pkg = $mod;
+ $pkg =~ s{/}{::}g;
+ $pkg =~ s{\.pm$}{}i;
+
+ local $@;
+ eval { require $mod; $pkg->VERSION($ver || 0); 1 };
+}
+
+# check if we can run some command
+sub can_run {
+ my ($self, $cmd) = @_;
+
+ my $_cmd = $cmd;
+ return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd));
+
+ for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
+ my $abs = File::Spec->catfile($dir, $_[1]);
+ return $abs if (-x $abs or $abs = MM->maybe_command($abs));
+ }
+
+ return;
+}
+
+sub can_cc {
+ my $self = shift;
+ my @chunks = split(/ /, $Config::Config{cc}) or return;
+
+ # $Config{cc} may contain args; try to find out the program part
+ while (@chunks) {
+ return $self->can_run("@chunks") || (pop(@chunks), next);
+ }
+
+ return;
+}
+
+# Fix Cygwin bug on maybe_command();
+if ($^O eq 'cygwin') {
+ require ExtUtils::MM_Cygwin;
+ require ExtUtils::MM_Win32;
+ if (!defined(&ExtUtils::MM_Cygwin::maybe_command)) {
+ *ExtUtils::MM_Cygwin::maybe_command = sub {
+ my ($self, $file) = @_;
+ if ($file =~ m{^/cygdrive/}i) {
+ ExtUtils::MM_Win32->maybe_command($file);
+ }
+ else {
+ $self->SUPER::maybe_command($file);
+ }
+ }
+ }
+}
+
+1;
diff --git a/inc/Module/Install/Fetch.pm b/inc/Module/Install/Fetch.pm
new file mode 100644
index 0000000..83186e4
--- /dev/null
+++ b/inc/Module/Install/Fetch.pm
@@ -0,0 +1,86 @@
+#line 1 "inc/Module/Install/Fetch.pm - /usr/local/share/perl/5.8.7/Module/Install/Fetch.pm"
+package Module::Install::Fetch;
+use Module::Install::Base; @ISA = qw(Module::Install::Base);
+
+$VERSION = '0.01';
+
+sub get_file {
+ my ($self, %args) = @_;
+ my ($scheme, $host, $path, $file) =
+ $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
+
+ if ($scheme eq 'http' and !eval { require LWP::Simple; 1 }) {
+ $args{url} = $args{ftp_url}
+ or (warn("LWP support unavailable!\n"), return);
+ ($scheme, $host, $path, $file) =
+ $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
+ }
+
+ $|++;
+ print "Fetching '$file' from $host... ";
+
+ unless (eval { require Socket; Socket::inet_aton($host) }) {
+ warn "'$host' resolve failed!\n";
+ return;
+ }
+
+ return unless $scheme eq 'ftp' or $scheme eq 'http';
+
+ require Cwd;
+ my $dir = Cwd::getcwd();
+ chdir $args{local_dir} or return if exists $args{local_dir};
+
+ if (eval { require LWP::Simple; 1 }) {
+ LWP::Simple::mirror($args{url}, $file);
+ }
+ elsif (eval { require Net::FTP; 1 }) { eval {
+ # use Net::FTP to get past firewall
+ my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600);
+ $ftp->login("anonymous", 'anonymous at example.com');
+ $ftp->cwd($path);
+ $ftp->binary;
+ $ftp->get($file) or (warn("$!\n"), return);
+ $ftp->quit;
+ } }
+ elsif (my $ftp = $self->can_run('ftp')) { eval {
+ # no Net::FTP, fallback to ftp.exe
+ require FileHandle;
+ my $fh = FileHandle->new;
+
+ local $SIG{CHLD} = 'IGNORE';
+ unless ($fh->open("|$ftp -n")) {
+ warn "Couldn't open ftp: $!\n";
+ chdir $dir; return;
+ }
+
+ my @dialog = split(/\n/, << ".");
+open $host
+user anonymous anonymous\@example.com
+cd $path
+binary
+get $file $file
+quit
+.
+ foreach (@dialog) { $fh->print("$_\n") }
+ $fh->close;
+ } }
+ else {
+ warn "No working 'ftp' program available!\n";
+ chdir $dir; return;
+ }
+
+ unless (-f $file) {
+ warn "Fetching failed: $@\n";
+ chdir $dir; return;
+ }
+
+ return if exists $args{size} and -s $file != $args{size};
+ system($args{run}) if exists $args{run};
+ unlink($file) if $args{remove};
+
+ print(((!exists $args{check_for} or -e $args{check_for})
+ ? "done!" : "failed! ($!)"), "\n");
+ chdir $dir; return !$?;
+}
+
+1;
diff --git a/inc/Module/Install/Makefile.pm b/inc/Module/Install/Makefile.pm
new file mode 100644
index 0000000..4542867
--- /dev/null
+++ b/inc/Module/Install/Makefile.pm
@@ -0,0 +1,157 @@
+#line 1 "inc/Module/Install/Makefile.pm - /usr/local/share/perl/5.8.7/Module/Install/Makefile.pm"
+package Module::Install::Makefile;
+use Module::Install::Base; @ISA = qw(Module::Install::Base);
+
+$VERSION = '0.01';
+
+use strict 'vars';
+use vars '$VERSION';
+
+use ExtUtils::MakeMaker ();
+
+sub Makefile { $_[0] }
+
+sub prompt {
+ shift;
+ goto &ExtUtils::MakeMaker::prompt;
+}
+
+sub makemaker_args {
+ my $self = shift;
+ my $args = ($self->{makemaker_args} ||= {});
+ %$args = ( %$args, @_ ) if @_;
+ $args;
+}
+
+sub build_subdirs {
+ my $self = shift;
+ my $subdirs = $self->makemaker_args->{DIR} ||= [];
+ for my $subdir (@_) {
+ push @$subdirs, $subdir;
+ }
+}
+
+sub clean_files {
+ my $self = shift;
+ my $clean = $self->makemaker_args->{clean} ||= {};
+ %$clean = (
+ %$clean,
+ FILES => join(" ", grep length, $clean->{FILES}, @_),
+ );
+}
+
+sub libs {
+ my $self = shift;
+ my $libs = ref $_[0] ? shift : [shift];
+ $self->makemaker_args( LIBS => $libs );
+}
+
+sub inc {
+ my $self = shift;
+ $self->makemaker_args( INC => shift );
+}
+
+sub write {
+ my $self = shift;
+ die "&Makefile->write() takes no arguments\n" if @_;
+
+ my $args = $self->makemaker_args;
+
+ $args->{DISTNAME} = $self->name;
+ $args->{NAME} = $self->module_name || $self->name || $self->determine_NAME($args);
+ $args->{VERSION} = $self->version || $self->determine_VERSION($args);
+ $args->{NAME} =~ s/-/::/g;
+
+ $args->{test} = {TESTS => $self->tests} if $self->tests;
+
+ if ($] >= 5.005) {
+ $args->{ABSTRACT} = $self->abstract;
+ $args->{AUTHOR} = $self->author;
+ }
+ if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) {
+ $args->{NO_META} = 1;
+ }
+ if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 ) {
+ $args->{SIGN} = 1 if $self->sign;
+ }
+ delete $args->{SIGN} unless $self->is_admin;
+
+ # merge both kinds of requires into prereq_pm
+ my $prereq = ($args->{PREREQ_PM} ||= {});
+ %$prereq = ( %$prereq, map { @$_ } map { @$_ } grep $_,
+ ($self->build_requires, $self->requires) );
+
+ # merge both kinds of requires into prereq_pm
+ my $subdirs = ($args->{DIR} ||= []);
+ if ($self->bundles) {
+ foreach my $bundle (@{ $self->bundles }) {
+ my ($file, $dir) = @$bundle;
+ push @$subdirs, $dir if -d $dir;
+ delete $prereq->{$file};
+ }
+ }
+
+ if (my $perl_version = $self->perl_version) {
+ eval "use $perl_version; 1"
+ or die "ERROR: perl: Version $] is installed, ".
+ "but we need version >= $perl_version";
+ }
+
+ my %args = map {($_ => $args->{$_})} grep {defined($args->{$_})} keys %$args;
+
+ if ($self->admin->preop) {
+ $args{dist} = $self->admin->preop;
+ }
+
+ ExtUtils::MakeMaker::WriteMakefile(%args);
+
+ $self->fix_up_makefile();
+}
+
+sub fix_up_makefile {
+ my $self = shift;
+ my $top_class = ref($self->_top) || '';
+ my $top_version = $self->_top->VERSION || '';
+
+ my $preamble = $self->preamble
+ ? "# Preamble by $top_class $top_version\n" . $self->preamble
+ : '';
+ my $postamble = "# Postamble by $top_class $top_version\n" .
+ ($self->postamble || '');
+
+ local *MAKEFILE;
+ open MAKEFILE, '< Makefile' or die $!;
+ my $makefile = do { local $/; <MAKEFILE> };
+ close MAKEFILE;
+
+ $makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
+ $makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
+ $makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g;
+
+ $makefile =~ s/^(FULLPERL = .*)/$1 -Iinc/m;
+ $makefile =~ s/^(PERL = .*)/$1 -Iinc/m;
+
+ open MAKEFILE, '> Makefile' or die $!;
+ print MAKEFILE "$preamble$makefile$postamble";
+ close MAKEFILE;
+}
+
+sub preamble {
+ my ($self, $text) = @_;
+ $self->{preamble} = $text . $self->{preamble} if defined $text;
+ $self->{preamble};
+}
+
+sub postamble {
+ my ($self, $text) = @_;
+
+ $self->{postamble} ||= $self->admin->postamble;
+ $self->{postamble} .= $text if defined $text;
+ $self->{postamble}
+}
+
+1;
+
+__END__
+
+#line 286
diff --git a/inc/Module/Install/Metadata.pm b/inc/Module/Install/Metadata.pm
new file mode 100644
index 0000000..65b7f17
--- /dev/null
+++ b/inc/Module/Install/Metadata.pm
@@ -0,0 +1,301 @@
+#line 1 "inc/Module/Install/Metadata.pm - /usr/local/share/perl/5.8.7/Module/Install/Metadata.pm"
+package Module::Install::Metadata;
+
+use strict 'vars';
+use Module::Install::Base;
+
+use vars qw($VERSION @ISA);
+BEGIN {
+ $VERSION = '0.06';
+ @ISA = 'Module::Install::Base';
+}
+
+my @scalar_keys = qw{
+ name module_name abstract author version license
+ distribution_type perl_version tests
+};
+
+my @tuple_keys = qw{
+ build_requires requires recommends bundles
+};
+
+sub Meta { shift }
+sub Meta_ScalarKeys { @scalar_keys }
+sub Meta_TupleKeys { @tuple_keys }
+
+foreach my $key (@scalar_keys) {
+ *$key = sub {
+ my $self = shift;
+ return $self->{values}{$key} if defined wantarray and !@_;
+ $self->{values}{$key} = shift;
+ return $self;
+ };
+}
+
+foreach my $key (@tuple_keys) {
+ *$key = sub {
+ my $self = shift;
+ return $self->{values}{$key} unless @_;
+
+ my @rv;
+ while (@_) {
+ my $module = shift or last;
+ my $version = shift || 0;
+ if ( $module eq 'perl' ) {
+ $version =~ s{^(\d+)\.(\d+)\.(\d+)}
+ {$1 + $2/1_000 + $3/1_000_000}e;
+ $self->perl_version($version);
+ next;
+ }
+ my $rv = [ $module, $version ];
+ push @rv, $rv;
+ }
+ push @{ $self->{values}{$key} }, @rv;
+ @rv;
+ };
+}
+
+sub sign {
+ my $self = shift;
+ return $self->{'values'}{'sign'} if defined wantarray and !@_;
+ $self->{'values'}{'sign'} = ( @_ ? $_[0] : 1 );
+ return $self;
+}
+
+sub all_from {
+ my ( $self, $file ) = @_;
+
+ unless ( defined($file) ) {
+ my $name = $self->name
+ or die "all_from called with no args without setting name() first";
+ $file = join('/', 'lib', split(/-/, $name)) . '.pm';
+ $file =~ s{.*/}{} unless -e $file;
+ die "all_from: cannot find $file from $name" unless -e $file;
+ }
+
+ $self->version_from($file) unless $self->version;
+ $self->perl_version_from($file) unless $self->perl_version;
+
+ # The remaining probes read from POD sections; if the file
+ # has an accompanying .pod, use that instead
+ my $pod = $file;
+ if ( $pod =~ s/\.pm$/.pod/i and -e $pod ) {
+ $file = $pod;
+ }
+
+ $self->author_from($file) unless $self->author;
+ $self->license_from($file) unless $self->license;
+ $self->abstract_from($file) unless $self->abstract;
+}
+
+sub provides {
+ my $self = shift;
+ my $provides = ( $self->{values}{provides} ||= {} );
+ %$provides = (%$provides, @_) if @_;
+ return $provides;
+}
+
+sub auto_provides {
+ my $self = shift;
+ return $self unless $self->is_admin;
+
+ unless (-e 'MANIFEST') {
+ warn "Cannot deduce auto_provides without a MANIFEST, skipping\n";
+ return $self;
+ }
+
+ # Avoid spurious warnings as we are not checking manifest here.
+
+ local $SIG{__WARN__} = sub {1};
+ require ExtUtils::Manifest;
+ local *ExtUtils::Manifest::manicheck = sub { return };
+
+ require Module::Build;
+ my $build = Module::Build->new(
+ dist_name => $self->{name},
+ dist_version => $self->{version},
+ license => $self->{license},
+ );
+ $self->provides(%{ $build->find_dist_packages || {} });
+}
+
+sub feature {
+ my $self = shift;
+ my $name = shift;
+ my $features = ( $self->{values}{features} ||= [] );
+
+ my $mods;
+
+ if ( @_ == 1 and ref( $_[0] ) ) {
+ # The user used ->feature like ->features by passing in the second
+ # argument as a reference. Accomodate for that.
+ $mods = $_[0];
+ }
+ else {
+ $mods = \@_;
+ }
+
+ my $count = 0;
+ push @$features, (
+ $name => [
+ map {
+ ref($_) ? ( ref($_) eq 'HASH' ) ? %$_
+ : @$_
+ : $_
+ } @$mods
+ ]
+ );
+
+ return @$features;
+}
+
+sub features {
+ my $self = shift;
+ while ( my ( $name, $mods ) = splice( @_, 0, 2 ) ) {
+ $self->feature( $name, @$mods );
+ }
+ return @{ $self->{values}{features} };
+}
+
+sub no_index {
+ my $self = shift;
+ my $type = shift;
+ push @{ $self->{values}{no_index}{$type} }, @_ if $type;
+ return $self->{values}{no_index};
+}
+
+sub read {
+ my $self = shift;
+ $self->include_deps( 'YAML', 0 );
+
+ require YAML;
+ my $data = YAML::LoadFile('META.yml');
+
+ # Call methods explicitly in case user has already set some values.
+ while ( my ( $key, $value ) = each %$data ) {
+ next unless $self->can($key);
+ if ( ref $value eq 'HASH' ) {
+ while ( my ( $module, $version ) = each %$value ) {
+ $self->can($key)->($self, $module => $version );
+ }
+ }
+ else {
+ $self->can($key)->($self, $value);
+ }
+ }
+ return $self;
+}
+
+sub write {
+ my $self = shift;
+ return $self unless $self->is_admin;
+ $self->admin->write_meta;
+ return $self;
+}
+
+sub version_from {
+ my ( $self, $file ) = @_;
+ require ExtUtils::MM_Unix;
+ $self->version( ExtUtils::MM_Unix->parse_version($file) );
+}
+
+sub abstract_from {
+ my ( $self, $file ) = @_;
+ require ExtUtils::MM_Unix;
+ $self->abstract(
+ bless(
+ { DISTNAME => $self->name },
+ 'ExtUtils::MM_Unix'
+ )->parse_abstract($file)
+ );
+}
+
+sub _slurp {
+ my ( $self, $file ) = @_;
+
+ local *FH;
+ open FH, "< $file" or die "Cannot open $file.pod: $!";
+ do { local $/; <FH> };
+}
+
+sub perl_version_from {
+ my ( $self, $file ) = @_;
+
+ if (
+ $self->_slurp($file) =~ m/
+ ^
+ use \s*
+ v?
+ ([\d\.]+)
+ \s* ;
+ /ixms
+ )
+ {
+ $self->perl_version($1);
+ }
+ else {
+ warn "Cannot determine perl version info from $file\n";
+ return;
+ }
+}
+
+sub author_from {
+ my ( $self, $file ) = @_;
+ my $content = $self->_slurp($file);
+ if ($content =~ m/
+ =head \d \s+ (?:authors?)\b \s*
+ ([^\n]*)
+ |
+ =head \d \s+ (?:licen[cs]e|licensing|copyright|legal)\b \s*
+ .*? copyright .*? \d\d\d[\d.]+ \s* (?:\bby\b)? \s*
+ ([^\n]*)
+ /ixms) {
+ my $author = $1 || $2;
+ $author =~ s{E<lt>}{<}g;
+ $author =~ s{E<gt>}{>}g;
+ $self->author($author);
+ }
+ else {
+ warn "Cannot determine author info from $file\n";
+ }
+}
+
+sub license_from {
+ my ( $self, $file ) = @_;
+
+ if (
+ $self->_slurp($file) =~ m/
+ =head \d \s+
+ (?:licen[cs]e|licensing|copyright|legal)\b
+ (.*?)
+ (=head\\d.*|=cut.*|)
+ \z
+ /ixms
+ )
+ {
+ my $license_text = $1;
+ my @phrases = (
+ 'under the same (?:terms|license) as perl itself' => 'perl',
+ 'GNU public license' => 'gpl',
+ 'GNU lesser public license' => 'gpl',
+ 'BSD license' => 'bsd',
+ 'Artistic license' => 'artistic',
+ 'GPL' => 'gpl',
+ 'LGPL' => 'lgpl',
+ 'BSD' => 'bsd',
+ 'Artistic' => 'artistic',
+ );
+ while ( my ( $pattern, $license ) = splice( @phrases, 0, 2 ) ) {
+ $pattern =~ s{\s+}{\\s+}g;
+ if ( $license_text =~ /\b$pattern\b/i ) {
+ $self->license($license);
+ return 1;
+ }
+ }
+ }
+
+ warn "Cannot determine license info from $file\n";
+ return 'unknown';
+}
+
+1;
diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
new file mode 100644
index 0000000..2b97dc2
--- /dev/null
+++ b/inc/Module/Install/RTx.pm
@@ -0,0 +1,158 @@
+#line 1 "inc/Module/Install/RTx.pm - /usr/local/share/perl/5.8.7/Module/Install/RTx.pm"
+package Module::Install::RTx;
+use Module::Install::Base; @ISA = qw(Module::Install::Base);
+
+$Module::Install::RTx::VERSION = '0.11';
+
+use strict;
+use FindBin;
+use File::Glob ();
+use File::Basename ();
+
+sub RTx {
+ my ($self, $name) = @_;
+ my $RTx = 'RTx';
+ $RTx = $1 if $name =~ s/^(\w+)-//;
+ my $fname = $name;
+ $fname =~ s!-!/!g;
+
+ $self->name("$RTx-$name")
+ unless $self->name;
+ $self->abstract("RT $name Extension")
+ unless $self->abstract;
+ $self->version_from (-e "$name.pm" ? "$name.pm" : "lib/$RTx/$fname.pm")
+ unless $self->version;
+
+ my @prefixes = (qw(/opt /usr/local /home /usr /sw ));
+ my $prefix = $ENV{PREFIX};
+ @ARGV = grep { /PREFIX=(.*)/ ? (($prefix = $1), 0) : 1 } @ARGV;
+
+ if ($prefix) {
+ $RT::LocalPath = $prefix;
+ $INC{'RT.pm'} = "$RT::LocalPath/lib/RT.pm";
+ }
+ else {
+ local @INC = (
+ @INC,
+ $ENV{RTHOME} ? ($ENV{RTHOME}, "$ENV{RTHOME}/lib") : (),
+ map {( "$_/rt3/lib", "$_/lib/rt3", "$_/lib" )} grep $_, @prefixes
+ );
+ until ( eval { require RT; $RT::LocalPath } ) {
+ warn "Cannot find the location of RT.pm that defines \$RT::LocalPath in: @INC\n";
+ $_ = $self->prompt("Path to your RT.pm:") or exit;
+ push @INC, $_, "$_/rt3/lib", "$_/lib/rt3";
+ }
+ }
+
+ my $lib_path = File::Basename::dirname($INC{'RT.pm'});
+ print "Using RT configurations from $INC{'RT.pm'}:\n";
+
+ $RT::LocalVarPath ||= $RT::VarPath;
+ $RT::LocalPoPath ||= $RT::LocalLexiconPath;
+ $RT::LocalHtmlPath ||= $RT::MasonComponentRoot;
+
+ my %path;
+ my $with_subdirs = $ENV{WITH_SUBDIRS};
+ @ARGV = grep { /WITH_SUBDIRS=(.*)/ ? (($with_subdirs = $1), 0) : 1 } @ARGV;
+ my %subdirs = map { $_ => 1 } split(/\s*,\s*/, $with_subdirs);
+
+ foreach (qw(bin etc html po sbin var)) {
+ next unless -d "$FindBin::Bin/$_";
+ next if %subdirs and !$subdirs{$_};
+ $self->no_index( directory => $_ );
+
+ no strict 'refs';
+ my $varname = "RT::Local" . ucfirst($_) . "Path";
+ $path{$_} = ${$varname} || "$RT::LocalPath/$_";
+ }
+
+ $path{$_} .= "/$name" for grep $path{$_}, qw(etc po var);
+ my $args = join(', ', map "q($_)", %path);
+ $path{lib} = "$RT::LocalPath/lib" unless %subdirs and !$subdirs{'lib'};
+ print "./$_\t=> $path{$_}\n" for sort keys %path;
+
+ if (my @dirs = map { (-D => $_) } grep $path{$_}, qw(bin html sbin)) {
+ my @po = map { (-o => $_) } grep -f, File::Glob::bsd_glob("po/*.po");
+ $self->postamble(<< ".") if @po;
+lexicons ::
+\t\$(NOECHO) \$(PERL) -MLocale::Maketext::Extract::Run=xgettext -e \"xgettext(qw(@dirs @po))\"
+.
+ }
+
+ my $postamble = << ".";
+install ::
+\t\$(NOECHO) \$(PERL) -MExtUtils::Install -e \"install({$args})\"
+.
+
+ if ($path{var} and -d $RT::MasonDataDir) {
+ my ($uid, $gid) = (stat($RT::MasonDataDir))[4, 5];
+ $postamble .= << ".";
+\t\$(NOECHO) chown -R $uid:$gid $path{var}
+.
+ }
+
+ my %has_etc;
+ if (File::Glob::bsd_glob("$FindBin::Bin/etc/schema.*")) {
+ # got schema, load factory module
+ $has_etc{schema}++;
+ $self->load('RTxFactory');
+ $self->postamble(<< ".");
+factory ::
+\t\$(NOECHO) \$(PERL) -Ilib -I"$lib_path" -Minc::Module::Install -e"RTxFactory(qw($RTx $name))"
+
+dropdb ::
+\t\$(NOECHO) \$(PERL) -Ilib -I"$lib_path" -Minc::Module::Install -e"RTxFactory(qw($RTx $name drop))"
+
+.
+ }
+ if (File::Glob::bsd_glob("$FindBin::Bin/etc/acl.*")) {
+ $has_etc{acl}++;
+ }
+ if (-e 'etc/initialdata') {
+ $has_etc{initialdata}++;
+ }
+
+ $self->postamble("$postamble\n");
+ if (%subdirs and !$subdirs{'lib'}) {
+ $self->makemaker_args(
+ PM => { "" => "" },
+ )
+ }
+ else {
+ $self->makemaker_args( INSTALLSITELIB => "$RT::LocalPath/lib" );
+ }
+
+ if (%has_etc) {
+ $self->load('RTxInitDB');
+ print "For first-time installation, type 'make initdb'.\n";
+ my $initdb = '';
+ $initdb .= <<"." if $has_etc{schema};
+\t\$(NOECHO) \$(PERL) -Ilib -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(schema))"
+.
+ $initdb .= <<"." if $has_etc{acl};
+\t\$(NOECHO) \$(PERL) -Ilib -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(acl))"
+.
+ $initdb .= <<"." if $has_etc{initialdata};
+\t\$(NOECHO) \$(PERL) -Ilib -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(insert))"
+.
+ $self->postamble("initdb ::\n$initdb\n");
+ $self->postamble("initialize-database ::\n$initdb\n");
+ }
+}
+
+sub RTxInit {
+ unshift @INC, substr(delete($INC{'RT.pm'}), 0, -5) if $INC{'RT.pm'};
+ require RT;
+ RT::LoadConfig();
+ RT::ConnectToDatabase();
+
+ die "Cannot load RT" unless $RT::Handle and $RT::DatabaseType;
+}
+
+1;
+
+__END__
+
+#line 220
+
+#line 241
diff --git a/inc/Module/Install/Win32.pm b/inc/Module/Install/Win32.pm
new file mode 100644
index 0000000..c0adaba
--- /dev/null
+++ b/inc/Module/Install/Win32.pm
@@ -0,0 +1,63 @@
+#line 1 "inc/Module/Install/Win32.pm - /usr/local/share/perl/5.8.7/Module/Install/Win32.pm"
+package Module::Install::Win32;
+use Module::Install::Base; @ISA = qw(Module::Install::Base);
+
+$VERSION = '0.02';
+
+use strict;
+
+# determine if the user needs nmake, and download it if needed
+sub check_nmake {
+ my $self = shift;
+ $self->load('can_run');
+ $self->load('get_file');
+
+ require Config;
+ return unless (
+ $Config::Config{make} and
+ $Config::Config{make} =~ /^nmake\b/i and
+ $^O eq 'MSWin32' and
+ !$self->can_run('nmake')
+ );
+
+ print "The required 'nmake' executable not found, fetching it...\n";
+
+ require File::Basename;
+ my $rv = $self->get_file(
+ url => 'http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe',
+ ftp_url => 'ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe',
+ local_dir => File::Basename::dirname($^X),
+ size => 51928,
+ run => 'Nmake15.exe /o > nul',
+ check_for => 'Nmake.exe',
+ remove => 1,
+ );
+
+ if (!$rv) {
+ die << '.';
+
+-------------------------------------------------------------------------------
+
+Since you are using Microsoft Windows, you will need the 'nmake' utility
+before installation. It's available at:
+
+ http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe
+ or
+ ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe
+
+Please download the file manually, save it to a directory in %PATH% (e.g.
+C:\WINDOWS\COMMAND\), then launch the MS-DOS command line shell, "cd" to
+that directory, and run "Nmake15.exe" from there; that will create the
+'nmake.exe' file needed by this module.
+
+You may then resume the installation process described in README.
+
+-------------------------------------------------------------------------------
+.
+ }
+}
+
+1;
+
+__END__
+
diff --git a/inc/Module/Install/WriteAll.pm b/inc/Module/Install/WriteAll.pm
new file mode 100644
index 0000000..932ea40
--- /dev/null
+++ b/inc/Module/Install/WriteAll.pm
@@ -0,0 +1,36 @@
+#line 1 "inc/Module/Install/WriteAll.pm - /usr/local/share/perl/5.8.7/Module/Install/WriteAll.pm"
+package Module::Install::WriteAll;
+use Module::Install::Base; @ISA = qw(Module::Install::Base);
+
+sub WriteAll {
+ my $self = shift;
+ my %args = (
+ meta => 1,
+ sign => 0,
+ inline => 0,
+ check_nmake => 1,
+ @_
+ );
+
+ $self->sign(1) if $args{sign};
+ $self->Meta->write if $args{meta};
+ $self->admin->WriteAll(%args) if $self->is_admin;
+
+ if ($0 =~ /Build.PL$/i) {
+ $self->Build->write;
+ }
+ else {
+ $self->check_nmake if $args{check_nmake};
+ $self->makemaker_args( PL_FILES => {} )
+ unless $self->makemaker_args->{'PL_FILES'};
+
+ if ($args{inline}) {
+ $self->Inline->write;
+ }
+ else {
+ $self->Makefile->write;
+ }
+ }
+}
+
+1;
commit f816f63121bed40a96ec89da6bd4f93097e1029d
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Tue Mar 14 17:46:07 2006 +0000
signature update
diff --git a/SIGNATURE b/SIGNATURE
index 1823d07..0a26d8e 100644
--- a/SIGNATURE
+++ b/SIGNATURE
@@ -35,7 +35,7 @@ SHA1 272c53e6377bdcf08fa83693dfdfa8302ad6306b lib/RT/URI/svn.pm
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
-iD8DBQFEFv9GEi9d9xCOQEYRAuECAJ4tu4lvl7NQAJANXaQMeqlpD5kmQQCcDyS9
-6lifsRQGyednXikZW0HPr+A=
-=O+dS
+iD8DBQFEFwA9Ei9d9xCOQEYRAjErAKCcSSukydZtTMzPDOkk5WkN2zsZpwCgpczp
+7wJYKfdmZj3PIwC/8lMrPJM=
+=KhUm
-----END PGP SIGNATURE-----
commit 47252f4026db7081da554becd1b5d174e4d6e60b
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Thu Mar 23 06:16:46 2006 +0000
version bump
diff --git a/Changes b/Changes
index 0c6fc5b..6965b43 100644
--- a/Changes
+++ b/Changes
@@ -1,4 +1,8 @@
+0.05
+
+* The previous merge failed
+
Changes since 0.04
* README updates
diff --git a/lib/RT/Integration/SVN.pm b/lib/RT/Integration/SVN.pm
index 1b4fc17..3b76ef2 100644
--- a/lib/RT/Integration/SVN.pm
+++ b/lib/RT/Integration/SVN.pm
@@ -3,4 +3,4 @@ use warnings;
package RT::Integration::SVN;
-our $VERSION = '0.04';
+our $VERSION = '0.05';
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list