r21731 - in /trunk/libarchive-ar-perl/debian: changelog control patches/ patches/pad-2-byte-read.patch patches/pad-2-byte-write.patch patches/series rules

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Mon Jun 16 16:49:05 UTC 2008


Author: gregoa
Date: Mon Jun 16 16:49:05 2008
New Revision: 21731

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=21731
Log:
Add patches pad-2-byte-{read,write}.patch to respect the 2-byte alignment
requirement of the Ar file format (closes: #419101); add quilt framework;
thanks to Magnus Holmgren for the bug report and the patch.

Added:
    trunk/libarchive-ar-perl/debian/patches/
    trunk/libarchive-ar-perl/debian/patches/pad-2-byte-read.patch
    trunk/libarchive-ar-perl/debian/patches/pad-2-byte-write.patch
    trunk/libarchive-ar-perl/debian/patches/series
Modified:
    trunk/libarchive-ar-perl/debian/changelog
    trunk/libarchive-ar-perl/debian/control
    trunk/libarchive-ar-perl/debian/rules

Modified: trunk/libarchive-ar-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarchive-ar-perl/debian/changelog?rev=21731&op=diff
==============================================================================
--- trunk/libarchive-ar-perl/debian/changelog (original)
+++ trunk/libarchive-ar-perl/debian/changelog Mon Jun 16 16:49:05 2008
@@ -9,6 +9,9 @@
     <rafl at debian.org>); Florian Ragwitz <rafl at debian.org> moved to
     Uploaders.
   * Add debian/watch.
