[Bps-public-commit] rt-extension-commentoncreate branch, master, updated. 1.00
Alex Vandiver
alexmv at bestpractical.com
Mon Dec 15 18:02:02 EST 2014
The branch, master has been updated
via ecfdb9093590e20c222a7ab6c5a7a6c530326467 (commit)
from 55882ef211829775b6fb6f7e8644aaf6dc7e4b3a (commit)
Summary of changes:
.gitignore | 11 +-
MANIFEST | 7 +-
META.yml | 17 +-
Makefile.PL | 12 +-
README | 75 +--
inc/Module/AutoInstall.pm | 930 --------------------------
inc/Module/Install.pm | 18 +-
inc/Module/Install/AutoInstall.pm | 93 ---
inc/Module/Install/Base.pm | 2 +-
inc/Module/Install/Can.pm | 2 +-
inc/Module/Install/Fetch.pm | 2 +-
inc/Module/Install/Include.pm | 2 +-
inc/Module/Install/Makefile.pm | 4 +-
inc/Module/Install/Metadata.pm | 6 +-
inc/Module/Install/RTx.pm | 202 +++---
inc/Module/Install/Win32.pm | 2 +-
inc/Module/Install/WriteAll.pm | 2 +-
lib/RT/Extension/CommentOnCreate.pm | 67 +-
patches/3.8.7-after_message_box_callback.diff | 12 -
patches/4.0.6-include_article_flag.diff | 19 -
20 files changed, 204 insertions(+), 1281 deletions(-)
delete mode 100644 inc/Module/AutoInstall.pm
delete mode 100644 inc/Module/Install/AutoInstall.pm
delete mode 100644 patches/3.8.7-after_message_box_callback.diff
delete mode 100644 patches/4.0.6-include_article_flag.diff
- Log -----------------------------------------------------------------
commit ecfdb9093590e20c222a7ab6c5a7a6c530326467
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Mon Dec 15 18:00:22 2014 -0500
Version 1.00 releng
diff --git a/.gitignore b/.gitignore
index 75e5cfc..ef5bb92 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,13 +1,14 @@
blib*
Makefile
Makefile.old
-Build
-Build.bat
-_build*
pm_to_blib*
*.tar.gz
.lwpcookies
cover_db
pod2htm*.tmp
-RT-Extension-SquelchWatchers-*
-/MYMETA*
+/RT-Extension-CommentOnCreate*
+*.bak
+*.swp
+/MYMETA.*
+/t/tmp
+/xt/tmp
diff --git a/MANIFEST b/MANIFEST
index 3d76e28..2ebc084 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,9 +1,7 @@
Changes
html/Callbacks/RT-Extension-CommentOnCreate/Ticket/Create.html/AfterMessageBox
html/Callbacks/RT-Extension-CommentOnCreate/Ticket/Display.html/BeforeDisplay
-inc/Module/AutoInstall.pm
inc/Module/Install.pm
-inc/Module/Install/AutoInstall.pm
inc/Module/Install/Base.pm
inc/Module/Install/Can.pm
inc/Module/Install/Fetch.pm
@@ -12,12 +10,13 @@ inc/Module/Install/Makefile.pm
inc/Module/Install/Metadata.pm
inc/Module/Install/ReadmeFromPod.pm
inc/Module/Install/RTx.pm
+inc/Module/Install/RTx/Runtime.pm
inc/Module/Install/Win32.pm
inc/Module/Install/WriteAll.pm
+inc/unicore/Name.pm
+inc/YAML/Tiny.pm
lib/RT/Extension/CommentOnCreate.pm
Makefile.PL
MANIFEST This list of files
META.yml
-patches/3.8.7-after_message_box_callback.diff
-patches/4.0.6-include_article_flag.diff
README
diff --git a/META.yml b/META.yml
index e3b035d..df93a1f 100644
--- a/META.yml
+++ b/META.yml
@@ -1,16 +1,15 @@
---
abstract: 'Adds an optional Comment box to Ticket Creation'
author:
- - 'Kevin Falcone C<< <falcone at bestpractical.com> >>'
- - 'Kevin Falcone <falcone at bestpractical.com>'
+ - 'Best Practical Solutions, LLC <modules at bestpractical.com>'
build_requires:
- ExtUtils::MakeMaker: 6.36
+ ExtUtils::MakeMaker: 6.59
configure_requires:
- ExtUtils::MakeMaker: 6.36
+ ExtUtils::MakeMaker: 6.59
distribution_type: module
dynamic_config: 1
-generated_by: 'Module::Install version 1.06'
-license: gplv2
+generated_by: 'Module::Install version 1.12'
+license: gpl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
@@ -19,6 +18,10 @@ no_index:
directory:
- html
- inc
+requires:
+ perl: 5.8.3
resources:
license: http://opensource.org/licenses/gpl-license.php
-version: 0.06
+version: '1.00'
+x_module_install_rtx_version: '0.36'
+x_requires_rt: 4.0.7
diff --git a/Makefile.PL b/Makefile.PL
index 82b4e9e..0ca1de1 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,12 +1,8 @@
use inc::Module::Install;
-RTx 'RT-Extension-CommentOnCreate';
-all_from 'lib/RT/Extension/CommentOnCreate.pm';
-readme_from 'lib/RT/Extension/CommentOnCreate.pm';
-author q{Kevin Falcone <falcone at bestpractical.com>};
-license 'gplv2';
+RTx 'RT-Extension-CommentOnCreate';
-auto_install;
-
-WriteAll;
+requires_rt '4.0.7';
+sign();
+WriteAll();
diff --git a/README b/README
index decc251..bb3d475 100644
--- a/README
+++ b/README
@@ -3,30 +3,21 @@ NAME
Creation
INSTALLATION
- "perl Makefile.PL"
- "make"
- "make install"
+ perl Makefile.PL
+ make
+ make install
May need root permissions
- "patch rt (see patches directory)"
- if you're running a version less than 3.8.8
-
- patch -p1 < 3.8.7-after_message_box_callback.diff
-
- you're running a version less than 4.0.7
-
- patch -p1 < 4.0.6-include_article_flag.diff
-
Edit your /opt/rt4/etc/RT_SiteConfig.pm
If you are using RT 4.2 or greater, add this line:
Plugin('RT::Extension::CommentOnCreate');
- For earlier releases of RT 4, add this line:
+ For RT 4.0, add this line:
Set(@Plugins, qw(RT::Extension::CommentOnCreate));
- or add "RT::Extension::CommentOnCreate" to your existing @Plugins
+ or add RT::Extension::CommentOnCreate to your existing @Plugins
line.
Clear your mason cache
@@ -36,50 +27,30 @@ INSTALLATION
CONFIGURATION
Optional configuration options to control the width and height of the
- Comment textbox
+ Comment textbox:
Set($CommentOnCreateWidth, 80);
Set($CommentOnCreateHeight, 190);
- These only apply if you have MessageBoxRichText enabled, otherwise it
+ These only apply if you have MessageBoxRichText enabled; otherwise it
will inherit the global MessageBoxRichTextHeight attribute.
-BUGS AND LIMITATIONS
- No bugs have been reported.
+AUTHOR
+ Best Practical Solutions, LLC <modules at bestpractical.com>
- Please report any bugs or feature requests to
- "bug-rt-extension-commentoncreate at rt.cpan.org", or through the web
- interface at <http://rt.cpan.org>.
+BUGS
+ All bugs should be reported via email to
-AUTHOR
- Kevin Falcone "<falcone at bestpractical.com>"
-
-LICENCE AND COPYRIGHT
- Copyright (c) 2010-2014, Best Practical Solutions, LLC. All rights
- reserved.
-
- This module is free software; you can redistribute it and/or modify it
- under the terms of version 2 of the GNU General Public License.
-
-DISCLAIMER OF WARRANTY
- BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
- FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
- OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
- PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
- EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
- ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
- YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
- NECESSARY SERVICING, REPAIR, OR CORRECTION.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
- REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE
- TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR
- CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
- SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
- RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
- FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
- SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
- DAMAGES.
+ L<bug-RT-Extension-CommentOnCreate at rt.cpan.org|mailto:bug-RT-Extension-CommentOnCreate at rt.cpan.org>
+
+ or via the web at
+
+ L<rt.cpan.org|http://rt.cpan.org/Public/Dist/Display.html?Name=RT-Extension-CommentOnCreate>.
+
+LICENSE AND COPYRIGHT
+ This software is Copyright (c) 2014 by Best Practical Solutions
+
+ This is free software, licensed under:
+
+ The GNU General Public License, Version 2, June 1991
diff --git a/inc/Module/AutoInstall.pm b/inc/Module/AutoInstall.pm
deleted file mode 100644
index aa7aa92..0000000
--- a/inc/Module/AutoInstall.pm
+++ /dev/null
@@ -1,930 +0,0 @@
-#line 1
-package Module::AutoInstall;
-
-use strict;
-use Cwd ();
-use File::Spec ();
-use ExtUtils::MakeMaker ();
-
-use vars qw{$VERSION};
-BEGIN {
- $VERSION = '1.06';
-}
-
-# special map on pre-defined feature sets
-my %FeatureMap = (
- '' => 'Core Features', # XXX: deprecated
- '-core' => 'Core Features',
-);
-
-# various lexical flags
-my ( @Missing, @Existing, %DisabledTests, $UnderCPAN, $InstallDepsTarget, $HasCPANPLUS );
-my (
- $Config, $CheckOnly, $SkipInstall, $AcceptDefault, $TestOnly, $AllDeps,
- $UpgradeDeps
-);
-my ( $PostambleActions, $PostambleActionsNoTest, $PostambleActionsUpgradeDeps,
- $PostambleActionsUpgradeDepsNoTest, $PostambleActionsListDeps,
- $PostambleActionsListAllDeps, $PostambleUsed, $NoTest);
-
-# See if it's a testing or non-interactive session
-_accept_default( $ENV{AUTOMATED_TESTING} or ! -t STDIN );
-_init();
-
-sub _accept_default {
- $AcceptDefault = shift;
-}
-
-sub _installdeps_target {
- $InstallDepsTarget = shift;
-}
-
-sub missing_modules {
- return @Missing;
-}
-
-sub do_install {
- __PACKAGE__->install(
- [
- $Config
- ? ( UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} )
- : ()
- ],
- @Missing,
- );
-}
-
-# initialize various flags, and/or perform install
-sub _init {
- foreach my $arg (
- @ARGV,
- split(
- /[\s\t]+/,
- $ENV{PERL_AUTOINSTALL} || $ENV{PERL_EXTUTILS_AUTOINSTALL} || ''
- )
- )
- {
- if ( $arg =~ /^--config=(.*)$/ ) {
- $Config = [ split( ',', $1 ) ];
- }
- elsif ( $arg =~ /^--installdeps=(.*)$/ ) {
- __PACKAGE__->install( $Config, @Missing = split( /,/, $1 ) );
- exit 0;
- }
- elsif ( $arg =~ /^--upgradedeps=(.*)$/ ) {
- $UpgradeDeps = 1;
- __PACKAGE__->install( $Config, @Missing = split( /,/, $1 ) );
- exit 0;
- }
- elsif ( $arg =~ /^--default(?:deps)?$/ ) {
- $AcceptDefault = 1;
- }
- elsif ( $arg =~ /^--check(?:deps)?$/ ) {
- $CheckOnly = 1;
- }
- elsif ( $arg =~ /^--skip(?:deps)?$/ ) {
- $SkipInstall = 1;
- }
- elsif ( $arg =~ /^--test(?:only)?$/ ) {
- $TestOnly = 1;
- }
- elsif ( $arg =~ /^--all(?:deps)?$/ ) {
- $AllDeps = 1;
- }
- }
-}
-
-# overrides MakeMaker's prompt() to automatically accept the default choice
-sub _prompt {
- goto &ExtUtils::MakeMaker::prompt unless $AcceptDefault;
-
- my ( $prompt, $default ) = @_;
- my $y = ( $default =~ /^[Yy]/ );
-
- print $prompt, ' [', ( $y ? 'Y' : 'y' ), '/', ( $y ? 'n' : 'N' ), '] ';
- print "$default\n";
- return $default;
-}
-
-# the workhorse
-sub import {
- my $class = shift;
- my @args = @_ or return;
- my $core_all;
-
- print "*** $class version " . $class->VERSION . "\n";
- print "*** Checking for Perl dependencies...\n";
-
- my $cwd = Cwd::cwd();
-
- $Config = [];
-
- my $maxlen = length(
- (
- sort { length($b) <=> length($a) }
- grep { /^[^\-]/ }
- map {
- ref($_)
- ? ( ( ref($_) eq 'HASH' ) ? keys(%$_) : @{$_} )
- : ''
- }
- map { +{@args}->{$_} }
- grep { /^[^\-]/ or /^-core$/i } keys %{ +{@args} }
- )[0]
- );
-
- # We want to know if we're under CPAN early to avoid prompting, but
- # if we aren't going to try and install anything anyway then skip the
- # check entirely since we don't want to have to load (and configure)
- # an old CPAN just for a cosmetic message
-
- $UnderCPAN = _check_lock(1) unless $SkipInstall || $InstallDepsTarget;
-
- while ( my ( $feature, $modules ) = splice( @args, 0, 2 ) ) {
- my ( @required, @tests, @skiptests );
- my $default = 1;
- my $conflict = 0;
-
- if ( $feature =~ m/^-(\w+)$/ ) {
- my $option = lc($1);
-
- # check for a newer version of myself
- _update_to( $modules, @_ ) and return if $option eq 'version';
-
- # sets CPAN configuration options
- $Config = $modules if $option eq 'config';
-
- # promote every features to core status
- $core_all = ( $modules =~ /^all$/i ) and next
- if $option eq 'core';
-
- next unless $option eq 'core';
- }
-
- print "[" . ( $FeatureMap{ lc($feature) } || $feature ) . "]\n";
-
- $modules = [ %{$modules} ] if UNIVERSAL::isa( $modules, 'HASH' );
-
- unshift @$modules, -default => &{ shift(@$modules) }
- if ( ref( $modules->[0] ) eq 'CODE' ); # XXX: bugward combatability
-
- while ( my ( $mod, $arg ) = splice( @$modules, 0, 2 ) ) {
- if ( $mod =~ m/^-(\w+)$/ ) {
- my $option = lc($1);
-
- $default = $arg if ( $option eq 'default' );
- $conflict = $arg if ( $option eq 'conflict' );
- @tests = @{$arg} if ( $option eq 'tests' );
- @skiptests = @{$arg} if ( $option eq 'skiptests' );
-
- next;
- }
-
- printf( "- %-${maxlen}s ...", $mod );
-
- if ( $arg and $arg =~ /^\D/ ) {
- unshift @$modules, $arg;
- $arg = 0;
- }
-
- # XXX: check for conflicts and uninstalls(!) them.
- my $cur = _version_of($mod);
- if (_version_cmp ($cur, $arg) >= 0)
- {
- print "loaded. ($cur" . ( $arg ? " >= $arg" : '' ) . ")\n";
- push @Existing, $mod => $arg;
- $DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
- }
- else {
- if (not defined $cur) # indeed missing
- {
- print "missing." . ( $arg ? " (would need $arg)" : '' ) . "\n";
- }
- else
- {
- # no need to check $arg as _version_cmp ($cur, undef) would satisfy >= above
- print "too old. ($cur < $arg)\n";
- }
-
- push @required, $mod => $arg;
- }
- }
-
- next unless @required;
-
- my $mandatory = ( $feature eq '-core' or $core_all );
-
- if (
- !$SkipInstall
- and (
- $CheckOnly
- or ($mandatory and $UnderCPAN)
- or $AllDeps
- or $InstallDepsTarget
- or _prompt(
- qq{==> Auto-install the }
- . ( @required / 2 )
- . ( $mandatory ? ' mandatory' : ' optional' )
- . qq{ module(s) from CPAN?},
- $default ? 'y' : 'n',
- ) =~ /^[Yy]/
- )
- )
- {
- push( @Missing, @required );
- $DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
- }
-
- elsif ( !$SkipInstall
- and $default
- and $mandatory
- and
- _prompt( qq{==> The module(s) are mandatory! Really skip?}, 'n', )
- =~ /^[Nn]/ )
- {
- push( @Missing, @required );
- $DisabledTests{$_} = 1 for map { glob($_) } @skiptests;
- }
-
- else {
- $DisabledTests{$_} = 1 for map { glob($_) } @tests;
- }
- }
-
- if ( @Missing and not( $CheckOnly or $UnderCPAN) ) {
- require Config;
- my $make = $Config::Config{make};
- if ($InstallDepsTarget) {
- print
-"*** To install dependencies type '$make installdeps' or '$make installdeps_notest'.\n";
- }
- else {
- print
-"*** Dependencies will be installed the next time you type '$make'.\n";
- }
-
- # make an educated guess of whether we'll need root permission.
- print " (You may need to do that as the 'root' user.)\n"
- if eval '$>';
- }
- print "*** $class configuration finished.\n";
-
- chdir $cwd;
-
- # import to main::
- no strict 'refs';
- *{'main::WriteMakefile'} = \&Write if caller(0) eq 'main';
-
- return (@Existing, @Missing);
-}
-
-sub _running_under {
- my $thing = shift;
- print <<"END_MESSAGE";
-*** Since we're running under ${thing}, I'll just let it take care
- of the dependency's installation later.
-END_MESSAGE
- return 1;
-}
-
-# Check to see if we are currently running under CPAN.pm and/or CPANPLUS;
-# if we are, then we simply let it taking care of our dependencies
-sub _check_lock {
- return unless @Missing or @_;
-
- if ($ENV{PERL5_CPANM_IS_RUNNING}) {
- return _running_under('cpanminus');
- }
-
- my $cpan_env = $ENV{PERL5_CPAN_IS_RUNNING};
-
- if ($ENV{PERL5_CPANPLUS_IS_RUNNING}) {
- return _running_under($cpan_env ? 'CPAN' : 'CPANPLUS');
- }
-
- require CPAN;
-
- if ($CPAN::VERSION > '1.89') {
- if ($cpan_env) {
- return _running_under('CPAN');
- }
- return; # CPAN.pm new enough, don't need to check further
- }
-
- # last ditch attempt, this -will- configure CPAN, very sorry
-
- _load_cpan(1); # force initialize even though it's already loaded
-
- # Find the CPAN lock-file
- my $lock = MM->catfile( $CPAN::Config->{cpan_home}, ".lock" );
- return unless -f $lock;
-
- # Check the lock
- local *LOCK;
- return unless open(LOCK, $lock);
-
- if (
- ( $^O eq 'MSWin32' ? _under_cpan() : <LOCK> == getppid() )
- and ( $CPAN::Config->{prerequisites_policy} || '' ) ne 'ignore'
- ) {
- print <<'END_MESSAGE';
-
-*** Since we're running under CPAN, I'll just let it take care
- of the dependency's installation later.
-END_MESSAGE
- return 1;
- }
-
- close LOCK;
- return;
-}
-
-sub install {
- my $class = shift;
-
- my $i; # used below to strip leading '-' from config keys
- my @config = ( map { s/^-// if ++$i; $_ } @{ +shift } );
-
- my ( @modules, @installed );
- while ( my ( $pkg, $ver ) = splice( @_, 0, 2 ) ) {
-
- # grep out those already installed
- if ( _version_cmp( _version_of($pkg), $ver ) >= 0 ) {
- push @installed, $pkg;
- }
- else {
- push @modules, $pkg, $ver;
- }
- }
-
- if ($UpgradeDeps) {
- push @modules, @installed;
- @installed = ();
- }
-
- return @installed unless @modules; # nothing to do
- return @installed if _check_lock(); # defer to the CPAN shell
-
- print "*** Installing dependencies...\n";
-
- return unless _connected_to('cpan.org');
-
- my %args = @config;
- my %failed;
- local *FAILED;
- if ( $args{do_once} and open( FAILED, '.#autoinstall.failed' ) ) {
- while (<FAILED>) { chomp; $failed{$_}++ }
- close FAILED;
-
- my @newmod;
- while ( my ( $k, $v ) = splice( @modules, 0, 2 ) ) {
- push @newmod, ( $k => $v ) unless $failed{$k};
- }
- @modules = @newmod;
- }
-
- if ( _has_cpanplus() and not $ENV{PERL_AUTOINSTALL_PREFER_CPAN} ) {
- _install_cpanplus( \@modules, \@config );
- } else {
- _install_cpan( \@modules, \@config );
- }
-
- print "*** $class installation finished.\n";
-
- # see if we have successfully installed them
- while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) {
- if ( _version_cmp( _version_of($pkg), $ver ) >= 0 ) {
- push @installed, $pkg;
- }
- elsif ( $args{do_once} and open( FAILED, '>> .#autoinstall.failed' ) ) {
- print FAILED "$pkg\n";
- }
- }
-
- close FAILED if $args{do_once};
-
- return @installed;
-}
-
-sub _install_cpanplus {
- my @modules = @{ +shift };
- my @config = _cpanplus_config( @{ +shift } );
- my $installed = 0;
-
- require CPANPLUS::Backend;
- my $cp = CPANPLUS::Backend->new;
- my $conf = $cp->configure_object;
-
- return unless $conf->can('conf') # 0.05x+ with "sudo" support
- or _can_write($conf->_get_build('base')); # 0.04x
-
- # if we're root, set UNINST=1 to avoid trouble unless user asked for it.
- my $makeflags = $conf->get_conf('makeflags') || '';
- if ( UNIVERSAL::isa( $makeflags, 'HASH' ) ) {
- # 0.03+ uses a hashref here
- $makeflags->{UNINST} = 1 unless exists $makeflags->{UNINST};
-
- } else {
- # 0.02 and below uses a scalar
- $makeflags = join( ' ', split( ' ', $makeflags ), 'UNINST=1' )
- if ( $makeflags !~ /\bUNINST\b/ and eval qq{ $> eq '0' } );
-
- }
- $conf->set_conf( makeflags => $makeflags );
- $conf->set_conf( prereqs => 1 );
-
-
-
- while ( my ( $key, $val ) = splice( @config, 0, 2 ) ) {
- $conf->set_conf( $key, $val );
- }
-
- my $modtree = $cp->module_tree;
- while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) {
- print "*** Installing $pkg...\n";
-
- MY::preinstall( $pkg, $ver ) or next if defined &MY::preinstall;
-
- my $success;
- my $obj = $modtree->{$pkg};
-
- if ( $obj and _version_cmp( $obj->{version}, $ver ) >= 0 ) {
- my $pathname = $pkg;
- $pathname =~ s/::/\\W/;
-
- foreach my $inc ( grep { m/$pathname.pm/i } keys(%INC) ) {
- delete $INC{$inc};
- }
-
- my $rv = $cp->install( modules => [ $obj->{module} ] );
-
- if ( $rv and ( $rv->{ $obj->{module} } or $rv->{ok} ) ) {
- print "*** $pkg successfully installed.\n";
- $success = 1;
- } else {
- print "*** $pkg installation cancelled.\n";
- $success = 0;
- }
-
- $installed += $success;
- } else {
- print << ".";
-*** Could not find a version $ver or above for $pkg; skipping.
-.
- }
-
- MY::postinstall( $pkg, $ver, $success ) if defined &MY::postinstall;
- }
-
- return $installed;
-}
-
-sub _cpanplus_config {
- my @config = ();
- while ( @_ ) {
- my ($key, $value) = (shift(), shift());
- if ( $key eq 'prerequisites_policy' ) {
- if ( $value eq 'follow' ) {
- $value = CPANPLUS::Internals::Constants::PREREQ_INSTALL();
- } elsif ( $value eq 'ask' ) {
- $value = CPANPLUS::Internals::Constants::PREREQ_ASK();
- } elsif ( $value eq 'ignore' ) {
- $value = CPANPLUS::Internals::Constants::PREREQ_IGNORE();
- } else {
- die "*** Cannot convert option $key = '$value' to CPANPLUS version.\n";
- }
- push @config, 'prereqs', $value;
- } elsif ( $key eq 'force' ) {
- push @config, $key, $value;
- } elsif ( $key eq 'notest' ) {
- push @config, 'skiptest', $value;
- } else {
- die "*** Cannot convert option $key to CPANPLUS version.\n";
- }
- }
- return @config;
-}
-
-sub _install_cpan {
- my @modules = @{ +shift };
- my @config = @{ +shift };
- my $installed = 0;
- my %args;
-
- _load_cpan();
- require Config;
-
- if (CPAN->VERSION < 1.80) {
- # no "sudo" support, probe for writableness
- return unless _can_write( MM->catfile( $CPAN::Config->{cpan_home}, 'sources' ) )
- and _can_write( $Config::Config{sitelib} );
- }
-
- # if we're root, set UNINST=1 to avoid trouble unless user asked for it.
- my $makeflags = $CPAN::Config->{make_install_arg} || '';
- $CPAN::Config->{make_install_arg} =
- join( ' ', split( ' ', $makeflags ), 'UNINST=1' )
- if ( $makeflags !~ /\bUNINST\b/ and eval qq{ $> eq '0' } );
-
- # don't show start-up info
- $CPAN::Config->{inhibit_startup_message} = 1;
-
- # set additional options
- while ( my ( $opt, $arg ) = splice( @config, 0, 2 ) ) {
- ( $args{$opt} = $arg, next )
- if $opt =~ /^(?:force|notest)$/; # pseudo-option
- $CPAN::Config->{$opt} = $arg;
- }
-
- if ($args{notest} && (not CPAN::Shell->can('notest'))) {
- die "Your version of CPAN is too old to support the 'notest' pragma";
- }
-
- local $CPAN::Config->{prerequisites_policy} = 'follow';
-
- while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) {
- MY::preinstall( $pkg, $ver ) or next if defined &MY::preinstall;
-
- print "*** Installing $pkg...\n";
-
- my $obj = CPAN::Shell->expand( Module => $pkg );
- my $success = 0;
-
- if ( $obj and _version_cmp( $obj->cpan_version, $ver ) >= 0 ) {
- my $pathname = $pkg;
- $pathname =~ s/::/\\W/;
-
- foreach my $inc ( grep { m/$pathname.pm/i } keys(%INC) ) {
- delete $INC{$inc};
- }
-
- my $rv = do {
- if ($args{force}) {
- CPAN::Shell->force( install => $pkg )
- } elsif ($args{notest}) {
- CPAN::Shell->notest( install => $pkg )
- } else {
- CPAN::Shell->install($pkg)
- }
- };
-
- $rv ||= eval {
- $CPAN::META->instance( 'CPAN::Distribution', $obj->cpan_file, )
- ->{install}
- if $CPAN::META;
- };
-
- if ( $rv eq 'YES' ) {
- print "*** $pkg successfully installed.\n";
- $success = 1;
- }
- else {
- print "*** $pkg installation failed.\n";
- $success = 0;
- }
-
- $installed += $success;
- }
- else {
- print << ".";
-*** Could not find a version $ver or above for $pkg; skipping.
-.
- }
-
- MY::postinstall( $pkg, $ver, $success ) if defined &MY::postinstall;
- }
-
- return $installed;
-}
-
-sub _has_cpanplus {
- return (
- $HasCPANPLUS = (
- $INC{'CPANPLUS/Config.pm'}
- or _load('CPANPLUS::Shell::Default')
- )
- );
-}
-
-# make guesses on whether we're under the CPAN installation directory
-sub _under_cpan {
- require Cwd;
- require File::Spec;
-
- my $cwd = File::Spec->canonpath( Cwd::cwd() );
- my $cpan = File::Spec->canonpath( $CPAN::Config->{cpan_home} );
-
- return ( index( $cwd, $cpan ) > -1 );
-}
-
-sub _update_to {
- my $class = __PACKAGE__;
- my $ver = shift;
-
- return
- if _version_cmp( _version_of($class), $ver ) >= 0; # no need to upgrade
-
- if (
- _prompt( "==> A newer version of $class ($ver) is required. Install?",
- 'y' ) =~ /^[Nn]/
- )
- {
- die "*** Please install $class $ver manually.\n";
- }
-
- print << ".";
-*** Trying to fetch it from CPAN...
-.
-
- # install ourselves
- _load($class) and return $class->import(@_)
- if $class->install( [], $class, $ver );
-
- print << '.'; exit 1;
-
-*** Cannot bootstrap myself. :-( Installation terminated.
-.
-}
-
-# check if we're connected to some host, using inet_aton
-sub _connected_to {
- my $site = shift;
-
- return (
- ( _load('Socket') and Socket::inet_aton($site) ) or _prompt(
- qq(
-*** Your host cannot resolve the domain name '$site', which
- probably means the Internet connections are unavailable.
-==> Should we try to install the required module(s) anyway?), 'n'
- ) =~ /^[Yy]/
- );
-}
-
-# check if a directory is writable; may create it on demand
-sub _can_write {
- my $path = shift;
- mkdir( $path, 0755 ) unless -e $path;
-
- return 1 if -w $path;
-
- print << ".";
-*** You are not allowed to write to the directory '$path';
- the installation may fail due to insufficient permissions.
-.
-
- if (
- eval '$>' and lc(`sudo -V`) =~ /version/ and _prompt(
- qq(
-==> Should we try to re-execute the autoinstall process with 'sudo'?),
- ((-t STDIN) ? 'y' : 'n')
- ) =~ /^[Yy]/
- )
- {
-
- # try to bootstrap ourselves from sudo
- print << ".";
-*** Trying to re-execute the autoinstall process with 'sudo'...
-.
- my $missing = join( ',', @Missing );
- my $config = join( ',',
- UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} )
- if $Config;
-
- return
- unless system( 'sudo', $^X, $0, "--config=$config",
- "--installdeps=$missing" );
-
- print << ".";
-*** The 'sudo' command exited with error! Resuming...
-.
- }
-
- return _prompt(
- qq(
-==> Should we try to install the required module(s) anyway?), 'n'
- ) =~ /^[Yy]/;
-}
-
-# load a module and return the version it reports
-sub _load {
- my $mod = pop; # method/function doesn't matter
- my $file = $mod;
- $file =~ s|::|/|g;
- $file .= '.pm';
- local $@;
- return eval { require $file; $mod->VERSION } || ( $@ ? undef: 0 );
-}
-
-# report version without loading a module
-sub _version_of {
- my $mod = pop; # method/function doesn't matter
- my $file = $mod;
- $file =~ s|::|/|g;
- $file .= '.pm';
- foreach my $dir ( @INC ) {
- next if ref $dir;
- my $path = File::Spec->catfile($dir, $file);
- next unless -e $path;
- require ExtUtils::MM_Unix;
- return ExtUtils::MM_Unix->parse_version($path);
- }
- return undef;
-}
-
-# Load CPAN.pm and it's configuration
-sub _load_cpan {
- return if $CPAN::VERSION and $CPAN::Config and not @_;
- require CPAN;
-
- # CPAN-1.82+ adds CPAN::Config::AUTOLOAD to redirect to
- # CPAN::HandleConfig->load. CPAN reports that the redirection
- # is deprecated in a warning printed at the user.
-
- # CPAN-1.81 expects CPAN::HandleConfig->load, does not have
- # $CPAN::HandleConfig::VERSION but cannot handle
- # CPAN::Config->load
-
- # Which "versions expect CPAN::Config->load?
-
- if ( $CPAN::HandleConfig::VERSION
- || CPAN::HandleConfig->can('load')
- ) {
- # Newer versions of CPAN have a HandleConfig module
- CPAN::HandleConfig->load;
- } else {
- # Older versions had the load method in Config directly
- CPAN::Config->load;
- }
-}
-
-# compare two versions, either use Sort::Versions or plain comparison
-# return values same as <=>
-sub _version_cmp {
- my ( $cur, $min ) = @_;
- return -1 unless defined $cur; # if 0 keep comparing
- return 1 unless $min;
-
- $cur =~ s/\s+$//;
-
- # check for version numbers that are not in decimal format
- if ( ref($cur) or ref($min) or $cur =~ /v|\..*\./ or $min =~ /v|\..*\./ ) {
- if ( ( $version::VERSION or defined( _load('version') )) and
- version->can('new')
- ) {
-
- # use version.pm if it is installed.
- return version->new($cur) <=> version->new($min);
- }
- elsif ( $Sort::Versions::VERSION or defined( _load('Sort::Versions') ) )
- {
-
- # use Sort::Versions as the sorting algorithm for a.b.c versions
- return Sort::Versions::versioncmp( $cur, $min );
- }
-
- warn "Cannot reliably compare non-decimal formatted versions.\n"
- . "Please install version.pm or Sort::Versions.\n";
- }
-
- # plain comparison
- local $^W = 0; # shuts off 'not numeric' bugs
- return $cur <=> $min;
-}
-
-# nothing; this usage is deprecated.
-sub main::PREREQ_PM { return {}; }
-
-sub _make_args {
- my %args = @_;
-
- $args{PREREQ_PM} = { %{ $args{PREREQ_PM} || {} }, @Existing, @Missing }
- if $UnderCPAN or $TestOnly;
-
- if ( $args{EXE_FILES} and -e 'MANIFEST' ) {
- require ExtUtils::Manifest;
- my $manifest = ExtUtils::Manifest::maniread('MANIFEST');
-
- $args{EXE_FILES} =
- [ grep { exists $manifest->{$_} } @{ $args{EXE_FILES} } ];
- }
-
- $args{test}{TESTS} ||= 't/*.t';
- $args{test}{TESTS} = join( ' ',
- grep { !exists( $DisabledTests{$_} ) }
- map { glob($_) } split( /\s+/, $args{test}{TESTS} ) );
-
- my $missing = join( ',', @Missing );
- my $config =
- join( ',', UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config} )
- if $Config;
-
- $PostambleActions = (
- ($missing and not $UnderCPAN)
- ? "\$(PERL) $0 --config=$config --installdeps=$missing"
- : "\$(NOECHO) \$(NOOP)"
- );
-
- my $deps_list = join( ',', @Missing, @Existing );
-
- $PostambleActionsUpgradeDeps =
- "\$(PERL) $0 --config=$config --upgradedeps=$deps_list";
-
- my $config_notest =
- join( ',', (UNIVERSAL::isa( $Config, 'HASH' ) ? %{$Config} : @{$Config}),
- 'notest', 1 )
- if $Config;
-
- $PostambleActionsNoTest = (
- ($missing and not $UnderCPAN)
- ? "\$(PERL) $0 --config=$config_notest --installdeps=$missing"
- : "\$(NOECHO) \$(NOOP)"
- );
-
- $PostambleActionsUpgradeDepsNoTest =
- "\$(PERL) $0 --config=$config_notest --upgradedeps=$deps_list";
-
- $PostambleActionsListDeps =
- '@$(PERL) -le "print for @ARGV" '
- . join(' ', map $Missing[$_], grep $_ % 2 == 0, 0..$#Missing);
-
- my @all = (@Missing, @Existing);
-
- $PostambleActionsListAllDeps =
- '@$(PERL) -le "print for @ARGV" '
- . join(' ', map $all[$_], grep $_ % 2 == 0, 0..$#all);
-
- return %args;
-}
-
-# a wrapper to ExtUtils::MakeMaker::WriteMakefile
-sub Write {
- require Carp;
- Carp::croak "WriteMakefile: Need even number of args" if @_ % 2;
-
- if ($CheckOnly) {
- print << ".";
-*** Makefile not written in check-only mode.
-.
- return;
- }
-
- my %args = _make_args(@_);
-
- no strict 'refs';
-
- $PostambleUsed = 0;
- local *MY::postamble = \&postamble unless defined &MY::postamble;
- ExtUtils::MakeMaker::WriteMakefile(%args);
-
- print << "." unless $PostambleUsed;
-*** WARNING: Makefile written with customized MY::postamble() without
- including contents from Module::AutoInstall::postamble() --
- auto installation features disabled. Please contact the author.
-.
-
- return 1;
-}
-
-sub postamble {
- $PostambleUsed = 1;
- my $fragment;
-
- $fragment .= <<"AUTO_INSTALL" if !$InstallDepsTarget;
-
-config :: installdeps
-\t\$(NOECHO) \$(NOOP)
-AUTO_INSTALL
-
- $fragment .= <<"END_MAKE";
-
-checkdeps ::
-\t\$(PERL) $0 --checkdeps
-
-installdeps ::
-\t$PostambleActions
-
-installdeps_notest ::
-\t$PostambleActionsNoTest
-
-upgradedeps ::
-\t$PostambleActionsUpgradeDeps
-
-upgradedeps_notest ::
-\t$PostambleActionsUpgradeDepsNoTest
-
-listdeps ::
-\t$PostambleActionsListDeps
-
-listalldeps ::
-\t$PostambleActionsListAllDeps
-
-END_MAKE
-
- return $fragment;
-}
-
-1;
-
-__END__
-
-#line 1193
diff --git a/inc/Module/Install.pm b/inc/Module/Install.pm
index 4ecf46b..5460dd5 100644
--- a/inc/Module/Install.pm
+++ b/inc/Module/Install.pm
@@ -17,7 +17,7 @@ package Module::Install;
# 3. The ./inc/ version of Module::Install loads
# }
-use 5.005;
+use 5.006;
use strict 'vars';
use Cwd ();
use File::Find ();
@@ -31,7 +31,7 @@ BEGIN {
# 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 = '1.06';
+ $VERSION = '1.12';
# Storage for the pseudo-singleton
$MAIN = undef;
@@ -156,10 +156,10 @@ END_DIE
sub autoload {
my $self = shift;
my $who = $self->_caller;
- my $cwd = Cwd::cwd();
+ my $cwd = Cwd::getcwd();
my $sym = "${who}::AUTOLOAD";
$sym->{$cwd} = sub {
- my $pwd = Cwd::cwd();
+ my $pwd = Cwd::getcwd();
if ( my $code = $sym->{$pwd} ) {
# Delegate back to parent dirs
goto &$code unless $cwd eq $pwd;
@@ -239,7 +239,7 @@ sub new {
# 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 ) {
+ unless ( Cwd::abs_path(Cwd::getcwd()) eq $base_path ) {
delete $args{prefix};
}
return $args{_self} if $args{_self};
@@ -338,7 +338,7 @@ sub find_extensions {
if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) {
my $content = Module::Install::_read($subpath . '.pm');
my $in_pod = 0;
- foreach ( split //, $content ) {
+ foreach ( split /\n/, $content ) {
$in_pod = 1 if /^=\w/;
$in_pod = 0 if /^=cut/;
next if ($in_pod || /^=cut/); # skip pod text
@@ -434,7 +434,7 @@ END_OLD
# _version is for processing module versions (eg, 1.03_05) not
# Perl versions (eg, 5.8.1).
-sub _version ($) {
+sub _version {
my $s = shift || 0;
my $d =()= $s =~ /(\.)/g;
if ( $d >= 2 ) {
@@ -450,12 +450,12 @@ sub _version ($) {
return $l + 0;
}
-sub _cmp ($$) {
+sub _cmp {
_version($_[1]) <=> _version($_[2]);
}
# Cloned from Params::Util::_CLASS
-sub _CLASS ($) {
+sub _CLASS {
(
defined $_[0]
and
diff --git a/inc/Module/Install/AutoInstall.pm b/inc/Module/Install/AutoInstall.pm
deleted file mode 100644
index 6efe4fe..0000000
--- a/inc/Module/Install/AutoInstall.pm
+++ /dev/null
@@ -1,93 +0,0 @@
-#line 1
-package Module::Install::AutoInstall;
-
-use strict;
-use Module::Install::Base ();
-
-use vars qw{$VERSION @ISA $ISCORE};
-BEGIN {
- $VERSION = '1.06';
- @ISA = 'Module::Install::Base';
- $ISCORE = 1;
-}
-
-sub AutoInstall { $_[0] }
-
-sub run {
- my $self = shift;
- $self->auto_install_now(@_);
-}
-
-sub write {
- my $self = shift;
- $self->auto_install(@_);
-}
-
-sub auto_install {
- my $self = shift;
- return if $self->{done}++;
-
- # Flatten array of arrays into a single array
- my @core = map @$_, map @$_, grep ref,
- $self->build_requires, $self->requires;
-
- my @config = @_;
-
- # We'll need Module::AutoInstall
- $self->include('Module::AutoInstall');
- require Module::AutoInstall;
-
- my @features_require = Module::AutoInstall->import(
- (@config ? (-config => \@config) : ()),
- (@core ? (-core => \@core) : ()),
- $self->features,
- );
-
- my %seen;
- my @requires = map @$_, map @$_, grep ref, $self->requires;
- while (my ($mod, $ver) = splice(@requires, 0, 2)) {
- $seen{$mod}{$ver}++;
- }
- my @build_requires = map @$_, map @$_, grep ref, $self->build_requires;
- while (my ($mod, $ver) = splice(@build_requires, 0, 2)) {
- $seen{$mod}{$ver}++;
- }
- my @configure_requires = map @$_, map @$_, grep ref, $self->configure_requires;
- while (my ($mod, $ver) = splice(@configure_requires, 0, 2)) {
- $seen{$mod}{$ver}++;
- }
-
- my @deduped;
- while (my ($mod, $ver) = splice(@features_require, 0, 2)) {
- push @deduped, $mod => $ver unless $seen{$mod}{$ver}++;
- }
-
- $self->requires(@deduped);
-
- $self->makemaker_args( Module::AutoInstall::_make_args() );
-
- my $class = ref($self);
- $self->postamble(
- "# --- $class section:\n" .
- Module::AutoInstall::postamble()
- );
-}
-
-sub installdeps_target {
- my ($self, @args) = @_;
-
- $self->include('Module::AutoInstall');
- require Module::AutoInstall;
-
- Module::AutoInstall::_installdeps_target(1);
-
- $self->auto_install(@args);
-}
-
-sub auto_install_now {
- my $self = shift;
- $self->auto_install(@_);
- Module::AutoInstall::do_install();
-}
-
-1;
diff --git a/inc/Module/Install/Base.pm b/inc/Module/Install/Base.pm
index 802844a..f9bf5de 100644
--- a/inc/Module/Install/Base.pm
+++ b/inc/Module/Install/Base.pm
@@ -4,7 +4,7 @@ package Module::Install::Base;
use strict 'vars';
use vars qw{$VERSION};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.12';
}
# Suspend handler for "redefined" warnings
diff --git a/inc/Module/Install/Can.pm b/inc/Module/Install/Can.pm
index 22167b8..b4e5e3b 100644
--- a/inc/Module/Install/Can.pm
+++ b/inc/Module/Install/Can.pm
@@ -8,7 +8,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.12';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/Fetch.pm b/inc/Module/Install/Fetch.pm
index bee0c4f..54f14fb 100644
--- a/inc/Module/Install/Fetch.pm
+++ b/inc/Module/Install/Fetch.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.12';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/Include.pm b/inc/Module/Install/Include.pm
index 8310e4c..7224cff 100644
--- a/inc/Module/Install/Include.pm
+++ b/inc/Module/Install/Include.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.12';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/Makefile.pm b/inc/Module/Install/Makefile.pm
index 7052f36..81cddd5 100644
--- a/inc/Module/Install/Makefile.pm
+++ b/inc/Module/Install/Makefile.pm
@@ -8,7 +8,7 @@ use Fcntl qw/:flock :seek/;
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.12';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -133,7 +133,7 @@ sub makemaker_args {
return $args;
}
-# For mm args that take multiple space-seperated args,
+# For mm args that take multiple space-separated args,
# append an argument to the current list.
sub makemaker_append {
my $self = shift;
diff --git a/inc/Module/Install/Metadata.pm b/inc/Module/Install/Metadata.pm
index 58430f3..2c66b1e 100644
--- a/inc/Module/Install/Metadata.pm
+++ b/inc/Module/Install/Metadata.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.12';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -347,7 +347,7 @@ sub name_from {
^ \s*
package \s*
([\w:]+)
- \s* ;
+ [\s|;]*
/ixms
) {
my ($name, $module_name) = ($1, $1);
@@ -705,7 +705,7 @@ sub _write_mymeta_data {
my @yaml = Parse::CPAN::Meta::LoadFile('META.yml');
my $meta = $yaml[0];
- # Overwrite the non-configure dependency hashs
+ # Overwrite the non-configure dependency hashes
delete $meta->{requires};
delete $meta->{build_requires};
delete $meta->{recommends};
diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index b2c1e0c..73e7245 100644
--- a/inc/Module/Install/RTx.pm
+++ b/inc/Module/Install/RTx.pm
@@ -8,7 +8,7 @@ no warnings 'once';
use Module::Install::Base;
use base 'Module::Install::Base';
-our $VERSION = '0.32_01';
+our $VERSION = '0.36';
use FindBin;
use File::Glob ();
@@ -18,95 +18,79 @@ my @DIRS = qw(etc lib html static bin sbin po var);
my @INDEX_DIRS = qw(lib bin sbin);
sub RTx {
- my ( $self, $name ) = @_;
+ my ( $self, $name, $extra_args ) = @_;
+ $extra_args ||= {};
- my $original_name = $name;
- my $RTx = 'RTx';
- $RTx = $1 if $name =~ s/^(\w+)-//;
+ # Set up names
my $fname = $name;
$fname =~ s!-!/!g;
- $self->name("$RTx-$name")
+ $self->name( $name )
unless $self->name;
- $self->all_from( -e "$name.pm" ? "$name.pm" : "lib/$RTx/$fname.pm" )
+ $self->all_from( "lib/$fname.pm" )
unless $self->version;
- $self->abstract("RT $name Extension")
+ $self->abstract("$name Extension")
unless $self->abstract;
-
- 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 = (
- $ENV{RTHOME} ? ( $ENV{RTHOME}, "$ENV{RTHOME}/lib" ) : (),
- @INC,
- map { ( "$_/rt4/lib", "$_/lib/rt4", "$_/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 directory containing your RT.pm:") or exit;
- $_ =~ s/\/RT\.pm$//;
- push @INC, $_, "$_/rt3/lib", "$_/lib/rt3", "$_/lib";
- }
+ unless ( $extra_args->{no_readme_generation} ) {
+ $self->readme_from( "lib/$fname.pm",
+ { options => [ quotes => "none" ] } );
+ }
+ $self->add_metadata("x_module_install_rtx_version", $VERSION );
+
+ # Try to find RT.pm
+ my @prefixes = qw( /opt /usr/local /home /usr /sw /usr/share/request-tracker4);
+ $ENV{RTHOME} =~ s{/RT\.pm$}{} if defined $ENV{RTHOME};
+ $ENV{RTHOME} =~ s{/lib/?$}{} if defined $ENV{RTHOME};
+ my @try = $ENV{RTHOME} ? ($ENV{RTHOME}, "$ENV{RTHOME}/lib") : ();
+ while (1) {
+ my @look = @INC;
+ unshift @look, grep {defined and -d $_} @try;
+ push @look, grep {defined and -d $_}
+ map { ( "$_/rt4/lib", "$_/lib/rt4", "$_/lib" ) } @prefixes;
+ last if eval {local @INC = @look; require RT; $RT::LocalLibPath};
+
+ warn
+ "Cannot find the location of RT.pm that defines \$RT::LocalPath in: @look\n";
+ my $given = $self->prompt("Path to directory containing your RT.pm:") or exit;
+ $given =~ s{/RT\.pm$}{};
+ $given =~ s{/lib/?$}{};
+ @try = ($given, "$given/lib");
}
- 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;
- unshift @INC, $lib_path;
-
- $RT::LocalVarPath ||= $RT::VarPath;
- $RT::LocalPoPath ||= $RT::LocalLexiconPath;
- $RT::LocalHtmlPath ||= $RT::MasonComponentRoot;
- $RT::LocalStaticPath ||= $RT::StaticPath;
- $RT::LocalLibPath ||= "$RT::LocalPath/lib";
- my $with_subdirs = $ENV{WITH_SUBDIRS};
- @ARGV = grep { /WITH_SUBDIRS=(.*)/ ? ( ( $with_subdirs = $1 ), 0 ) : 1 }
- @ARGV;
+ my $local_lib_path = $RT::LocalLibPath;
+ unshift @INC, $local_lib_path;
+ my $lib_path = File::Basename::dirname( $INC{'RT.pm'} );
+ unshift @INC, $lib_path;
- my %subdirs;
- %subdirs = map { $_ => 1 } split( /\s*,\s*/, $with_subdirs )
- if defined $with_subdirs;
- unless ( keys %subdirs ) {
- $subdirs{$_} = 1 foreach grep -d "$FindBin::Bin/$_", @DIRS;
+ # Set a baseline minimum version
+ unless ( $extra_args->{deprecated_rt} ) {
+ $self->requires_rt('4.0.0');
}
- # 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
+ # Installation locations
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{$_} = $RT::LocalPluginPath . "/$name/$_"
+ foreach @DIRS;
- $path{$_} .= "/$name" for grep $path{$_}, qw(etc po var);
- }
+ # Copy RT 4.2.0 static files into NoAuth; insufficient for
+ # images, but good enough for css and js.
+ $path{static} = "$path{html}/NoAuth/"
+ unless $RT::StaticPath;
+
+ # Delete the ones we don't need
+ delete $path{$_} for grep {not -d "$FindBin::Bin/$_"} 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;
+ sort keys %path;
- print "./$_\t=> $path{$_}\n" for sort keys %subdirs;
+ printf "%-10s => %s\n", $_, $path{$_} for sort keys %path;
- if ( my @dirs = map { ( -D => $_ ) } grep $subdirs{$_}, qw(bin html sbin) ) {
+ if ( my @dirs = map { ( -D => $_ ) } grep $path{$_}, qw(bin html sbin etc) ) {
my @po = map { ( -o => $_ ) }
grep -f,
File::Glob::bsd_glob("po/*.po");
@@ -116,12 +100,15 @@ lexicons ::
.
}
+ $self->include('Module::Install::RTx::Runtime') if $self->admin;
+ $self->include_deps( 'YAML::Tiny', 0 ) if $self->admin;
my $postamble = << ".";
install ::
+\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Iinc -MModule::Install::RTx::Runtime -e"RTxPlugin()"
\t\$(NOECHO) \$(PERL) -MExtUtils::Install -e \"install({$args})\"
.
- if ( $subdirs{var} and -d $RT::MasonDataDir ) {
+ if ( $path{var} and -d $RT::MasonDataDir ) {
my ( $uid, $gid ) = ( stat($RT::MasonDataDir) )[ 4, 5 ];
$postamble .= << ".";
\t\$(NOECHO) chown -R $uid:$gid $path{var}
@@ -136,14 +123,16 @@ install ::
$has_etc{acl}++;
}
if ( -e 'etc/initialdata' ) { $has_etc{initialdata}++; }
- if ( -d 'etc/upgrade/' ) { $has_etc{upgrade}++; }
+ if ( grep { /\d+\.\d+(\.\d+)?.*$/ } glob('etc/upgrade/*.*') ) {
+ $has_etc{upgrade}++;
+ }
$self->postamble("$postamble\n");
- unless ( $subdirs{'lib'} ) {
- $self->makemaker_args( PM => { "" => "" }, );
- } else {
+ if ( $path{lib} ) {
$self->makemaker_args( INSTALLSITELIB => $path{'lib'} );
$self->makemaker_args( INSTALLARCHLIB => $path{'lib'} );
+ } else {
+ $self->makemaker_args( PM => { "" => "" }, );
}
$self->makemaker_args( INSTALLSITEMAN1DIR => "$RT::LocalPath/man/man1" );
@@ -151,47 +140,96 @@ install ::
$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"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(schema \$(NAME) \$(VERSION)))"
+\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Iinc -MModule::Install::RTx::Runtime -e"RTxDatabase(qw(schema \$(NAME) \$(VERSION)))"
.
$initdb .= <<"." if $has_etc{acl};
-\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(acl \$(NAME) \$(VERSION)))"
+\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Iinc -MModule::Install::RTx::Runtime -e"RTxDatabase(qw(acl \$(NAME) \$(VERSION)))"
.
$initdb .= <<"." if $has_etc{initialdata};
-\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(insert \$(NAME) \$(VERSION)))"
+\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Iinc -MModule::Install::RTx::Runtime -e"RTxDatabase(qw(insert \$(NAME) \$(VERSION)))"
.
$self->postamble("initdb ::\n$initdb\n");
$self->postamble("initialize-database ::\n$initdb\n");
if ($has_etc{upgrade}) {
print "To upgrade from a previous version of this extension, use 'make upgrade-database'\n";
- my $upgradedb = qq|\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(upgrade \$(NAME) \$(VERSION)))"\n|;
+ my $upgradedb = qq|\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Iinc -MModule::Install::RTx::Runtime -e"RTxDatabase(qw(upgrade \$(NAME) \$(VERSION)))"\n|;
$self->postamble("upgrade-database ::\n$upgradedb\n");
$self->postamble("upgradedb ::\n$upgradedb\n");
}
}
+
}
sub requires_rt {
my ($self,$version) = @_;
+ _load_rt_handle();
+
+ if ($self->is_admin) {
+ $self->add_metadata("x_requires_rt", $version);
+ my @sorted = sort RT::Handle::cmp_version $version,'4.0.0';
+ $self->perl_version('5.008003') if $sorted[0] eq '4.0.0'
+ and (not $self->perl_version or '5.008003' > $self->perl_version);
+ @sorted = sort RT::Handle::cmp_version $version,'4.2.0';
+ $self->perl_version('5.010001') if $sorted[0] eq '4.2.0'
+ and (not $self->perl_version or '5.010001' > $self->perl_version);
+ }
+
# if we're exactly the same version as what we want, silently return
return if ($version eq $RT::VERSION);
- _load_rt_handle();
my @sorted = sort RT::Handle::cmp_version $version,$RT::VERSION;
if ($sorted[-1] eq $version) {
- # should we die?
- die "\nWarning: prerequisite RT $version not found. Your installed version of RT ($RT::VERSION) is too old.\n\n";
+ die <<"EOT";
+
+**** Error: This extension requires RT $version. Your installed version
+ of RT ($RT::VERSION) is too old.
+
+EOT
}
}
+sub requires_rt_plugin {
+ my $self = shift;
+ my ( $plugin ) = @_;
+
+ if ($self->is_admin) {
+ my $plugins = $self->Meta->{values}{"x_requires_rt_plugins"} || [];
+ push @{$plugins}, $plugin;
+ $self->add_metadata("x_requires_rt_plugins", $plugins);
+ }
+
+ my $path = $plugin;
+ $path =~ s{\:\:}{-}g;
+ $path = "$RT::LocalPluginPath/$path/lib";
+ if ( -e $path ) {
+ unshift @INC, $path;
+ } else {
+ my $name = $self->name;
+ warn <<"EOT";
+
+**** Warning: $name requires that the $plugin plugin be installed and
+ enabled; it does not appear to be installed.
+
+EOT
+ }
+ $self->requires(@_);
+}
+
sub rt_too_new {
my ($self,$version,$msg) = @_;
- $msg ||= "Your version %s is too new, this extension requires a release of RT older than %s";
+ my $name = $self->name;
+ $msg ||= <<EOT;
+
+**** Error: Your installed version of RT (%s) is too new; this extension
+ only works with versions older than %s.
+
+EOT
+ $self->add_metadata("x_rt_too_new", $version) if $self->is_admin;
_load_rt_handle();
my @sorted = sort RT::Handle::cmp_version $version,$RT::VERSION;
@@ -220,4 +258,4 @@ sub _load_rt_handle {
__END__
-#line 360
+#line 390
diff --git a/inc/Module/Install/Win32.pm b/inc/Module/Install/Win32.pm
index eeaa3fe..e48c32d 100644
--- a/inc/Module/Install/Win32.pm
+++ b/inc/Module/Install/Win32.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.12';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/WriteAll.pm b/inc/Module/Install/WriteAll.pm
index 85d8018..409ef40 100644
--- a/inc/Module/Install/WriteAll.pm
+++ b/inc/Module/Install/WriteAll.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.12';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
diff --git a/lib/RT/Extension/CommentOnCreate.pm b/lib/RT/Extension/CommentOnCreate.pm
index 034748c..46053fd 100644
--- a/lib/RT/Extension/CommentOnCreate.pm
+++ b/lib/RT/Extension/CommentOnCreate.pm
@@ -1,6 +1,6 @@
package RT::Extension::CommentOnCreate;
-our $VERSION = '0.06';
+our $VERSION = '1.00';
use warnings;
use strict;
@@ -11,7 +11,7 @@ use Carp;
RT::Extension::CommentOnCreate - Adds an optional Comment box to Ticket Creation
-=head1 INSTALLATION
+=head1 INSTALLATION
=over
@@ -23,23 +23,13 @@ RT::Extension::CommentOnCreate - Adds an optional Comment box to Ticket Creation
May need root permissions
-=item C<patch rt (see patches directory)>
-
-if you're running a version less than 3.8.8
-
- patch -p1 < 3.8.7-after_message_box_callback.diff
-
-you're running a version less than 4.0.7
-
- patch -p1 < 4.0.6-include_article_flag.diff
-
=item Edit your F</opt/rt4/etc/RT_SiteConfig.pm>
If you are using RT 4.2 or greater, add this line:
Plugin('RT::Extension::CommentOnCreate');
-For earlier releases of RT 4, add this line:
+For RT 4.0, add this line:
Set(@Plugins, qw(RT::Extension::CommentOnCreate));
@@ -55,57 +45,36 @@ or add C<RT::Extension::CommentOnCreate> to your existing C<@Plugins> line.
=head1 CONFIGURATION
-Optional configuration options to control the width and height of the Comment textbox
+Optional configuration options to control the width and height of the
+Comment textbox:
Set($CommentOnCreateWidth, 80);
Set($CommentOnCreateHeight, 190);
-These only apply if you have MessageBoxRichText enabled, otherwise it will inherit the global
-MessageBoxRichTextHeight attribute.
-
-=head1 BUGS AND LIMITATIONS
-
-No bugs have been reported.
-
-Please report any bugs or feature requests to
-C<bug-rt-extension-commentoncreate at rt.cpan.org>, or through the web interface at
-L<http://rt.cpan.org>.
+These only apply if you have C<MessageBoxRichText> enabled; otherwise it
+will inherit the global C<MessageBoxRichTextHeight> attribute.
=head1 AUTHOR
-Kevin Falcone C<< <falcone at bestpractical.com> >>
+Best Practical Solutions, LLC E<lt>modules at bestpractical.comE<gt>
+
+=head1 BUGS
+All bugs should be reported via email to
-=head1 LICENCE AND COPYRIGHT
+ L<bug-RT-Extension-CommentOnCreate at rt.cpan.org|mailto:bug-RT-Extension-CommentOnCreate at rt.cpan.org>
-Copyright (c) 2010-2014, Best Practical Solutions, LLC. All rights reserved.
+or via the web at
-This module is free software; you can redistribute it and/or
-modify it under the terms of version 2 of the GNU General Public License.
+ L<rt.cpan.org|http://rt.cpan.org/Public/Dist/Display.html?Name=RT-Extension-CommentOnCreate>.
+=head1 LICENSE AND COPYRIGHT
-=head1 DISCLAIMER OF WARRANTY
+This software is Copyright (c) 2014 by Best Practical Solutions
-BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
-EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
-ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
-YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
-NECESSARY SERVICING, REPAIR, OR CORRECTION.
+This is free software, licensed under:
-IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE
-LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
-OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
-THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
+ The GNU General Public License, Version 2, June 1991
=cut
diff --git a/patches/3.8.7-after_message_box_callback.diff b/patches/3.8.7-after_message_box_callback.diff
deleted file mode 100644
index 9bf79b8..0000000
--- a/patches/3.8.7-after_message_box_callback.diff
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/share/html/Ticket/Create.html b/share/html/Ticket/Create.html
-index 28b6556..f8ac436 100755
---- a/share/html/Ticket/Create.html
-+++ b/share/html/Ticket/Create.html
-@@ -158,6 +158,7 @@
- % } else {
- <& /Elements/MessageBox, QuoteTransaction => $QuoteTransaction &>
- %}
-+% $m->callback( %ARGS, QueueObj => $QueueObj, CallbackName => 'AfterMessageBox' );
-
- <br />
- </td>
diff --git a/patches/4.0.6-include_article_flag.diff b/patches/4.0.6-include_article_flag.diff
deleted file mode 100644
index 043f81a..0000000
--- a/patches/4.0.6-include_article_flag.diff
+++ /dev/null
@@ -1,19 +0,0 @@
-diff --git a/share/html/Elements/MessageBox b/share/html/Elements/MessageBox
-index 61995e0..69227bf 100755
---- a/share/html/Elements/MessageBox
-+++ b/share/html/Elements/MessageBox
-@@ -46,7 +46,7 @@
- %#
- %# END BPS TAGGED BLOCK }}}
- <textarea autocomplete="off" class="messagebox" <% $width_attr %>="<% $Width %>" rows="<% $Height %>" <% $wrap_type |n %> name="<% $Name %>" id="<% $Name %>">\
--% $m->comp('/Articles/Elements/IncludeArticle', %ARGS);
-+% $m->comp('/Articles/Elements/IncludeArticle', %ARGS) if $IncludeArticle;
- % $m->callback( %ARGS, SignatureRef => \$signature );
- <% $Default || '' %><% $message %><% $signature %></textarea>
- % $m->callback( %ARGS, CallbackName => 'AfterTextArea' );
-@@ -89,4 +89,5 @@ $Width => RT->Config->Get('MessageBoxWidth', $session{'CurrentUser'}
- $Height => RT->Config->Get('MessageBoxHeight', $session{'CurrentUser'} ) || 15
- $Wrap => RT->Config->Get('MessageBoxWrap', $session{'CurrentUser'} ) || 'SOFT'
- $IncludeSignature => RT->Config->Get('MessageBoxIncludeSignature');
-+$IncludeArticle => 1;
- </%ARGS>
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list