[Bps-public-commit] r19008 - in RT-AjaxyReplyPage: . html/Plugin/AjaxyReplyPage/Elements html/Ticket inc/Module/Install

jesse at bestpractical.com jesse at bestpractical.com
Tue Mar 31 22:59:05 EDT 2009


Author: jesse
Date: Tue Mar 31 22:59:05 2009
New Revision: 19008

Modified:
   RT-AjaxyReplyPage/Makefile.PL
   RT-AjaxyReplyPage/html/Plugin/AjaxyReplyPage/Elements/ShowRecipients
   RT-AjaxyReplyPage/html/Plugin/AjaxyReplyPage/Elements/UpdateType
   RT-AjaxyReplyPage/html/Ticket/Update.html
   RT-AjaxyReplyPage/inc/Module/Install.pm
   RT-AjaxyReplyPage/inc/Module/Install/Base.pm
   RT-AjaxyReplyPage/inc/Module/Install/Can.pm
   RT-AjaxyReplyPage/inc/Module/Install/Fetch.pm
   RT-AjaxyReplyPage/inc/Module/Install/Makefile.pm
   RT-AjaxyReplyPage/inc/Module/Install/Metadata.pm
   RT-AjaxyReplyPage/inc/Module/Install/RTx.pm
   RT-AjaxyReplyPage/inc/Module/Install/Win32.pm
   RT-AjaxyReplyPage/inc/Module/Install/WriteAll.pm

Log:
Updates for visual style and to add support for gpg 

Modified: RT-AjaxyReplyPage/Makefile.PL
==============================================================================
--- RT-AjaxyReplyPage/Makefile.PL	(original)
+++ RT-AjaxyReplyPage/Makefile.PL	Tue Mar 31 22:59:05 2009
@@ -1,6 +1,4 @@
 use inc::Module::Install;
-
 RTx('RT-AjaxyReplyPage');
-
 &WriteAll;
 

Modified: RT-AjaxyReplyPage/html/Plugin/AjaxyReplyPage/Elements/ShowRecipients
==============================================================================
--- RT-AjaxyReplyPage/html/Plugin/AjaxyReplyPage/Elements/ShowRecipients	(original)
+++ RT-AjaxyReplyPage/html/Plugin/AjaxyReplyPage/Elements/ShowRecipients	Tue Mar 31 22:59:05 2009
@@ -1,4 +1,7 @@
 <%ARGS>
+$Action => ''
+$UpdateType => ''
+$UpdateSquelch => ''
 $TicketObj
 @SendTo => undef
 </%ARGS>
@@ -6,7 +9,7 @@
 my $action;
 
 
