Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MANIFEST
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
html/Ticket/AttachmentZip/dhandler
html/Callbacks/AttachmentZip/Ticket/Elements/ShowAttachments/AfterAttachmentTitleBox
html/Callbacks/AttachmentZip/Ticket/Elements/ShowAttachments/BeforeList
inc/Module/AutoInstall.pm
inc/Module/Install.pm
inc/Module/Install/AutoInstall.pm
Expand Down
9 changes: 5 additions & 4 deletions MYMETA.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"Richard G Harman Jr <rtx-attachmentszip+richard@richardharman.com>"
],
"dynamic_config" : 0,
"generated_by" : "Module::Install version 0.93, CPAN::Meta::Converter version 2.142690",
"generated_by" : "Module::Install version 0.93, CPAN::Meta::Converter version 2.150010",
"license" : [
"unknown"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
"version" : "2"
"version" : 2
},
"name" : "RT-Extension-AttachmentZip",
"no_index" : {
Expand All @@ -27,7 +27,7 @@
},
"configure" : {
"requires" : {
"ExtUtils::MakeMaker" : "6.42"
"ExtUtils::MakeMaker" : "0"
}
},
"runtime" : {
Expand All @@ -37,5 +37,6 @@
}
},
"release_status" : "stable",
"version" : "1.0"
"version" : "1.0",
"x_serialization_backend" : "JSON::PP version 4.06"
}
5 changes: 3 additions & 2 deletions MYMETA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ author:
build_requires:
ExtUtils::MakeMaker: '6.36'
configure_requires:
ExtUtils::MakeMaker: '6.42'
ExtUtils::MakeMaker: '0'
dynamic_config: 0
generated_by: 'Module::Install version 0.93, CPAN::Meta::Converter version 2.142690'
generated_by: 'Module::Install version 0.93, CPAN::Meta::Converter version 2.150010'
license: unknown
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
Expand All @@ -20,3 +20,4 @@ no_index:
requires:
Archive::Zip: '0'
version: '1.0'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
6 changes: 6 additions & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use lib '.';
use inc::Module::Install;

license('GPL Version 2');
Expand All @@ -10,6 +11,11 @@ rt_too_new '4.6.0';

version_from('lib/RT/Extension/AttachmentZip.pm');

my ($lib_path) = $INC{'RT.pm'} =~ /^(.*)[\\\/]/;
my $local_lib_path = "$RT::LocalPath/lib";
unshift @INC, $local_lib_path, $lib_path;


