r77473 - in /trunk/libfile-readbackwards-perl: Changes META.yml ReadBackwards.pm debian/changelog debian/rules t/large_file.t

fabreg-guest at users.alioth.debian.org fabreg-guest at users.alioth.debian.org
Fri Jul 15 13:08:36 UTC 2011


Author: fabreg-guest
Date: Fri Jul 15 13:08:34 2011
New Revision: 77473

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=77473
Log:
Switch to standard 3 lines d/rules.

Modified:
    trunk/libfile-readbackwards-perl/Changes
    trunk/libfile-readbackwards-perl/META.yml
    trunk/libfile-readbackwards-perl/ReadBackwards.pm
    trunk/libfile-readbackwards-perl/debian/changelog
    trunk/libfile-readbackwards-perl/debian/rules
    trunk/libfile-readbackwards-perl/t/large_file.t

Modified: trunk/libfile-readbackwards-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfile-readbackwards-perl/Changes?rev=77473&op=diff
==============================================================================
--- trunk/libfile-readbackwards-perl/Changes (original)
+++ trunk/libfile-readbackwards-perl/Changes Fri Jul 15 13:08:34 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: trunk/libfile-readbackwards-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfile-readbackwards-perl/META.yml?rev=77473&op=diff
==============================================================================
--- trunk/libfile-readbackwards-perl/META.yml (original)
+++ trunk/libfile-readbackwards-perl/META.yml Fri Jul 15 13:08:34 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: trunk/libfile-readbackwards-perl/ReadBackwards.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfile-readbackwards-perl/ReadBackwards.pm?rev=77473&op=diff
==============================================================================
--- trunk/libfile-readbackwards-perl/ReadBackwards.pm (original)
+++ trunk/libfile-readbackwards-perl/ReadBackwards.pm Fri Jul 15 13:08:34 2011
@@ -9,7 +9,7 @@
 
 use vars qw( $VERSION ) ;
 
-$VERSION = '1.04' ;
+$VERSION = '1.05' ;
 
 use Symbol ;
 use Fcntl qw( :seek O_RDONLY ) ;

Modified: trunk/libfile-readbackwards-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfile-readbackwards-perl/debian/changelog?rev=77473&op=diff
==============================================================================
--- trunk/libfile-readbackwards-perl/debian/changelog (original)
+++ trunk/libfile-readbackwards-perl/debian/changelog Fri Jul 15 13:08:34 2011
@@ -19,6 +19,7 @@
   * Switch d/compat to 8.
   * Build-Depends: switch to debhelper (>= 8).
   * Switch to DEP5 license format.
+  * Switch to standard 3 lines d/rules.
 
  -- Fabrizio Regalli <fabreg at fabreg.it>  Fri, 15 Jul 2011 14:52:23 +0200
 

Modified: trunk/libfile-readbackwards-perl/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfile-readbackwards-perl/debian/rules?rev=77473&op=diff
==============================================================================
--- trunk/libfile-readbackwards-perl/debian/rules (original)
+++ trunk/libfile-readbackwards-perl/debian/rules Fri Jul 15 13:08:34 2011
@@ -1,90 +1,5 @@
 #!/usr/bin/make -f
-# This debian/rules file is provided as a template for normal perl
-# packages. It was created by Marc Brockschmidt <marc at dch-faq.de> for
-# the Debian Perl Group (http://pkg-perl.alioth.debian.org/) but may
-# be used freely wherever it is useful.
 
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
+%:
+	dh $@
 
-# If set to a true value then MakeMaker's prompt function will
-# always return the default without waiting for user input.
-export PERL_MM_USE_DEFAULT=1
-
-PACKAGE=$(shell dh_listpackages)
-
-ifndef PERL
-PERL = /usr/bin/perl
-endif
-
-TMP     =$(CURDIR)/debian/$(PACKAGE)
-
-# Allow disabling build optimation by setting noopt in
-# $DEB_BUILD_OPTIONS
-CFLAGS = -Wall -g
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-        CFLAGS += -O0
-else
-        CFLAGS += -O2
-endif
-
-build: build-stamp
-build-stamp:
-	dh_testdir
-
-	# Add commands to compile the package here
-	$(PERL) Makefile.PL INSTALLDIRS=vendor
-	$(MAKE) OPTIMIZE="$(CFLAGS)"
-
-	touch build-stamp
-
-clean:
-	dh_testdir
-	dh_testroot
-
-	# Add commands to clean up after the build process here
-	-[ ! -f Makefile ] || $(MAKE) distclean
-
-	dh_clean build-stamp install-stamp
-
-install: install-stamp
-install-stamp: build-stamp
-	dh_testdir
-	dh_testroot
-	dh_clean -k
-
-	#$(MAKE) test
-	$(MAKE) install DESTDIR=$(TMP) PREFIX=/usr
-
-	# As this is a architecture independent package, we are not supposed to install
-	# stuff to /usr/lib. MakeMaker creates the dirs, we delete them from the deb:
-	[ ! -d $(TMP)/usr/lib/perl5 ] || rmdir --ignore-fail-on-non-empty --parents --verbose $(TMP)/usr/lib/perl5
-
-	touch install-stamp
-
-binary-arch:
-# We have nothing to do by default.
-
-binary-indep: build install
-	dh_testdir
-	dh_testroot
-#	dh_installcron
-#	dh_installmenu
-#	dh_installexamples
-	dh_installdocs README
-	dh_installchangelogs Changes
-	dh_perl
-	dh_link
-	dh_strip
-	dh_compress
-	dh_fixperms
-	dh_installdeb
-	dh_gencontrol
-	dh_md5sums
-	dh_builddeb
-
-source diff:                                                                  
-	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary

Modified: trunk/libfile-readbackwards-perl/t/large_file.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfile-readbackwards-perl/t/large_file.t?rev=77473&op=diff
==============================================================================
--- trunk/libfile-readbackwards-perl/t/large_file.t (original)
+++ trunk/libfile-readbackwards-perl/t/large_file.t Fri Jul 15 13:08:34 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