-if ($ARGS{'UpdateSquelch'}) {
+if ($UpdateSquelch) {
 my %SendTo = map { $_ => 1 } @SendTo;
 my @recipients = split(/\s*,\s*/,$TicketObj->RequestorAddresses);
 foreach my $recipient (@recipients) {
@@ -19,7 +22,7 @@
 }
 
 
-if (( $ARGS{'UpdateType'} eq 'response' ) || ($ARGS{'Action'} eq 'Respond' )) {
+if (( $UpdateType eq 'response' ) || ($Action eq 'Respond' )) {
     $action = 'Correspond';
 }
 else {
@@ -28,8 +31,10 @@
 
 my @non_recipients = $TicketObj->SquelchMailTo;
 </%init>
+<tr><td colspan="2"><hr/></td></tr>
+</tr>
 <tr>
-<td>To</td>
+<td class="label">To</td>
 <td>
 <input type="hidden" name="DoSquelch" value="1" />
 % my @recipients;
@@ -43,3 +48,4 @@
 <div align="right"><input type="submit" name="UpdateSquelch" value="Save changes to blacklist"></div>
 </td>
 </tr>
+<tr><td colspan="2"><hr/></td></tr>

Modified: RT-AjaxyReplyPage/html/Plugin/AjaxyReplyPage/Elements/UpdateType
==============================================================================
--- RT-AjaxyReplyPage/html/Plugin/AjaxyReplyPage/Elements/UpdateType	(original)
+++ RT-AjaxyReplyPage/html/Plugin/AjaxyReplyPage/Elements/UpdateType	Tue Mar 31 22:59:05 2009
@@ -1,18 +1,20 @@
 <tr>
-<td><&|/l&>Update Type</&>:</td>
+<td class="label"><&|/l&>Update Type</&>:</td>
 <td>
 % if ($CanComment) {
-<input type=radio id="CommentUpdate" name="UpdateType" onClick="document.getElementById('replybox').style.background = '#eeeeee'; ahah('/Plugin/AjaxyReplyPage/ShowRecipients?TicketId=<%$TicketObj->id%>&UpdateType=private', 'recipients');" value="private" <%$ARGS{'UpdateType'} eq "private" ? "CHECKED" : !$ARGS{'UpdateType'}&&$CommentDefault%>><label for="CommentUpdate"><&|/l&>Comments (Not sent to requestors)</&></label><br/>
+<input type=radio id="CommentUpdate" name="UpdateType" onClick="document.getElementById('replybox').style.background = '#eeeeee'; ahah('/Plugin/AjaxyReplyPage/ShowRecipients?TicketId=<%$TicketObj->id%>&UpdateType=private', 'recipients');" value="private" <%$UpdateType eq "private" ? "CHECKED" : !$UpdateType&&$CommentDefault%>><label for="CommentUpdate"><&|/l&>Comments (Not sent to requestors)</&></label><br/>
 % }
 % if ($CanRespond) {
-<input onClick="document.getElementById('replybox').style.background = '#fcc'; ahah('/Plugin/AjaxyReplyPage/ShowRecipients?TicketId=<%$TicketObj->id%>&UpdateType=response', 'recipients');" type=radio id="ReplyUpdate" name="UpdateType" value="response" <%$ARGS{'UpdateType'} eq "response" ? "CHECKED" : !$ARGS{'UpdateType'}&&$ResponseDefault%>><label for="ReplyUpdate"><&|/l&>Reply to requestors</&></label><br/>
+<input onClick="document.getElementById('replybox').style.background = '#fcc'; ahah('/Plugin/AjaxyReplyPage/ShowRecipients?TicketId=<%$TicketObj->id%>&UpdateType=response', 'recipients');" type=radio id="ReplyUpdate" name="UpdateType" value="response" <%$UpdateType eq "response" ? "CHECKED" : !$UpdateType&&$ResponseDefault%>><label for="ReplyUpdate"><&|/l&>Reply to requestors</&></label><br/>
 % }
 </td>
 <%init>
 # Things needed in the template - we'll do the processing here, just
 # for the convenience:
 
-my ($CommentDefault, $ResponseDefault);
+my $CommentDefault = '';
+my $ResponseDefault = '';
+
 if ($Action ne 'Respond') {
    $CommentDefault = "CHECKED"; 
 } else {
@@ -31,5 +33,6 @@
 </%init>
 <%args>
 $TicketObj
-$Action
+$Action => ''
+$UpdateType => ''
 </%args>

Modified: RT-AjaxyReplyPage/html/Ticket/Update.html
==============================================================================
--- RT-AjaxyReplyPage/html/Ticket/Update.html	(original)
+++ RT-AjaxyReplyPage/html/Ticket/Update.html	Tue Mar 31 22:59:05 2009
@@ -53,12 +53,12 @@
 <form action="Update.html" name="TicketUpdate" 
     method="post" enctype="multipart/form-data">
 <& /Elements/Callback, _CallbackName => 'FormStart',ARGSRef =>\%ARGS &>
-<input type="hidden" class="hidden" name="QuoteTransaction" value="<% $ARGS{QuoteTransaction} %>" />
+<input type="hidden" class="hidden" name="QuoteTransaction" value="<% $ARGS{QuoteTransaction}||'' %>" />
 <input type="hidden" class="hidden" name="DefaultStatus" value="<% $DefaultStatus %>" />
 <input type="hidden" class="hidden" name="Action" value="<% $ARGS{Action} %>" />
 <input type="hidden" class="hidden" name="id" value="<%$TicketObj->Id%>" /><br />
-<h2>Change ticket properties</h2>
-<table style="border: 1px solid blue; background: #eeeeee;">
+<center>
+<table style="background: #eeeeee; padding: 1em; -moz-border-radius: 0.5em; -webkit-border-radius: 0.5em;">
     <& /Plugin/AjaxyReplyPage/Elements/Basics, %ARGS, TicketObj => $TicketObj &>
     <tr>
         <td>
@@ -67,18 +67,17 @@
         </td>
     </tr>
 </table>
-<h2>Add history entry</h2>
-<table style="border: 1px solid blue; background: <% ($ARGS{'UpdateType'} eq "response" || $Action eq 'Respond') ? '#fcc' :  '#eeeeee;'|n%> " id="replybox">
+</center>
+<br />
+<table style="background: <% ($UpdateType eq "response" || $Action eq 'Respond') ? '#fcc;' :  '#eeeeee;'|n%> padding: 1em; -moz-border-radius: 0.5em; -webkit-border-radius: 0.5em;" id="replybox" width="100%">
     <tr>
-        <td>
+        <td style="width: 16em; padding-left: 1em;" valign="top">
             <table>
-<& /Plugin/AjaxyReplyPage/Elements/UpdateType, %ARGS, TicketObj => $TicketObj &>
-<tr><td><&|/l&>Subject</&> </td> <td> <input name="UpdateSubject" size="40" value="<% $ARGS{UpdateSubject} || $TicketObj->Subject()%>" /> </td> </tr>
-<tbody id="recipients">
-    <& /Plugin/AjaxyReplyPage/Elements/ShowRecipients, %ARGS, TicketObj => $TicketObj &>
-</tbody>
+                <& /Plugin/AjaxyReplyPage/Elements/UpdateType, %ARGS, TicketObj => $TicketObj &>
+                <tr><td colspan=2><hr/></td></tr>
+<tr><td class="label"><&|/l&>Subject</&> </td> <td> <input name="UpdateSubject" size="40" value="<% $ARGS{UpdateSubject} || $TicketObj->Subject()%>" /> </td> </tr>
 <tr>
-        <td>
+        <td class="label">
             <&|/l&>Cc</&>
         </td>
         <td>
@@ -86,7 +85,7 @@
         </td>
     </tr>
 <tr>
-    <td>
+    <td class="label">
         <&|/l&>Bcc</&>
     </td>
     <td><input name="UpdateBcc" size="40" value="<%$ARGS{UpdateBcc}||""%>" />
@@ -95,7 +94,7 @@
 % if (my $TxnCFs = $TicketObj->TransactionCustomFields) {
 %    while (my $CF = $TxnCFs->Next()) {
 <tr>
-<td><% $CF->Name %>:</td>
+<td class="label"><% $CF->Name %>:</td>
 <td>
 <& /Elements/EditCustomField, CustomField => $CF, NamePrefix => "Object-RT::Transaction--CustomField-" &><em><% $CF->FriendlyType %></em>
 </td>
@@ -104,7 +103,7 @@
 % } # end of if
 
 <tr>
-    <td>
+    <td class="label">
         <&|/l&>Attach</&>
     </td>
     <td>
@@ -114,7 +113,7 @@
 % if (exists $session{'Attachments'}) {
 
 <tr>
-    <td>
+    <td class="label">
         <&|/l&>Attached file</&>
     </td>
 
@@ -129,10 +128,19 @@
 </tr>
 
 % } # end of if
+<tbody id="recipients">
+    <& /Plugin/AjaxyReplyPage/Elements/ShowRecipients, %ARGS, TicketObj => $TicketObj &>
+</tbody>
+<tr>
+
 </table>
 </td>
-<td>
-<& /Elements/Callback, _CallbackName => 'BeforeMessageBox', %ARGS &>
+<td valign="top" style="width: auto; padding-left: 1em;">
+    <& /Elements/Callback, _CallbackName => 'BeforeMessageBox', %ARGS &>
+% if ( $gnupg_widget ) {
+<& /Elements/GnuPG/SignEncryptWidget, self => $gnupg_widget, TicketObj => $TicketObj, &>
+% }
+
 % if (exists $ARGS{UpdateContent}) {
 % # preserve QuoteTransaction so we can use it to set up sane references/in/reply to
 % my $temp = $ARGS{'QuoteTransaction'};
@@ -143,15 +151,16 @@
 <& /Elements/MessageBox, Name=>"UpdateContent", %ARGS &>
 % }
 
+<& /Elements/Submit, Label => loc('Update Ticket'), Name => 'SubmitTicket' &>
 </td>
 </tr>
 
 
 </table>
-<& /Elements/Submit, Label => loc('Update Ticket'), Name => 'SubmitTicket' &>
 </form>
 <%INIT>
 my $title;
+my $checks_failure = 0;
 
 my $TicketObj = LoadTicket($id);
 
@@ -199,9 +208,22 @@
     delete $session{'Attachments'};
 }
 
-if ( exists $ARGS{SubmitTicket} ) {
-    $m->comp('Display.html', TicketObj => $TicketObj, %ARGS);
-    return;
+my $gnupg_widget = $m->comp('/Elements/GnuPG/SignEncryptWidget:new', Arguments => \%ARGS );
+$m->comp( '/Elements/GnuPG/SignEncryptWidget:Process',
+    self => $gnupg_widget,
+    TicketObj => $TicketObj,
+);
+if ( $ARGS{'SubmitTicket'} ) {
+    my $status = $m->comp('/Elements/GnuPG/SignEncryptWidget:Check',
+        self      => $gnupg_widget,
+        TicketObj => $TicketObj,
+    );
+    $checks_failure = 1 unless $status;
+}
+
+if ( !$checks_failure && exists $ARGS{SubmitTicket} ) {
+    $m->callback( Ticket => $TicketObj, ARGSRef => \%ARGS, CallbackName => 'BeforeDisplay' );
+    return $m->comp('Display.html', TicketObj => $TicketObj, %ARGS);
 }
 
 </%INIT>
@@ -210,5 +232,6 @@
 $id => undef
 $Action => undef
 @SendTo => undef
-$DefaultStatus => undef
+$DefaultStatus => ''
+$UpdateType => ''
 </%ARGS>

Modified: RT-AjaxyReplyPage/inc/Module/Install.pm
==============================================================================
--- RT-AjaxyReplyPage/inc/Module/Install.pm	(original)
+++ RT-AjaxyReplyPage/inc/Module/Install.pm	Tue Mar 31 22:59:05 2009
@@ -30,7 +30,7 @@
 	# This is not enforced yet, but will be some time in the next few
 	# releases once we can make sure it won't clash with custom
 	# Module::Install extensions.
-	$VERSION = '0.76';
+	$VERSION = '0.79';
 
 	*inc::Module::Install::VERSION = *VERSION;
 	@inc::Module::Install::ISA     = __PACKAGE__;
@@ -125,8 +125,10 @@
 			goto &$code unless $cwd eq $pwd;
 		}
 		$$sym =~ /([^:]+)$/ or die "Cannot autoload $who - $sym";
-		unshift @_, ( $self, $1 );
-		goto &{$self->can('call')} unless uc($1) eq $1;
+		unless ( uc($1) eq $1 ) {
+			unshift @_, ( $self, $1 );
+			goto &{$self->can('call')};
+		}
 	};
 }
 
@@ -248,7 +250,7 @@
 sub load_extensions {
 	my ($self, $path, $top) = @_;
 
-	unless ( grep { lc $_ eq lc $self->{prefix} } @INC ) {
+	unless ( grep { !ref $_ and lc $_ eq lc $self->{prefix} } @INC ) {
 		unshift @INC, $self->{prefix};
 	}
 
@@ -339,6 +341,9 @@
 	close FH or die "close($_[0]): $!";
 }
 
+# _version is for processing module versions (eg, 1.03_05) not
+# Perl versions (eg, 5.8.1).
+
 sub _version ($) {
 	my $s = shift || 0;
 	   $s =~ s/^(\d+)\.?//;
@@ -361,4 +366,4 @@
 
 1;
 
-# Copyright 2008 Adam Kennedy.
+# Copyright 2008 - 2009 Adam Kennedy.

Modified: RT-AjaxyReplyPage/inc/Module/Install/Base.pm
==============================================================================
--- RT-AjaxyReplyPage/inc/Module/Install/Base.pm	(original)
+++ RT-AjaxyReplyPage/inc/Module/Install/Base.pm	Tue Mar 31 22:59:05 2009
@@ -1,7 +1,7 @@
 #line 1
 package Module::Install::Base;
 
-$VERSION = '0.76';
+$VERSION = '0.79';
 
 # Suspend handler for "redefined" warnings
 BEGIN {

Modified: RT-AjaxyReplyPage/inc/Module/Install/Can.pm
==============================================================================
--- RT-AjaxyReplyPage/inc/Module/Install/Can.pm	(original)
+++ RT-AjaxyReplyPage/inc/Module/Install/Can.pm	Tue Mar 31 22:59:05 2009
@@ -11,7 +11,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.76';
+	$VERSION = '0.79';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }
@@ -39,6 +39,7 @@
 	return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd));
 
 	for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
+		next if $dir eq '';
 		my $abs = File::Spec->catfile($dir, $_[1]);
 		return $abs if (-x $abs or $abs = MM->maybe_command($abs));
 	}
@@ -79,4 +80,4 @@
 
 __END__
 
-#line 157
+#line 158

Modified: RT-AjaxyReplyPage/inc/Module/Install/Fetch.pm
==============================================================================
--- RT-AjaxyReplyPage/inc/Module/Install/Fetch.pm	(original)
+++ RT-AjaxyReplyPage/inc/Module/Install/Fetch.pm	Tue Mar 31 22:59:05 2009
@@ -6,20 +6,20 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.76';
+	$VERSION = '0.79';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }
 
 sub get_file {
     my ($self, %args) = @_;
-    my ($scheme, $host, $path, $file) = 
+    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) = 
+        ($scheme, $host, $path, $file) =
             $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
     }
 

