Package: libfile-slurp-perl
Version: 9999.09-1
Severity: wishlist
Tags: patch


Dear Alexander,

While working on some new patches for File::Slurp I noticed that your
package uses quilt. That is perfectly fine, but the new standard seems to be
quilt.

To practice my skills, I've taken the time to write a patch that would
convert your package to quilt. Please find it attached.

The patch also solves:

   1. Migrate to source format 3.0 (quilt) for easier Debian content
   separation
   2. Latest standards version, make buildable with quilt
   3. New compatibility version (8 to support quilt commands in debhelper)
   4. Fix lintian warnings about ${misc:Depends}
   5. Update debian/rules to latest pkg-perl template

The package should then also be lintian clean.

Enjoy!

PS: Please find the new test files for the binmode patch at
https://rt.cpan.org/Public/Bug/Display.html?id=28491, specifically at
https://rt.cpan.org/Ticket/Attachment/844271/437139/utf8-tests.patch. Please
apply.

Best,

Allard
diff --git a/debian/changelog b/debian/changelog
index b1191c4..86193fd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,16 @@
+libfile-slurp-perl (9999.13-1.1) unstable; urgency=low
+
+  [ Allard Hoeve <all...@byte.nl> ]
+  * NMU
+  * Replace dpatch with quilt in debian/patches
+  * Migrate to source format 3.0 (quilt)
+  * Latest standards version, make buildable with quilt
+  * Replace dpatch with quilt in debian/patches
+  * New compatibility version
+  * Simplify debian/rules to the standard two-line Perl makefile
+
+ -- Allard <all...@byte.nl>  Wed, 20 Oct 2010 20:56:59 +0200
+
 libfile-slurp-perl (9999.13-1) unstable; urgency=low
 
   * New upstream release (closes: #546747)
diff --git a/debian/compat b/debian/compat
index b8626c4..45a4fb7 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-4
+8
diff --git a/debian/control b/debian/control
index c72094a..e90ab7b 100644
--- a/debian/control
+++ b/debian/control
@@ -2,13 +2,13 @@ Source: libfile-slurp-perl
 Section: perl
 Priority: optional
 Maintainer: Alexander Zangerl <a...@debian.org>
-Build-Depends: debhelper (>= 4.0.2), dpatch
+Build-Depends: debhelper (>= 8) 
 Build-Depends-Indep: perl, libtest-pod-coverage-perl, libtest-pod-perl
-Standards-Version: 3.8.3
+Standards-Version: 3.9.1
 
 Package: libfile-slurp-perl
 Architecture: all
-Depends: ${perl:Depends}
+Depends: ${perl:Depends}, ${misc:Depends}
 Homepage: http://search.cpan.org/~uri/
 Description: single call read & write file routines
  This module consists of some quickie routines that read from,
diff --git a/debian/patches/00list b/debian/patches/00list
deleted file mode 100644
index 82ef9cc..0000000
--- a/debian/patches/00list
+++ /dev/null
@@ -1,2 +0,0 @@
-01_binmode
-
diff --git a/debian/patches/01_binmode.diff b/debian/patches/01_binmode.diff
new file mode 100644
index 0000000..b8f0919
--- /dev/null
+++ b/debian/patches/01_binmode.diff
@@ -0,0 +1,85 @@
+binmode fix for multibyte-encoded data
+--- a/lib/File/Slurp.pm
++++ b/lib/File/Slurp.pm
+@@ -126,7 +126,6 @@
+ # a regular file. set the sysopen mode
+ 
+ 		my $mode = O_RDONLY ;
+-		$mode |= O_BINARY if $args{'binmode'} ;
+ 
+ #printf "RD: BINARY %x MODE %x\n", O_BINARY, $mode ;
+ 
+@@ -138,6 +137,8 @@
+ 			goto &_error ;
+ 		}
+ 
++		binmode($read_fh, $args{'binmode'}) if $args{'binmode'};
++
+ # get the size of the file for use in the read loop
+ 
+ 		$size_left = -s $read_fh ;
+@@ -284,7 +285,6 @@
+ # set the mode for the sysopen
+ 
+ 		my $mode = O_WRONLY | O_CREAT ;
+-		$mode |= O_BINARY if $args->{'binmode'} ;
+ 		$mode |= O_APPEND if $args->{'append'} ;
+ 		$mode |= O_EXCL if $args->{'no_clobber'} ;
+ 
+@@ -297,6 +297,8 @@
+ 			@_ = ( $args, "write_file '$file_name' - sysopen: $!");
+ 			goto &_error ;
+ 		}
++
++		binmode($write_fh, $args->{'binmode'}) if $args->{'binmode'};
+ 	}
+ 
+ 	sysseek( $write_fh, 0, SEEK_END ) if $args->{'append'} ;
+@@ -526,10 +528,8 @@
+ mode.
+ 
+ 	my $bin_data = read_file( $bin_file, binmode => ':raw' ) ;
+-
+-NOTE: this actually sets the O_BINARY mode flag for sysopen. It
+-probably should call binmode and pass its argument to support other
+-file modes.
++	# Or
++	my $bin_data = read_file( $bin_file, binmode => ':utf8' ) ;
+ 
+ =head3 array_ref
+ 
+@@ -628,10 +628,8 @@
+ mode.
+ 
+ 	write_file( $bin_file, {binmode => ':raw'}, @data ) ;
+-
+-NOTE: this actually sets the O_BINARY mode flag for sysopen. It
+-probably should call binmode and pass its argument to support other
+-file modes.
++	# Or
++	write_file( $bin_file, {binmode => ':utf8'}, @data ) ;
+ 
+ =head3 buf_ref
+ 
+--- /dev/null
++++ b/t/utf8.t
+@@ -0,0 +1,19 @@
++use Test::More tests => 1;
++use strict; 
++use File::Slurp;
++my $fn="/tmp/utf8.txt";
++
++my $data="hallo grüezi blödel schaß und aus.\n";
++open F,">$fn";
++binmode(F, ":utf8");
++print F $data;
++close F;
++
++my $x=read_file($fn,binmode=>":utf8");
++ok($x eq $data,"utf8 encoded data survives slurp");
++unlink($fn);
++
++
++
++
++
diff --git a/debian/patches/01_binmode.dpatch b/debian/patches/01_binmode.dpatch
deleted file mode 100644
index 9254c68..0000000
--- a/debian/patches/01_binmode.dpatch
+++ /dev/null
@@ -1,93 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 01_binmode.dpatch by  <a...@debian.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: binmode fix for multibyte-encoded data
-
-...@dpatch@
-diff -urNad File-Slurp-9999.12~/lib/File/Slurp.pm File-Slurp-9999.12/lib/File/Slurp.pm
---- File-Slurp-9999.12~/lib/File/Slurp.pm	2006-02-17 16:13:51.000000000 +1000
-+++ File-Slurp-9999.12/lib/File/Slurp.pm	2009-09-15 18:08:48.812021963 +1000
-@@ -126,7 +126,6 @@
- # a regular file. set the sysopen mode
- 
- 		my $mode = O_RDONLY ;
--		$mode |= O_BINARY if $args{'binmode'} ;
- 
- #printf "RD: BINARY %x MODE %x\n", O_BINARY, $mode ;
- 
-@@ -138,6 +137,8 @@
- 			goto &_error ;
- 		}
- 
-+		binmode($read_fh, $args{'binmode'}) if $args{'binmode'};
-+
- # get the size of the file for use in the read loop
- 
- 		$size_left = -s $read_fh ;
-@@ -284,7 +285,6 @@
- # set the mode for the sysopen
- 
- 		my $mode = O_WRONLY | O_CREAT ;
--		$mode |= O_BINARY if $args->{'binmode'} ;
- 		$mode |= O_APPEND if $args->{'append'} ;
- 		$mode |= O_EXCL if $args->{'no_clobber'} ;
- 
-@@ -297,6 +297,8 @@
- 			@_ = ( $args, "write_file '$file_name' - sysopen: $!");
- 			goto &_error ;
- 		}
-+
-+		binmode($write_fh, $args->{'binmode'}) if $args->{'binmode'};
- 	}
- 
- 	sysseek( $write_fh, 0, SEEK_END ) if $args->{'append'} ;
-@@ -526,10 +528,8 @@
- mode.
- 
- 	my $bin_data = read_file( $bin_file, binmode => ':raw' ) ;
--
--NOTE: this actually sets the O_BINARY mode flag for sysopen. It
--probably should call binmode and pass its argument to support other
--file modes.
-+	# Or
-+	my $bin_data = read_file( $bin_file, binmode => ':utf8' ) ;
- 
- =head3 array_ref
- 
-@@ -628,10 +628,8 @@
- mode.
- 
- 	write_file( $bin_file, {binmode => ':raw'}, @data ) ;
--
--NOTE: this actually sets the O_BINARY mode flag for sysopen. It
--probably should call binmode and pass its argument to support other
--file modes.
-+	# Or
-+	write_file( $bin_file, {binmode => ':utf8'}, @data ) ;
- 
- =head3 buf_ref
- 
-diff -urNad File-Slurp-9999.12~/t/utf8.t File-Slurp-9999.12/t/utf8.t
---- File-Slurp-9999.12~/t/utf8.t	1970-01-01 10:00:00.000000000 +1000
-+++ File-Slurp-9999.12/t/utf8.t	2009-09-15 18:08:55.819972627 +1000
-@@ -0,0 +1,19 @@
-+use Test::More tests => 1;
-+use strict; 
-+use File::Slurp;
-+my $fn="/tmp/utf8.txt";
-+
-+my $data="hallo grüezi blödel schaß und aus.\n";
-+open F,">$fn";
-+binmode(F, ":utf8");
-+print F $data;
-+close F;
-+
-+my $x=read_file($fn,binmode=>":utf8");
-+ok($x eq $data,"utf8 encoded data survives slurp");
-+unlink($fn);
-+
-+
-+
-+
-+
diff --git a/debian/patches/01_picky_test.diff b/debian/patches/01_picky_test.diff
new file mode 100644
index 0000000..bd94911
--- /dev/null
+++ b/debian/patches/01_picky_test.diff
@@ -0,0 +1,61 @@
+make picky test::xx happy by giving exact plans
+diff -urNad libfile-slurp-perl-9999.12~/t/error.t libfile-slurp-perl-9999.12/t/error.t
+--- libfile-slurp-perl-9999.12~/t/error.t	2009-09-15 17:59:42.000000000 +1000
++++ libfile-slurp-perl-9999.12/t/error.t	2009-09-15 17:59:42.798228715 +1000
+@@ -14,7 +14,7 @@
+ my $file = 'missing/file' ;
+ unlink $file ;
+ 
+-plan tests => 9 ;
++plan tests => 10 ;
+ 
+ my %modes = (
+ 	'croak' => \&test_croak,
+diff -urNad libfile-slurp-perl-9999.12~/t/handle.t libfile-slurp-perl-9999.12/t/handle.t
+--- libfile-slurp-perl-9999.12~/t/handle.t	2009-09-15 17:59:42.000000000 +1000
++++ libfile-slurp-perl-9999.12/t/handle.t	2009-09-15 17:59:42.798228715 +1000
+@@ -22,7 +22,7 @@
+ ) ;
+ 
+ #plan( tests => 2 + @pipe_data ) ;
+-plan( tests => scalar @pipe_data ) ;
++plan( tests => 1+scalar @pipe_data ) ;
+ 
+ 
+ BEGIN{ 
+diff -urNad libfile-slurp-perl-9999.12~/t/large.t libfile-slurp-perl-9999.12/t/large.t
+--- libfile-slurp-perl-9999.12~/t/large.t	2009-09-15 17:59:42.000000000 +1000
++++ libfile-slurp-perl-9999.12/t/large.t	2009-09-15 17:59:42.798228715 +1000
+@@ -44,7 +44,7 @@
+ 	push @bin_data, $data ;
+ }
+ 
+-plan( tests => 16 * @text_data + 8 * @bin_data ) ;
++plan( tests => 1+16 * @text_data + 8 * @bin_data ) ;
+ 
+ #print "# text slurp\n" ;
+ 
+diff -urNad libfile-slurp-perl-9999.12~/t/paragraph.t libfile-slurp-perl-9999.12/t/paragraph.t
+--- libfile-slurp-perl-9999.12~/t/paragraph.t	2004-09-18 14:58:53.000000000 +1000
++++ libfile-slurp-perl-9999.12/t/paragraph.t	2009-09-15 18:00:05.390531627 +1000
+@@ -23,7 +23,7 @@
+ 	[],
+ ) ;
+ 
+-plan( tests => 3 * @text_data ) ;
++plan( tests => 1+3 * @text_data ) ;
+ 
+ #print "# text slurp\n" ;
+ 
+diff -urNad libfile-slurp-perl-9999.12~/t/pseudo.t libfile-slurp-perl-9999.12/t/pseudo.t
+--- libfile-slurp-perl-9999.12~/t/pseudo.t	2005-01-25 16:16:45.000000000 +1000
++++ libfile-slurp-perl-9999.12/t/pseudo.t	2009-09-15 17:59:56.822426802 +1000
+@@ -5,7 +5,7 @@
+ use Carp ;
+ use Test::More ;
+ 
+-plan( tests => 1 ) ; 
++plan( tests => 2 ) ; 
+ 
+ my $proc_file = "/proc/$$/auxv" ;
+ 
diff --git a/debian/patches/01_picky_test.dpatch b/debian/patches/01_picky_test.dpatch
deleted file mode 100644
index aa34ce8..0000000
--- a/debian/patches/01_picky_test.dpatch
+++ /dev/null
@@ -1,67 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 01_picky_test.dpatch by  <a...@debian.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: make picky test::xx happy by giving exact plans
-
-...@dpatch@
-diff -urNad libfile-slurp-perl-9999.12~/t/error.t libfile-slurp-perl-9999.12/t/error.t
---- libfile-slurp-perl-9999.12~/t/error.t	2009-09-15 17:59:42.000000000 +1000
-+++ libfile-slurp-perl-9999.12/t/error.t	2009-09-15 17:59:42.798228715 +1000
-@@ -14,7 +14,7 @@
- my $file = 'missing/file' ;
- unlink $file ;
- 
--plan tests => 9 ;
-+plan tests => 10 ;
- 
- my %modes = (
- 	'croak' => \&test_croak,
-diff -urNad libfile-slurp-perl-9999.12~/t/handle.t libfile-slurp-perl-9999.12/t/handle.t
---- libfile-slurp-perl-9999.12~/t/handle.t	2009-09-15 17:59:42.000000000 +1000
-+++ libfile-slurp-perl-9999.12/t/handle.t	2009-09-15 17:59:42.798228715 +1000
-@@ -22,7 +22,7 @@
- ) ;
- 
- #plan( tests => 2 + @pipe_data ) ;
--plan( tests => scalar @pipe_data ) ;
-+plan( tests => 1+scalar @pipe_data ) ;
- 
- 
- BEGIN{ 
-diff -urNad libfile-slurp-perl-9999.12~/t/large.t libfile-slurp-perl-9999.12/t/large.t
---- libfile-slurp-perl-9999.12~/t/large.t	2009-09-15 17:59:42.000000000 +1000
-+++ libfile-slurp-perl-9999.12/t/large.t	2009-09-15 17:59:42.798228715 +1000
-@@ -44,7 +44,7 @@
- 	push @bin_data, $data ;
- }
- 
--plan( tests => 16 * @text_data + 8 * @bin_data ) ;
-+plan( tests => 1+16 * @text_data + 8 * @bin_data ) ;
- 
- #print "# text slurp\n" ;
- 
-diff -urNad libfile-slurp-perl-9999.12~/t/paragraph.t libfile-slurp-perl-9999.12/t/paragraph.t
---- libfile-slurp-perl-9999.12~/t/paragraph.t	2004-09-18 14:58:53.000000000 +1000
-+++ libfile-slurp-perl-9999.12/t/paragraph.t	2009-09-15 18:00:05.390531627 +1000
-@@ -23,7 +23,7 @@
- 	[],
- ) ;
- 
--plan( tests => 3 * @text_data ) ;
-+plan( tests => 1+3 * @text_data ) ;
- 
- #print "# text slurp\n" ;
- 
-diff -urNad libfile-slurp-perl-9999.12~/t/pseudo.t libfile-slurp-perl-9999.12/t/pseudo.t
---- libfile-slurp-perl-9999.12~/t/pseudo.t	2005-01-25 16:16:45.000000000 +1000
-+++ libfile-slurp-perl-9999.12/t/pseudo.t	2009-09-15 17:59:56.822426802 +1000
-@@ -5,7 +5,7 @@
- use Carp ;
- use Test::More ;
- 
--plan( tests => 1 ) ; 
-+plan( tests => 2 ) ; 
- 
- my $proc_file = "/proc/$$/auxv" ;
- 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..0559a12
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+01_binmode.diff
diff --git a/debian/rules b/debian/rules
index 9a383c4..2d33f6a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,51 +1,4 @@
 #!/usr/bin/make -f