+  * Add patches pad-2-byte-{read,write}.patch to respect the 2-byte alignment
+    requirement of the Ar file format (closes: #419101); add quilt framework;
+    thanks to Magnus Holmgren for the bug report and the patch.
 
  -- gregor herrmann <gregoa at debian.org>  Sun, 15 Jun 2008 15:11:17 +0200
 

Modified: trunk/libarchive-ar-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarchive-ar-perl/debian/control?rev=21731&op=diff
==============================================================================
--- trunk/libarchive-ar-perl/debian/control (original)
+++ trunk/libarchive-ar-perl/debian/control Mon Jun 16 16:49:05 2008
@@ -1,7 +1,7 @@
 Source: libarchive-ar-perl
 Section: perl
 Priority: optional
-Build-Depends: debhelper (>= 4.0.2)
+Build-Depends: debhelper (>= 4.0.2), quilt (>= 0.40)
 Build-Depends-Indep: perl (>= 5.8.0-7), libtest-mockobject-perl
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
 Uploaders: Florian Ragwitz <rafl at debian.org>

Added: trunk/libarchive-ar-perl/debian/patches/pad-2-byte-read.patch
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarchive-ar-perl/debian/patches/pad-2-byte-read.patch?rev=21731&op=file
==============================================================================
--- trunk/libarchive-ar-perl/debian/patches/pad-2-byte-read.patch (added)
+++ trunk/libarchive-ar-perl/debian/patches/pad-2-byte-read.patch Mon Jun 16 16:49:05 2008
@@ -1,0 +1,23 @@
+Author: Magnus Holmgren <holmgren at lysator.liu.se>
+Description: respect 2-byte alignment when reading
+Bug: #419101
+
+--- libarchive-ar-perl.orig/lib/Archive/Ar.pm
++++ libarchive-ar-perl/lib/Archive/Ar.pm
+@@ -319,7 +319,7 @@
+ 	while($scratchdata =~ /\S/)
+ 	{
+ 
+-		if($scratchdata =~ s/^(.{58})`\n//m)		
++		if($scratchdata =~ s/^(.{58})`\n//s)
+ 		{
+ 			my @fields = unpack("A16A12A6A6A8A10", $1);
+ 
+@@ -333,6 +333,7 @@
+ 			@$headers{qw/name date uid gid mode size/} = @fields;
+ 
+ 			$headers->{data} = substr($scratchdata, 0, $headers->{size}, "");
++			substr($scratchdata, 0, $headers->{size} % 2, "");
+ 
+ 			$this->_addFile($headers);
+ 		}else{

Added: trunk/libarchive-ar-perl/debian/patches/pad-2-byte-write.patch
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarchive-ar-perl/debian/patches/pad-2-byte-write.patch?rev=21731&op=file
==============================================================================
--- trunk/libarchive-ar-perl/debian/patches/pad-2-byte-write.patch (added)
+++ trunk/libarchive-ar-perl/debian/patches/pad-2-byte-write.patch Mon Jun 16 16:49:05 2008
@@ -1,0 +1,48 @@
+Author: DDICK <DDICK [...] cpan.org>
+Description: pad the file contents to an even number when writing
+Bugs: #419101 and http://rt.cpan.org/Public/Bug/Display.html?id=18383
+(Patch taken from CPAN)
+
+--- libarchive-ar-perl.orig/lib/Archive/Ar.pm
++++ libarchive-ar-perl/lib/Archive/Ar.pm
+@@ -252,10 +252,14 @@
+ 
+ 		$content->{uid} ||= "";
+ 		$content->{gid} ||= "";
+-
+ 		$outstr.= pack("A16A12A6A6A8A10", @$content{qw/name date uid gid mode size/});
+ 		$outstr.= ARFMAG;
+ 		$outstr.= $content->{data};
++		unless (((length($content->{data})) % 2) == 0) {
++			# Padding to make up an even number of bytes
++			# as described in http://en.wikipedia.org/wiki/Ar_(file_format)
++			$outstr.= "\n";
++		}
+ 	}
+ 
+ 	return $outstr unless $filename;
+--- /dev/null
++++ libarchive-ar-perl/t/30write.t
+@@ -0,0 +1,22 @@
++#!/usr/bin/perl -w
++
++use Test::More (tests => 2);
++use strict;
++
++BEGIN {
++        chdir 't' if -d 't';
++        use lib '../blib/lib', 'lib/', '..';
++}
++
++use Archive::Ar();
++
++my ($padding_archive) = new Archive::Ar();
++$padding_archive->add_data("test.txt", "here\n");
++my ($archive_results) = $padding_archive->write();
++ok(length($archive_results) == 74, "Archive::Ar pads un-even number of bytes successfully\n");
++$padding_archive = new Archive::Ar();
++$padding_archive->add_data("test.txt", "here1\n");
++$archive_results = $padding_archive->write();
++ok(length($archive_results) == 74, "Archive::Ar pads even number of bytes successfully\n");
++
++unlink 'test.txt' if -f 'test.txt';

Added: trunk/libarchive-ar-perl/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarchive-ar-perl/debian/patches/series?rev=21731&op=file
==============================================================================
--- trunk/libarchive-ar-perl/debian/patches/series (added)
+++ trunk/libarchive-ar-perl/debian/patches/series Mon Jun 16 16:49:05 2008
@@ -1,0 +1,2 @@
+pad-2-byte-read.patch
+pad-2-byte-write.patch

Modified: trunk/libarchive-ar-perl/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarchive-ar-perl/debian/rules?rev=21731&op=diff
==============================================================================
--- trunk/libarchive-ar-perl/debian/rules (original)
+++ trunk/libarchive-ar-perl/debian/rules Mon Jun 16 16:49:05 2008
@@ -10,14 +10,16 @@
 
 TMP     =$(CURDIR)/debian/$(PACKAGE)
 
+include /usr/share/quilt/quilt.make
+
 build: build-stamp
-build-stamp:
+build-stamp: $(QUILT_STAMPFN)
 	dh_testdir
 	$(PERL) Makefile.PL INSTALLDIRS=vendor
 	$(MAKE) OPTIMIZE="-Wall -O2 -g"
 	touch build-stamp
 
-clean:
+clean: unpatch
 	dh_testdir
 	dh_testroot
 	[ ! -f Makefile ] || $(MAKE) realclean




More information about the Pkg-perl-cvs-commits mailing list