Modified: RT-AjaxyReplyPage/inc/Module/Install/Makefile.pm
==============================================================================
--- RT-AjaxyReplyPage/inc/Module/Install/Makefile.pm	(original)
+++ RT-AjaxyReplyPage/inc/Module/Install/Makefile.pm	Tue Mar 31 22:59:05 2009
@@ -7,7 +7,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.76';
+	$VERSION = '0.79';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }
@@ -64,7 +64,7 @@
 	my $self  = shift;
 	my $clean = $self->makemaker_args->{clean} ||= {};
 	  %$clean = (
-		%$clean, 
+		%$clean,
 		FILES => join ' ', grep { length $_ } ($clean->{FILES} || (), @_),
 	);
 }
@@ -73,7 +73,7 @@
 	my $self      = shift;
 	my $realclean = $self->makemaker_args->{realclean} ||= {};
 	  %$realclean = (
-		%$realclean, 
+		%$realclean,
 		FILES => join ' ', grep { length $_ } ($realclean->{FILES} || (), @_),
 	);
 }
@@ -124,7 +124,7 @@
 
 	$self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
 
-	# Generate the 
+	# Generate the
 	my $args = $self->makemaker_args;
 	$args->{DISTNAME} = $self->name;
 	$args->{NAME}     = $self->module_name || $self->name;
