r46316 - in /trunk/libarchive-ar-perl: CHANGES MANIFEST META.yml Makefile.PL debian/changelog debian/watch lib/Archive/Ar.pm t/10objects.t t/20new.t t/30write.t t/40mode.t

carnil-guest at users.alioth.debian.org carnil-guest at users.alioth.debian.org
Sat Oct 24 15:05:10 UTC 2009


Author: carnil-guest
Date: Sat Oct 24 15:04:58 2009
New Revision: 46316

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=46316
Log:
* New upstream release
  - Fix list_files to return a list in list context, to match doc.
  - Pad odd-size archives to an even number of bytes.
  - Fixed broken file perms (decimal mode stored as octal string)
    (Closes: #523515)
* Fix debian/watch file to match also upstram version with no trailing
  letter in version number. 

Added:
    trunk/libarchive-ar-perl/META.yml
      - copied unchanged from r46314, branches/upstream/libarchive-ar-perl/current/META.yml
    trunk/libarchive-ar-perl/t/30write.t
      - copied unchanged from r46314, branches/upstream/libarchive-ar-perl/current/t/30write.t
    trunk/libarchive-ar-perl/t/40mode.t
      - copied unchanged from r46314, branches/upstream/libarchive-ar-perl/current/t/40mode.t
Modified:
    trunk/libarchive-ar-perl/CHANGES
    trunk/libarchive-ar-perl/MANIFEST
    trunk/libarchive-ar-perl/Makefile.PL
    trunk/libarchive-ar-perl/debian/changelog
    trunk/libarchive-ar-perl/debian/watch
    trunk/libarchive-ar-perl/lib/Archive/Ar.pm
    trunk/libarchive-ar-perl/t/10objects.t
    trunk/libarchive-ar-perl/t/20new.t

Modified: trunk/libarchive-ar-perl/CHANGES
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarchive-ar-perl/CHANGES?rev=46316&op=diff
==============================================================================
--- trunk/libarchive-ar-perl/CHANGES (original)
+++ trunk/libarchive-ar-perl/CHANGES Sat Oct 24 15:04:58 2009
@@ -1,3 +1,18 @@
+Version 1.14 - October 14, 2009 - John Bazik <jbazik at cpan.org>
+
+	* Fix list_files to return a list in list context, to match doc.
+
+	* Fixed improper use of /m modifier in anchored match.
+
+	* Pad odd-size archives to an even number of bytes.
+	  Closes RT #18383 (thanks to David Dick).
+
+	* Fixed broken file perms (decimal mode stored as octal string).
+	  Closes RT #49987 (thanks to Stephen Gran - debian bug #523515).
+
+	* Added tests for padding and permission fixes.  Dropped
+	  unnecessary BEGIN clauses from some tests.
+
 Version 1.13b - May 7th, 2003
 
 Fixes to the Makefile.PL file. Ar.pm wasn't being put into /blib

Modified: trunk/libarchive-ar-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarchive-ar-perl/MANIFEST?rev=46316&op=diff
==============================================================================
--- trunk/libarchive-ar-perl/MANIFEST (original)
+++ trunk/libarchive-ar-perl/MANIFEST Sat Oct 24 15:04:58 2009
@@ -1,6 +1,9 @@
+CHANGES
 lib/Archive/Ar.pm
 Makefile.PL
+MANIFEST			This list of files
 t/10objects.t
 t/20new.t
-MANIFEST
-CHANGES
+t/30write.t
+t/40mode.t
+META.yml                                 Module meta-data (added by MakeMaker)

Modified: trunk/libarchive-ar-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarchive-ar-perl/Makefile.PL?rev=46316&op=diff
==============================================================================
--- trunk/libarchive-ar-perl/Makefile.PL (original)
+++ trunk/libarchive-ar-perl/Makefile.PL Sat Oct 24 15:04:58 2009
@@ -9,6 +9,7 @@
 			'File::Spec' => '0.83',
 			'Time::Local' => '1.04',
 			'Test::MockObject' => '0.12',
+			'File::Temp' => '0',
 		},
 
 	'dist'		=> 