substitute(
{ RT_LIB_PATH => "$RT::LocalPath/lib " . File::Basename::dirname( $INC{'RT.pm'} ) },
{ sufix => '.in' },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
<table width="100%"><tr><td align="right"><font size="-1">
Download attachments as a zip archive |
% foreach my $mode (qw(Current All)) {
<a href="<%RT->Config->Get('WebPath')%>/Ticket/AttachmentZip/<%$mode%>/<%$Ticket->Id%>/Ticket_<%$Ticket->Id%>_attachments.zip"><%$mode%></a> |
Download attachments as zip |
% foreach my $mode (("Latest Versions", "All")) {
<a href="<%RT->Config->Get('WebPath')%>/Ticket/AttachmentZip/<%$mode%>/<%$Ticket->Id%>/Ticket_<%$Ticket->Id%>_attachments.zip" hx-boost="false"><%$mode%></a> |
% }
</font></td></tr></table>

<%init>
return if (
($$ShowMore == 0 && not defined $Count)
or $HideTitleBox == 1
);
</%init>

<%ARGS>
$Ticket => undef
$Count => undef
$ShowMore => \0
$HideTitleBox => 0
</%ARGS>

7 changes: 6 additions & 1 deletion html/Ticket/AttachmentZip/dhandler
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<%init>
# grab ticket number from URL
my ($mode,$ticket_no) = ($m->dhandler_arg =~ m/^((?:all|current))\/(\d+)\//i );
my ($mode,$ticket_no) = ($m->dhandler_arg =~ m/^((?:all|latest versions))\/(\d+)\//i );

# create ticket object
my $Ticket = LoadTicket($ticket_no);
Expand Down Expand Up @@ -113,4 +113,9 @@ AutoFlush => 0
<%once>
use Archive::Zip qw( :ERROR_CODES :CONSTANTS);
use File::Temp qw( tempfile tempdir);

# This seems to be necessary within RT for reasons unknown - if we wind up
# dealing with a filename with anything but ASCII chars, we stand a good chance
# of winding up with a corrupt zip.
$Archive::Zip::UNICODE = 1;
</%once>
35 changes: 6 additions & 29 deletions inc/Module/Install.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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.16';
$VERSION = '1.21';

# Storage for the pseudo-singleton
$MAIN = undef;
Expand Down Expand Up @@ -244,6 +244,8 @@ sub new {
}
return $args{_self} if $args{_self};

$base_path = VMS::Filespec::unixify($base_path) if $^O eq 'VMS';

$args{dispatch} ||= 'Admin';
$args{prefix} ||= 'inc';
$args{author} ||= ($^O eq 'VMS' ? '_author' : '.author');
Expand Down Expand Up @@ -322,7 +324,7 @@ sub find_extensions {
my ($self, $path) = @_;

my @found;
File::Find::find( sub {
File::Find::find( {no_chdir => 1, wanted => sub {
my $file = $File::Find::name;
return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is;
my $subpath = $1;
Expand All @@ -336,7 +338,7 @@ sub find_extensions {
# correctly. Otherwise, root through the file to locate the case-preserved
# version of the package name.
if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) {
my $content = Module::Install::_read($subpath . '.pm');
my $content = Module::Install::_read($File::Find::name);
my $in_pod = 0;
foreach ( split /\n/, $content ) {
$in_pod = 1 if /^=\w/;
Expand All @@ -351,7 +353,7 @@ sub find_extensions {
}

push @found, [ $file, $pkg ];
}, $path ) if -d $path;
}}, $path ) if -d $path;

@found;
}
Expand All @@ -373,8 +375,6 @@ sub _caller {
return $call;
}

# Done in evals to avoid confusing Perl::MinimumVersion
eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
sub _read {
local *FH;
open( FH, '<', $_[0] ) or die "open($_[0]): $!";
Expand All @@ -383,16 +383,6 @@ sub _read {
close FH or die "close($_[0]): $!";
return $string;
}
END_NEW
sub _read {
local *FH;
open( FH, "< $_[0]" ) or die "open($_[0]): $!";
binmode FH;
my $string = do { local $/; <FH> };
close FH or die "close($_[0]): $!";
return $string;
}
END_OLD

sub _readperl {
my $string = Module::Install::_read($_[0]);
Expand All @@ -413,8 +403,6 @@ sub _readpod {
return $string;
}

# Done in evals to avoid confusing Perl::MinimumVersion
eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
sub _write {
local *FH;
open( FH, '>', $_[0] ) or die "open($_[0]): $!";
Expand All @@ -424,17 +412,6 @@ sub _write {
}
close FH or die "close($_[0]): $!";
}
END_NEW
sub _write {
local *FH;
open( FH, "> $_[0]" ) or die "open($_[0]): $!";
binmode FH;
foreach ( 1 .. $#_ ) {
print FH $_[$_] or die "print($_[0]): $!";
}
close FH or die "close($_[0]): $!";
}
END_OLD

# _version is for processing module versions (eg, 1.03_05) not
# Perl versions (eg, 5.8.1).
Expand Down
2 changes: 1 addition & 1 deletion inc/Module/Install/Base.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package Module::Install::Base;
use strict 'vars';
use vars qw{$VERSION};
BEGIN {
$VERSION = '1.16';
$VERSION = '1.21';
}

# Suspend handler for "redefined" warnings
Expand Down
13 changes: 11 additions & 2 deletions inc/Module/Install/Can.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use Module::Install::Base ();

use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.16';
$VERSION = '1.21';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
Expand Down Expand Up @@ -121,6 +121,15 @@ END_C
# Can we locate a (the) C compiler
sub can_cc {
my $self = shift;

if ($^O eq 'VMS') {
require ExtUtils::CBuilder;
my $builder = ExtUtils::CBuilder->new(
quiet => 1,
);
return $builder->have_compiler;
}

my @chunks = split(/ /, $Config::Config{cc}) or return;

# $Config{cc} may contain args; try to find out the program part
Expand Down Expand Up @@ -151,4 +160,4 @@ if ( $^O eq 'cygwin' ) {

__END__

#line 236
#line 245
2 changes: 1 addition & 1 deletion inc/Module/Install/Fetch.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Module::Install::Base ();

use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.16';
$VERSION = '1.21';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
Expand Down
2 changes: 1 addition & 1 deletion inc/Module/Install/Include.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Module::Install::Base ();

use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.16';
$VERSION = '1.21';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
Expand Down
2 changes: 1 addition & 1 deletion inc/Module/Install/Makefile.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use Fcntl qw/:flock :seek/;

use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.16';
$VERSION = '1.21';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
Expand Down
12 changes: 7 additions & 5 deletions inc/Module/Install/Metadata.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use Module::Install::Base ();

use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.16';
$VERSION = '1.21';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
Expand Down Expand Up @@ -455,12 +455,8 @@ sub author_from {
my %license_urls = (
perl => 'http://dev.perl.org/licenses/',
apache => 'http://apache.org/licenses/LICENSE-2.0',
apache_1_1 => 'http://apache.org/licenses/LICENSE-1.1',
artistic => 'http://opensource.org/licenses/artistic-license.php',
artistic_2 => 'http://opensource.org/licenses/artistic-license-2.0.php',
lgpl => 'http://opensource.org/licenses/lgpl-license.php',
lgpl2 => 'http://opensource.org/licenses/lgpl-2.1.php',
lgpl3 => 'http://opensource.org/licenses/lgpl-3.0.html',
bsd => 'http://opensource.org/licenses/bsd-license.php',
gpl => 'http://opensource.org/licenses/gpl-license.php',
gpl2 => 'http://opensource.org/licenses/gpl-2.0.php',
Expand All @@ -471,6 +467,12 @@ my %license_urls = (
unrestricted => undef,
restrictive => undef,
unknown => undef,

# these are not actually allowed in meta-spec v1.4 but are left here for compatibility:
apache_1_1 => 'http://apache.org/licenses/LICENSE-1.1',
artistic_2 => 'http://opensource.org/licenses/artistic-license-2.0.php',
lgpl2 => 'http://opensource.org/licenses/lgpl-2.1.php',
lgpl3 => 'http://opensource.org/licenses/lgpl-3.0.html',
);

sub license {
Expand Down
Loading