@@ -181,7 +181,9 @@
 
 	my $user_preop = delete $args{dist}->{PREOP};
 	if (my $preop = $self->admin->preop($user_preop)) {
-		$args{dist} = $preop;
+		foreach my $key ( keys %$preop ) {
+			$args{dist}->{$key} = $preop->{$key};
+		}
 	}
 
 	my $mm = ExtUtils::MakeMaker::WriteMakefile(%args);
@@ -194,7 +196,7 @@
 	my $top_class     = ref($self->_top) || '';
 	my $top_version   = $self->_top->VERSION || '';
 
-	my $preamble = $self->preamble 
+	my $preamble = $self->preamble
 		? "# Preamble by $top_class $top_version\n"
 			. $self->preamble
 		: '';
@@ -248,4 +250,4 @@
 
 __END__
 
-#line 377
+#line 379

Modified: RT-AjaxyReplyPage/inc/Module/Install/Metadata.pm
==============================================================================
--- RT-AjaxyReplyPage/inc/Module/Install/Metadata.pm	(original)
+++ RT-AjaxyReplyPage/inc/Module/Install/Metadata.pm	Tue Mar 31 22:59:05 2009
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.76';
+	$VERSION = '0.79';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }
@@ -175,13 +175,16 @@
 	my $version = shift or die(
 		"Did not provide a value to perl_version()"
 	);
