r77470 - in /branches/upstream/libfile-readbackwards-perl/current: Changes META.yml ReadBackwards.pm t/large_file.t
fabreg-guest at users.alioth.debian.org
fabreg-guest at users.alioth.debian.org
Fri Jul 15 12:52:08 UTC 2011
Author: fabreg-guest
Date: Fri Jul 15 12:52:06 2011
New Revision: 77470
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=77470
Log:
[svn-upgrade] new version libfile-readbackwards-perl (1.05)
Modified:
branches/upstream/libfile-readbackwards-perl/current/Changes
branches/upstream/libfile-readbackwards-perl/current/META.yml
branches/upstream/libfile-readbackwards-perl/current/ReadBackwards.pm
branches/upstream/libfile-readbackwards-perl/current/t/large_file.t
Modified: branches/upstream/libfile-readbackwards-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libfile-readbackwards-perl/current/Changes?rev=77470&op=diff
==============================================================================
--- branches/upstream/libfile-readbackwards-perl/current/Changes (original)
+++ branches/upstream/libfile-readbackwards-perl/current/Changes Fri Jul 15 12:52:06 2011
@@ -1,19 +1,67 @@
Revision history for Perl extension File::ReadBackwards.
-0.90 Mon Feb 28 21:37:29 2000
- - original version; created by h2xs 1.19
+1.05 Sat Jun 4 02:24:35 EDT 2011
+ reordered Changes to be recent at the top
+ rewritten t/large_file.t to skip non-sparse file systems
+ code borrowed from lfs.t in newer perl
+ - coding done by Robert Buels
-0.91 fixed test suite
+1.04 Thu May 5 01:10:44 EDT 2005
-0.92 edited documentation
+ added getline method and tests for it
+ - Slaven Rezic <srezic at iconmobile.net>
+ added support and test for large files (>2GB)
+ - Slaven Rezic <srezic at iconmobile.net>
-0.93 Tue Mar 7 23:31:40 EST 2000
- removed use of qr// so it works under MacPerl
- added README
- edited documentation
+1.03 Mon Jan 24 17:57:54 EST 2005
-0.94 Wed Mar 8 00:12:28 EST 2000
- removed use of for modifier so it works under MacPerl
+ added get_handle method and tests for it.
+ - Mark-Jason Dominus
+
+1.02 Fri Nov 21 01:53:42 EST 2003
+
+ fixed test problems with cr/lf files.
+ modified module to better handle them and when the rec_sep is set
+ all tests now work on unix and windows
+
+
+1.01 Tue Oct 7 01:31:40 EDT 2003 (not released to cpan)
+
+ fixed bug in test script in close_test. the write_file fails on
+ winblows since the file is still open from the main loop. now the
+ file is closed explicitly and tests added to cover that.
+ - Peter J. Acklam <pjacklam at online.no>
+
+1.00 Mon Aug 18 02:04:24 EDT 2003
+
+ fixed doc bug for the tied interface. the module name needs quotes
+ - from Madeleine Price <mad at ugcs.caltech.edu>
+
+ added support for the tell method (including tests)
+ - Slaven Rezic <srezic at iconmobile.net>
+
+0.99 Tue Dec 3 00:50:23 EST 2002
+
+ fixed bug where readline returns data after a close
+ - from Khamdy <xayaraj at speedfactory.net>
+
+0.98 Wed Aug 21 22:51:41 EDT 2002
+
+ fixed bug with a partial buffer of '0'.
+ - from Joe Schaefer <joe+usenet at sunstarsys.com>
+
+0.97 Sun May 26 00:28:49 EDT 2002
+
+ D'oh! call CORE::close inside close(). robin had it correct
+ in his patch and i didn't use that.
+
+0.96 Sun May 26 00:28:49 EDT 2002
+
+ fixed bug in close method and added test for close
+ - from Robin Houston <robin at kitsite.com>
+
+
+
0.95 Fri Apr 26 13:48:40 EDT 2002
readline returns undef on a sysseek error so it fails cleanly on pipes
@@ -33,57 +81,17 @@
updated pod to reflect the changes
-0.96 Sun May 26 00:28:49 EDT 2002
+0.94 Wed Mar 8 00:12:28 EST 2000
+ removed use of for modifier so it works under MacPerl
- fixed bug in close method and added test for close
- - from Robin Houston <robin at kitsite.com>
+0.93 Tue Mar 7 23:31:40 EST 2000
+ removed use of qr// so it works under MacPerl
+ added README
+ edited documentation
-0.97 Sun May 26 00:28:49 EDT 2002
+0.92 edited documentation
- D'oh! call CORE::close inside close(). robin had it correct
- in his patch and i didn't use that.
+0.91 fixed test suite
-0.98 Wed Aug 21 22:51:41 EDT 2002
-
- fixed bug with a partial buffer of '0'.
- - from Joe Schaefer <joe+usenet at sunstarsys.com>
-
-0.99 Tue Dec 3 00:50:23 EST 2002
-
- fixed bug where readline returns data after a close
- - from Khamdy <xayaraj at speedfactory.net>
-
-1.00 Mon Aug 18 02:04:24 EDT 2003
-
- fixed doc bug for the tied interface. the module name needs quotes
- - from Madeleine Price <mad at ugcs.caltech.edu>
-
- added support for the tell method (including tests)
- - Slaven Rezic <srezic at iconmobile.net>
-
-1.01 Tue Oct 7 01:31:40 EDT 2003 (not released to cpan)
-
- fixed bug in test script in close_test. the write_file fails on
- winblows since the file is still open from the main loop. now the
- file is closed explicitly and tests added to cover that.
- - Peter J. Acklam <pjacklam at online.no>
-
-1.02 Fri Nov 21 01:53:42 EST 2003
-
- fixed test problems with cr/lf files.
- modified module to better handle them and when the rec_sep is set
- all tests now work on unix and windows
-
-1.03 Mon Jan 24 17:57:54 EST 2005
-
- added get_handle method and tests for it.
- - Mark-Jason Dominus
-
-1.04 Thu May 5 01:10:44 EDT 2005
-
- added getline method and tests for it
- - Slaven Rezic <srezic at iconmobile.net>
- added support and test for large files (>2GB)
- - Slaven Rezic <srezic at iconmobile.net>
-
-
+0.90 Mon Feb 28 21:37:29 2000
+ - original version; created by h2xs 1.19
Modified: branches/upstream/libfile-readbackwards-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libfile-readbackwards-perl/current/META.yml?rev=77470&op=diff
==============================================================================
--- branches/upstream/libfile-readbackwards-perl/current/META.yml (original)
+++ branches/upstream/libfile-readbackwards-perl/current/META.yml Fri Jul 15 12:52:06 2011
@@ -1,10 +1,12 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
-name: File-ReadBackwards
-version: 1.04
-version_from: ReadBackwards.pm
-installdirs: site
-requires:
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.17
+--- #YAML:1.0
+name: File-ReadBackwards
+version: 1.05
+abstract: ~
+license: ~
+author: ~
+generated_by: ExtUtils::MakeMaker version 6.42
+distribution_type: module
+requires:
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.3.html
+ version: 1.3
Modified: branches/upstream/libfile-readbackwards-perl/current/ReadBackwards.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libfile-readbackwards-perl/current/ReadBackwards.pm?rev=77470&op=diff
==============================================================================
--- branches/upstream/libfile-readbackwards-perl/current/ReadBackwards.pm (original)
+++ branches/upstream/libfile-readbackwards-perl/current/ReadBackwards.pm Fri Jul 15 12:52:06 2011
@@ -9,7 +9,7 @@
use vars qw( $VERSION ) ;
-$VERSION = '1.04' ;
+$VERSION = '1.05' ;
use Symbol ;
use Fcntl qw( :seek O_RDONLY ) ;
Modified: branches/upstream/libfile-readbackwards-perl/current/t/large_file.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libfile-readbackwards-perl/current/t/large_file.t?rev=77470&op=diff
==============================================================================
--- branches/upstream/libfile-readbackwards-perl/current/t/large_file.t (original)
+++ branches/upstream/libfile-readbackwards-perl/current/t/large_file.t Fri Jul 15 12:52:06 2011
@@ -5,15 +5,13 @@
use Carp ;
use Config ;
use Fcntl qw( :seek ) ;
+use File::Temp qw( tempfile );
use Test::More ;
use File::ReadBackwards ;
# NOTE: much of this code was taken from the core perl test script
# ops/lfs.t. it was modified to test File::ReadBackwards and large files
-
-my %has_no_sparse_files = map { $_ => 1 }
- qw( MSWin32 NetWare VMS unicos ) ;
my $test_file = 'bw.data' ;
@@ -42,8 +40,8 @@
skip_all_tests( "no large file support\n" ) ;
}
-if ( $has_no_sparse_files{ $^O } ) {
- skip_all_tests( "no sparse files in $^O\n" ) ;
+unless ( have_sparse_files() ) {
+ skip_all_tests( "no sparse file support\n" ) ;
}
# run the long seek code below in a subprocess in case it exits with a
@@ -105,3 +103,71 @@
unlink $test_file ;
exit ;
+
+
+######## subroutines
+
+# this is lifted wholesale from t/op/lfs.t in perl. Also, Uri is the
+# wind beneath my wings.
+sub have_sparse_files {
+
+ # don't even try for spare files on some OSs
+ return 0 if {
+ map { $_ => 1 } qw( MSWin32 NetWare VMS unicos )
+ }->{ $^O };
+ # take that, readability.
+
+ my (undef,$big0) = tempfile();
+ my (undef,$big1) = tempfile();
+ my (undef,$big2) = tempfile();
+
+ # We'll start off by creating a one megabyte file which has
+ # only three "true" bytes. If we have sparseness, we should
+ # consume less blocks than one megabyte (assuming nobody has
+ # one megabyte blocks...)
+
+ open(BIG, ">$big1") or
+ die "open $big1 failed: $!";
+ binmode(BIG) or
+ die "binmode $big1 failed: $!";
+ seek(BIG, 1_000_000, SEEK_SET) or
+ die "seek $big1 failed: $!";
+ print BIG "big" or
+ die "print $big1 failed: $!";
+ close(BIG) or
+ die "close $big1 failed: $!";
+
+ my @s1 = stat($big1);
+
+ # diag "s1 = @s1";
+
+ open(BIG, ">$big2") or
+ die "open $big2 failed: $!";
+ binmode(BIG) or
+ die "binmode $big2 failed: $!";
+ seek(BIG, 2_000_000, SEEK_SET) or
+ die "seek $big2 failed: $!";
+ print BIG "big" or
+ die "print $big2 failed: $!";
+ close(BIG) or
+ die "close $big2 failed: $!";
+
+ my @s2 = stat($big2);
+
+# diag "s2 = @s2";
+
+ unless (
+ $s1[7] == 1_000_003 && $s2[7] == 2_000_003 &&
+ $s1[11] == $s2[11] && $s1[12] == $s2[12] &&
+ $s1[12] > 0 ) {
+# diag 'no sparse files. sad face.';
+ return 0;
+ }
+
+# diag 'we seem to have sparse files...';
+
+ return 1 ;
+}
+
+
+
More information about the Pkg-perl-cvs-commits
mailing list