r58963 - in /branches/upstream/libnet-tftp-perl/current: MANIFEST META.yml Makefile.PL TFTP.pm t/ t/00-load.t t/01-get.t t/02-new.t t/files/ t/files/directory/ t/files/directory/empty t/files/source
carnil-guest at users.alioth.debian.org
carnil-guest at users.alioth.debian.org
Sun Jun 6 13:25:51 UTC 2010
Author: carnil-guest
Date: Sun Jun 6 13:25:30 2010
New Revision: 58963
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=58963
Log:
[svn-upgrade] new version libnet-tftp-perl (0.18)
Added:
branches/upstream/libnet-tftp-perl/current/t/
branches/upstream/libnet-tftp-perl/current/t/00-load.t
branches/upstream/libnet-tftp-perl/current/t/01-get.t
branches/upstream/libnet-tftp-perl/current/t/02-new.t
branches/upstream/libnet-tftp-perl/current/t/files/
branches/upstream/libnet-tftp-perl/current/t/files/directory/
branches/upstream/libnet-tftp-perl/current/t/files/directory/empty
branches/upstream/libnet-tftp-perl/current/t/files/source
Modified:
branches/upstream/libnet-tftp-perl/current/MANIFEST
branches/upstream/libnet-tftp-perl/current/META.yml
branches/upstream/libnet-tftp-perl/current/Makefile.PL
branches/upstream/libnet-tftp-perl/current/TFTP.pm
Modified: branches/upstream/libnet-tftp-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-tftp-perl/current/MANIFEST?rev=58963&op=diff
==============================================================================
--- branches/upstream/libnet-tftp-perl/current/MANIFEST (original)
+++ branches/upstream/libnet-tftp-perl/current/MANIFEST Sun Jun 6 13:25:30 2010
@@ -4,3 +4,8 @@
README
TFTP.pm
META.yml Module meta-data (added by MakeMaker)
+t/00-load.t
+t/01-get.t
+t/02-new.t
+t/files/directory/empty
+t/files/source
Modified: branches/upstream/libnet-tftp-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-tftp-perl/current/META.yml?rev=58963&op=diff
==============================================================================
--- branches/upstream/libnet-tftp-perl/current/META.yml (original)
+++ branches/upstream/libnet-tftp-perl/current/META.yml Sun Jun 6 13:25:30 2010
@@ -1,10 +1,24 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
-name: Net-TFTP
-version: 0.17
-version_from: TFTP.pm
-installdirs: site
-requires:
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.17
+--- #YAML:1.0
+name: Net-TFTP
+version: 0.18
+abstract: ~
+author: []
+license: perl
+distribution_type: module
+configure_requires:
+ ExtUtils::MakeMaker: 0
+build_requires:
+ Test::MockModule: 0
+ Test::More: 0.8701
+ Test::Warn: 0
+requires: {}
+resources:
+ repository: http://github.com/gbarr/perl-net-tftp
+no_index:
+ directory:
+ - t
+ - inc
+generated_by: ExtUtils::MakeMaker version 6.48
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
Modified: branches/upstream/libnet-tftp-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-tftp-perl/current/Makefile.PL?rev=58963&op=diff
==============================================================================
--- branches/upstream/libnet-tftp-perl/current/Makefile.PL (original)
+++ branches/upstream/libnet-tftp-perl/current/Makefile.PL Sun Jun 6 13:25:30 2010
@@ -7,6 +7,21 @@
WriteMakefile(
VERSION_FROM => 'TFTP.pm',
NAME => 'Net::TFTP',
+ (eval { ExtUtils::MakeMaker->VERSION(6.21) } ? (LICENSE => 'perl') : ()),
+ ( eval { ExtUtils::MakeMaker->VERSION(6.46) } ? (
+ META_MERGE => {
+ resources => { ##
+ repository => 'http://github.com/gbarr/perl-net-tftp',
+ },
+ build_requires => {
+ 'Test::More' => 0.8701,
+ 'Test::MockModule' => 0,
+ 'Test::Warn' => 0,
+ },
+ }
+ )
+ : ()
+ ),
);
Modified: branches/upstream/libnet-tftp-perl/current/TFTP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-tftp-perl/current/TFTP.pm?rev=58963&op=diff
==============================================================================
--- branches/upstream/libnet-tftp-perl/current/TFTP.pm (original)
+++ branches/upstream/libnet-tftp-perl/current/TFTP.pm Sun Jun 6 13:25:30 2010
@@ -10,7 +10,7 @@
use vars qw($VERSION);
use IO::File;
-$VERSION = "0.17"; # $Id: TFTP.pm 12 2007-07-18 11:32:42Z gbarr $
+$VERSION = "0.18";
sub RRQ () { 01 } # read request
sub WRQ () { 02 } # write request
@@ -129,7 +129,11 @@
my $file = $local;
unless(ref($local)) {
- unlink($file);
+ my $retval = unlink($file);
+ if ($retval < 1) {
+ $self->{'error'} = "Can not unlink $file: $!";
+ return undef;
+ }
$local = IO::File->new($file,O_WRONLY|O_TRUNC|O_CREAT);
}
@@ -222,6 +226,11 @@
$opts->{'ascii'} = lc($opts->{'Mode'}) eq "netascii";
my $host = $opts->{'Host'};
+ do {
+ $tftp->{'error'} = "No hostname given";
+ return undef;
+ } unless defined($host);
+
## jjmb - had to make an adjustment here the logic used originally does not work well
## with IPv6.
my $port = undef;
Added: branches/upstream/libnet-tftp-perl/current/t/00-load.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-tftp-perl/current/t/00-load.t?rev=58963&op=file
==============================================================================
--- branches/upstream/libnet-tftp-perl/current/t/00-load.t (added)
+++ branches/upstream/libnet-tftp-perl/current/t/00-load.t Sun Jun 6 13:25:30 2010
@@ -1,0 +1,11 @@
+use Test::More;
+
+use_ok Net::TFTP;
+
+$tftp = Net::TFTP->new("some.host.name", BlockSize => 1024);
+isa_ok($tftp, 'Net::TFTP', 'generated object');
+
+can_ok($tftp, 'get');
+can_ok($tftp, 'put');
+
+done_testing();
Added: branches/upstream/libnet-tftp-perl/current/t/01-get.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-tftp-perl/current/t/01-get.t?rev=58963&op=file
==============================================================================
--- branches/upstream/libnet-tftp-perl/current/t/01-get.t (added)
+++ branches/upstream/libnet-tftp-perl/current/t/01-get.t Sun Jun 6 13:25:30 2010
@@ -1,0 +1,21 @@
+use Test::More;
+
+BEGIN{
+ use_ok Net::TFTP;
+}
+
+use Test::MockModule;
+my $mock_io = Test::MockModule->new('Net::TFTP::IO', no_auto => 1);
+$mock_io->mock('new',
+ sub { open (my $fh, "<", 't/files/source' ) or die "Can not open t/files/source: $!";
+ return $fh; }
+ );
+
+
+
+$tftp = Net::TFTP->new("some.host.name", BlockSize => 1024);
+my $retval = $tftp->get('somefile','t/files/directory');
+is($retval, undef, 'Error handled, no die');
+like($tftp->{error}, qr(Can not unlink t/files/directory), 'Error message');
+
+done_testing;
Added: branches/upstream/libnet-tftp-perl/current/t/02-new.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-tftp-perl/current/t/02-new.t?rev=58963&op=file
==============================================================================
--- branches/upstream/libnet-tftp-perl/current/t/02-new.t (added)
+++ branches/upstream/libnet-tftp-perl/current/t/02-new.t Sun Jun 6 13:25:30 2010
@@ -1,0 +1,13 @@
+use Test::More;
+use Test::Warn;
+
+use Net::TFTP;
+
+# we test for warnings
+$^W = 1;
+
+my $tftp = Net::TFTP->new();
+warnings_are { $tftp->get('somefile','t/files/directory') } [], 'Warnings for new' ;
+is($tftp->{error}, 'No hostname given', 'Missing hostname detected');
+
+done_testing;
Added: branches/upstream/libnet-tftp-perl/current/t/files/directory/empty
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-tftp-perl/current/t/files/directory/empty?rev=58963&op=file
==============================================================================
(empty)
Added: branches/upstream/libnet-tftp-perl/current/t/files/source
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libnet-tftp-perl/current/t/files/source?rev=58963&op=file
==============================================================================
--- branches/upstream/libnet-tftp-perl/current/t/files/source (added)
+++ branches/upstream/libnet-tftp-perl/current/t/files/source Sun Jun 6 13:25:30 2010
@@ -1,0 +1,1 @@
+source
More information about the Pkg-perl-cvs-commits
mailing list