-	$version =~ s/_.+$//;
-	$version = $version + 0; # Numify
+
+	# Normalize the version
+	$version = $self->_perl_version($version);
+
+	# We don't support the reall old versions
 	unless ( $version >= 5.005 ) {
 		die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n";
 	}
+
 	$self->{values}{perl_version} = $version;
-	return 1;
 }
 
 sub license {
@@ -213,6 +216,9 @@
 			die("all_from cannot find $file from $name");
 		}
 	}
+	unless ( -f $file ) {
+		die("The path '$file' does not exist, or is not a file");
+	}
 
 	# Some methods pull from POD instead of code.
 	# If there is a matching .pod, use that instead
@@ -424,8 +430,12 @@
 		my $license_text = $1;
 		my @phrases      = (
 			'under the same (?:terms|license) as perl itself' => 'perl',        1,
+			'GNU general public license'                      => 'gpl',         1,
 			'GNU public license'                              => 'gpl',         1,
+			'GNU lesser general public license'               => 'lgpl',        1,
 			'GNU lesser public license'                       => 'lgpl',        1,
+			'GNU library general public license'              => 'lgpl',        1,
+			'GNU library public license'                      => 'lgpl',        1,
 			'BSD license'                                     => 'bsd',         1,
 			'Artistic license'                                => 'artistic',    1,
 			'GPL'                                             => 'gpl',         1,
@@ -438,9 +448,6 @@
 		while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) {
 			$pattern =~ s{\s+}{\\s+}g;
 			if ( $license_text =~ /\b$pattern\b/i ) {
-				if ( $osi and $license_text =~ /All rights reserved/i ) {
-					print "WARNING: 'All rights reserved' in copyright may invalidate Open Source license.\n";
-				}
 				$self->license($license);
 				return 1;
 			}
@@ -469,19 +476,70 @@
 	return 1;
 }
 