-# Sample debian/rules that uses debhelper.
-# GNU copyright 1997 to 1999 by Joey Hess.
 
-# to get the patch application targets
-include /usr/share/dpatch/dpatch.make
-
-configure: Makefile
-Makefile: Makefile.PL
-	dh_testdir
-	perl Makefile.PL INSTALLDIRS=vendor	
-
-build: build-stamp
-
-build-stamp: patch configure
-	dh_testdir
-	$(MAKE) OPTIMIZE="-O2 -g -Wall"
-	touch build-stamp
-
-clean: unpatch
-	dh_testdir
-	dh_testroot
-	rm -f build-stamp
-	 [ ! -f Makefile ] || $(MAKE) distclean
-	rm -f Makefile Makefile.old
-	dh_clean
-
-# Build architecture-independent files here.
-binary-indep: build
-	dh_testdir
-	dh_testroot
-	dh_clean
-	dh_installdirs
-	$(MAKE) test
-	$(MAKE) install DESTDIR=$(CURDIR)/debian/libfile-slurp-perl/
-	dh_install
-	dh_installdocs -n
-	dh_installchangelogs
-	dh_compress
-	dh_fixperms
-	dh_installdeb
-	dh_perl
-	dh_gencontrol
-	dh_md5sums
-	dh_builddeb
-
-# Build architecture-dependent files here.
-binary-arch: build
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary configure
+%:
+	dh $@
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)

Reply via email to