Modified: trunk/libarchive-ar-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarchive-ar-perl/debian/changelog?rev=46316&op=diff
==============================================================================
--- trunk/libarchive-ar-perl/debian/changelog (original)
+++ trunk/libarchive-ar-perl/debian/changelog Sat Oct 24 15:04:58 2009
@@ -1,4 +1,4 @@
-libarchive-ar-perl (1.13b-3) UNRELEASED; urgency=low
+libarchive-ar-perl (1.14-1) UNRELEASED; urgency=low
 
   [ gregor herrmann ]
   * debian/control: Changed: Switched Vcs-Browser field to ViewSVN
@@ -9,7 +9,16 @@
   [ Nathan Handler ]
   * debian/watch: Update to ignore development releases.
 
- -- gregor herrmann <gregoa at debian.org>  Sun, 16 Nov 2008 20:39:31 +0100
+  [ Salvatore Bonaccorso ]
+  * New upstream release
+    - Fix list_files to return a list in list context, to match doc.
+    - Pad odd-size archives to an even number of bytes.
+    - Fixed broken file perms (decimal mode stored as octal string)
+      (Closes: #523515)
+  * Fix debian/watch file to match also upstram version with no trailing
+    letter in version number. 
+
+ -- Salvatore Bonaccorso <salvatore.bonaccorso at gmail.com>  Sat, 24 Oct 2009 16:58:55 +0200
 
 libarchive-ar-perl (1.13b-2) unstable; urgency=low
 

Modified: trunk/libarchive-ar-perl/debian/watch
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarchive-ar-perl/debian/watch?rev=46316&op=diff
==============================================================================
--- trunk/libarchive-ar-perl/debian/watch (original)
+++ trunk/libarchive-ar-perl/debian/watch Sat Oct 24 15:04:58 2009
@@ -1,2 +1,2 @@
 version=3
-http://search.cpan.org/dist/Archive-Ar/  .+/Archive-Ar-v?(\d[\d.-]+[a-z])\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$
+http://search.cpan.org/dist/Archive-Ar/  .+/Archive-Ar-v?(\d[\d.-]+[a-z]?)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$

Modified: trunk/libarchive-ar-perl/lib/Archive/Ar.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarchive-ar-perl/lib/Archive/Ar.pm?rev=46316&op=diff
==============================================================================
--- trunk/libarchive-ar-perl/lib/Archive/Ar.pm (original)
+++ trunk/libarchive-ar-perl/lib/Archive/Ar.pm Sat Oct 24 15:04:58 2009
@@ -14,7 +14,7 @@
 use Time::Local;
 
 use vars qw($VERSION);
-$VERSION = '1.13b';
+$VERSION = '1.14';
 
 use constant ARMAG => "!<arch>\n";
 use constant SARMAG => length(ARMAG);
@@ -135,7 +135,7 @@
 {
 	my($this) = @_;
 
-	return \@{$this->{_files}};
+	return wantarray ? @{$this->{_files}} : $this->{_files};
 
 }
 
@@ -219,7 +219,7 @@
 	$params->{uid} ||= 0;
 	$params->{gid} ||= 0;
 	$params->{date} ||= timelocal(localtime());
-	$params->{mode} ||= "100644";
+	$params->{mode} ||= 0100644;
 	
 	unless($this->_addFile($params))
 	{
@@ -252,10 +252,16 @@
 
 		$content->{uid} ||= "";
 		$content->{gid} ||= "";
-
-		$outstr.= pack("A16A12A6A6A8A10", @$content{qw/name date uid gid mode size/});
+		$outstr.= pack("A16A12A6A6A8A10",
+			@$content{qw/name date uid gid/},
+			sprintf('%o', $content->{mode}),  # octal!
+			$content->{size});
 		$outstr.= ARFMAG;
 		$outstr.= $content->{data};
+		unless (((length($content->{data})) % 2) == 0) {
+			# Padding to make up an even number of bytes
+			$outstr.= "\n";
+		}
 	}
 
 	return $outstr unless $filename;
@@ -319,20 +325,21 @@
 	while($scratchdata =~ /\S/)
 	{
 
-		if($scratchdata =~ s/^(.{58})`\n//m)		
-		{
-			my @fields = unpack("A16A12A6A6A8A10", $1);
-
-			for(0.. at fields)
-			{
-				$fields[$_] ||= "";
-				$fields[$_] =~ s/\s*$//g;
+		if($scratchdata =~ s/^(.{58})`\n//s)
+		{
+			my $headers = {};
+			@$headers{qw/name date uid gid mode size/} =
+				unpack("A16A12A6A6A8A10", $1);
+
+			for (values %$headers) {
+				$_ ||= "";
+				$_ =~ s/\s*$//;
 			}
-
-			my $headers = {};
-			@$headers{qw/name date uid gid mode size/} = @fields;
+			$headers->{mode} = oct($headers->{mode});
 
 			$headers->{data} = substr($scratchdata, 0, $headers->{size}, "");
+			# delete padding, if any
+			substr($scratchdata, 0, $headers->{size} % 2, "");
 
 			$this->_addFile($headers);
 		}else{
@@ -531,6 +538,7 @@
 =item * C<list_files()>
 
 This lists the files contained inside of the archive by filename, as an array.
+If called in a scalar context, returns a reference to an array.
 
 =back
 
@@ -565,7 +573,7 @@
         "uid" => $uid, #defaults to zero
         "gid" => $gid, #defaults to zero
         "date" => $date,  #date in epoch seconds. Defaults to now.
-        "mode" => $mode, #defaults to "100644";
+        "mode" => $mode, #defaults to 0100644;
 	}
 
 You cannot add_data over another file however.  This returns the file length in 
@@ -635,6 +643,16 @@
 
 =over 4
 
+=item * B<Version 1.14> - October 14, 2009
+
+Fix list_files to return a list in list context, to match doc.
+
+Pad odd-size archives to an even number of bytes.
+Closes RT #18383 (thanks to David Dick).
+
+Fixed broken file perms (decimal mode stored as octal string).
+Closes RT #49987 (thanks to Stephen Gran - debian bug #523515).
+
 =item * B<Version 1.13b> - May 7th, 2003
 
 Fixes to the Makefile.PL file. Ar.pm wasn't being put into /blib

Modified: trunk/libarchive-ar-perl/t/10objects.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarchive-ar-perl/t/10objects.t?rev=46316&op=diff
==============================================================================
--- trunk/libarchive-ar-perl/t/10objects.t (original)
+++ trunk/libarchive-ar-perl/t/10objects.t Sat Oct 24 15:04:58 2009
@@ -1,11 +1,6 @@
 #!/usr/bin/perl -w
 
 use Test::More tests => 13;
-
-BEGIN {
-        chdir 't' if -d 't';
-        use lib '../blib/lib', 'lib/', '..';
-}
 
 my $mod = "Archive::Ar";
 

Modified: trunk/libarchive-ar-perl/t/20new.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libarchive-ar-perl/t/20new.t?rev=46316&op=diff
==============================================================================
--- trunk/libarchive-ar-perl/t/20new.t (original)
+++ trunk/libarchive-ar-perl/t/20new.t Sat Oct 24 15:04:58 2009
@@ -2,11 +2,6 @@
 
 use Test::More tests => 9;
 use Test::MockObject;
-
-BEGIN {
-        chdir 't' if -d 't';
-        use lib '../blib/lib', 'lib/', '..';
-}
 
 my $mod = "Archive::Ar";
 my $mock = new Test::MockObject;




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