-sub install_script {
+# Convert triple-part versions (eg, 5.6.1 or 5.8.9) to
+# numbers (eg, 5.006001 or 5.008009).
+# Also, convert double-part versions (eg, 5.8)
+sub _perl_version {
+	my $v = $_[-1];
+	$v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e;	
+	$v =~ s/^([1-9])\.([1-9]\d?\d?)\.(0|[1-9]\d?\d?)$/sprintf("%d.%03d%03d",$1,$2,$3 || 0)/e;
+	$v =~ s/(\.\d\d\d)000$/$1/;
+	$v =~ s/_.+$//;
+	if ( ref($v) ) {
+		$v = $v + 0; # Numify
+	}
+	return $v;
+}
+
+
+
+
+
+######################################################################
+# MYMETA.yml Support
+
+sub WriteMyMeta {
+	$_[0]->write_mymeta;
+}
+
+sub write_mymeta {
 	my $self = shift;
-	my $args = $self->makemaker_args;
-	my $exe  = $args->{EXE_FILES} ||= [];
-        foreach ( @_ ) {
-		if ( -f $_ ) {
-			push @$exe, $_;
-		} elsif ( -d 'script' and -f "script/$_" ) {
-			push @$exe, "script/$_";
-		} else {
-			die("Cannot find script '$_'");
+	
+	# If there's no existing META.yml there is nothing we can do
+	return unless -f 'META.yml';
+
+	# Merge the perl version into the dependencies
+	my $val  = $self->Meta->{values};
+	my $perl = delete $val->{perl_version};
+	if ( $perl ) {
+		$val->{requires} ||= [];
+		my $requires = $val->{requires};
+
+		# Canonize to three-dot version after Perl 5.6
+		if ( $perl >= 5.006 ) {
+			$perl =~ s{^(\d+)\.(\d\d\d)(\d*)}{join('.', $1, int($2||0), int($3||0))}e
 		}
+		unshift @$requires, [ perl => $perl ];
 	}
+
+	# Load the advisory META.yml file
+	require YAML::Tiny;
+	my @yaml = YAML::Tiny::LoadFile('META.yml');
+	my $meta = $yaml[0];
+
+	# Overwrite the non-configure dependency hashs
+	delete $meta->{requires};
+	delete $meta->{build_requires};
+	delete $meta->{recommends};
+	if ( exists $val->{requires} ) {
+		$meta->{requires} = { map { @$_ } @{ $val->{requires} } };
+	}
+	if ( exists $val->{build_requires} ) {
+		$meta->{build_requires} = { map { @$_ } @{ $val->{build_requires} } };
+	}
+
+	# Save as the MYMETA.yml file
+	YAML::Tiny::DumpFile('MYMETA.yml', $meta);
 }
 
 1;

Modified: RT-AjaxyReplyPage/inc/Module/Install/RTx.pm
==============================================================================
--- RT-AjaxyReplyPage/inc/Module/Install/RTx.pm	(original)
+++ RT-AjaxyReplyPage/inc/Module/Install/RTx.pm	Tue Mar 31 22:59:05 2009
@@ -8,12 +8,15 @@
 
 use Module::Install::Base;
 use base 'Module::Install::Base';
-our $VERSION = '0.21';
+our $VERSION = '0.24';
 
 use FindBin;
 use File::Glob     ();
 use File::Basename ();
 
+my @DIRS = qw(etc lib html bin sbin po var);
+my @INDEX_DIRS = qw(lib bin sbin);
+
 sub RTx {
     my ( $self, $name ) = @_;
 
@@ -53,13 +56,15 @@
     }
 
     my $lib_path = File::Basename::dirname( $INC{'RT.pm'} );
+    my $local_lib_path = "$RT::LocalPath/lib";
     print "Using RT configuration from $INC{'RT.pm'}:\n";
+    unshift @INC, "$RT::LocalPath/lib" if $RT::LocalPath;
 
     $RT::LocalVarPath  ||= $RT::VarPath;
     $RT::LocalPoPath   ||= $RT::LocalLexiconPath;
     $RT::LocalHtmlPath ||= $RT::MasonComponentRoot;
+    $RT::LocalLibPath  ||= "$RT::LocalPath/lib";
 
-    my %path;
     my $with_subdirs = $ENV{WITH_SUBDIRS};
     @ARGV = grep { /WITH_SUBDIRS=(.*)/ ? ( ( $with_subdirs = $1 ), 0 ) : 1 }
         @ARGV;
@@ -67,36 +72,40 @@
     my %subdirs;
     %subdirs = map { $_ => 1 } split( /\s*,\s*/, $with_subdirs )
         if defined $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/$_";
+    unless ( keys %subdirs ) {
+        $subdirs{$_} = 1 foreach grep -d "$FindBin::Bin/$_", @DIRS;
     }
 
-    $path{$_} .= "/$name" for grep $path{$_}, qw(etc po var);
-    $path{lib} = "$RT::LocalPath/lib" unless %subdirs and !$subdirs{'lib'};
-
     # If we're running on RT 3.8 with plugin support, we really wany
     # to install libs, mason templates and po files into plugin specific
     # directories
-    if ($RT::LocalPluginPath) {
-        foreach my $path (qw(lib po html etc bin sbin)) {
-            next unless -d "$FindBin::Bin/$path";
-            next if %subdirs and !$subdirs{$path};
-            $path{$path} = $RT::LocalPluginPath . "/$original_name/$path";
+    my %path;
+    if ( $RT::LocalPluginPath ) {
+        die "Because of bugs in RT 3.8.0 this extension can not be installed.\n"
+            ."Upgrade to RT 3.8.1 or newer.\n" if $RT::VERSION =~ /^3\.8\.0/;
+        $path{$_} = $RT::LocalPluginPath . "/$original_name/$_"
+            foreach @DIRS;
+    } else {
+        foreach ( @DIRS ) {
+            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 );
-    print "./$_\t=> $path{$_}\n" for sort keys %path;
+    my %index = map { $_ => 1 } @INDEX_DIRS;
+    $self->no_index( directory => $_ ) foreach grep !$index{$_}, @DIRS;
+
+    my $args = join ', ', map "q($_)", map { ($_, $path{$_}) }
+        grep $subdirs{$_}, keys %path;
 
-    if ( my @dirs = map { ( -D => $_ ) } grep $path{$_}, qw(bin html sbin) ) {
-        my @po = map { ( -o => $_ ) } grep -f,
+    print "./$_\t=> $path{$_}\n" for sort keys %subdirs;
+
+    if ( my @dirs = map { ( -D => $_ ) } grep $subdirs{$_}, qw(bin html sbin) ) {
+        my @po = map { ( -o => $_ ) }
+            grep -f,
             File::Glob::bsd_glob("po/*.po");
         $self->postamble(<< ".") if @po;
 lexicons ::
@@ -109,7 +118,7 @@
 \t\$(NOECHO) \$(PERL) -MExtUtils::Install -e \"install({$args})\"
 .
 
-    if ( $path{var} and -d $RT::MasonDataDir ) {
+    if ( $subdirs{var} and -d $RT::MasonDataDir ) {
         my ( $uid, $gid ) = ( stat($RT::MasonDataDir) )[ 4, 5 ];
         $postamble .= << ".";
 \t\$(NOECHO) chown -R $uid:$gid $path{var}
@@ -124,10 +133,10 @@
         $self->load('RTxFactory');
         $self->postamble(<< ".");
 factory ::
-\t\$(NOECHO) \$(PERL) -Ilib -I"$lib_path" -Minc::Module::Install -e"RTxFactory(qw($RTx $name))"
+\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -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))"
+\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxFactory(qw($RTx $name drop))"
 
 .
     }
@@ -137,28 +146,29 @@
     if ( -e 'etc/initialdata' ) { $has_etc{initialdata}++; }
 
     $self->postamble("$postamble\n");
-    if ( %subdirs and !$subdirs{'lib'} ) {
+    unless ( $subdirs{'lib'} ) {
         $self->makemaker_args( PM => { "" => "" }, );
     } else {
-        $self->makemaker_args( INSTALLSITELIB => "$RT::LocalPath/lib" );
+        $self->makemaker_args( INSTALLSITELIB => $path{'lib'} );
+        $self->makemaker_args( INSTALLARCHLIB => $path{'lib'} );
     }
 
-        $self->makemaker_args( INSTALLSITEMAN1DIR => "$RT::LocalPath/man/man1" );
-        $self->makemaker_args( INSTALLSITEMAN3DIR => "$RT::LocalPath/man/man3" );
-        $self->makemaker_args( INSTALLSITEARCH => "$RT::LocalPath/man" );
-        $self->makemaker_args( INSTALLARCHLIB => "$RT::LocalPath/lib" );
+    $self->makemaker_args( INSTALLSITEMAN1DIR => "$RT::LocalPath/man/man1" );
+    $self->makemaker_args( INSTALLSITEMAN3DIR => "$RT::LocalPath/man/man3" );
+    $self->makemaker_args( INSTALLSITEARCH => "$RT::LocalPath/man" );
+
     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))"
+\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -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))"
+\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -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))"
+\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(insert))"
 .
         $self->postamble("initdb ::\n$initdb\n");
         $self->postamble("initialize-database ::\n$initdb\n");
@@ -178,4 +188,4 @@
 
 __END__
 
-#line 279
+#line 302

Modified: RT-AjaxyReplyPage/inc/Module/Install/Win32.pm
==============================================================================
--- RT-AjaxyReplyPage/inc/Module/Install/Win32.pm	(original)
+++ RT-AjaxyReplyPage/inc/Module/Install/Win32.pm	Tue Mar 31 22:59:05 2009
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.76';
+	$VERSION = '0.79';
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }

Modified: RT-AjaxyReplyPage/inc/Module/Install/WriteAll.pm
==============================================================================
--- RT-AjaxyReplyPage/inc/Module/Install/WriteAll.pm	(original)
+++ RT-AjaxyReplyPage/inc/Module/Install/WriteAll.pm	Tue Mar 31 22:59:05 2009
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.76';
+	$VERSION = '0.79';
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }



More information about the Bps-public-commit mailing list