[Debian-l10n-commits] r2059 - in /dl10n/trunk: Changelog lib/Debian/Pkg/DebSrc.pm lib/Debian/Pkg/Tar.pm

nekral-guest at users.alioth.debian.org nekral-guest at users.alioth.debian.org
Tue Dec 29 10:19:02 UTC 2009


Author: nekral-guest
Date: Tue Dec 29 10:18:44 2009
New Revision: 2059

URL: http://svn.debian.org/wsvn/?sc=1&rev=2059
Log:
	* lib/Debian/Pkg/Tar.pm: Added option prepend_dir to force
	prepending the directory during parse(). This is needed for the v3
	source package support.
	* lib/Debian/Pkg/DebSrc.pm: Use this option, otherwise the files
	are extracted without the directory.

Modified:
    dl10n/trunk/Changelog
    dl10n/trunk/lib/Debian/Pkg/DebSrc.pm
    dl10n/trunk/lib/Debian/Pkg/Tar.pm

Modified: dl10n/trunk/Changelog
URL: http://svn.debian.org/wsvn/dl10n/trunk/Changelog?rev=2059&op=diff
==============================================================================
--- dl10n/trunk/Changelog (original)
+++ dl10n/trunk/Changelog Tue Dec 29 10:18:44 2009
@@ -1,3 +1,11 @@
+2009-12-29  Nicolas François  <nicolas.francois at centraliens.net>
+
+	* lib/Debian/Pkg/Tar.pm: Added option prepend_dir to force
+	prepending the directory during parse(). This is needed for the v3
+	source package support.
+	* lib/Debian/Pkg/DebSrc.pm: Use this option, otherwise the files
+	are extracted without the directory.
+
 2009-12-29  Nicolas François  <nicolas.francois at centraliens.net>
 
 	* dl10n-rrd/dl10n-rrd: Do not die when the statistics are empty.

Modified: dl10n/trunk/lib/Debian/Pkg/DebSrc.pm
URL: http://svn.debian.org/wsvn/dl10n/trunk/lib/Debian/Pkg/DebSrc.pm?rev=2059&op=diff
==============================================================================
--- dl10n/trunk/lib/Debian/Pkg/DebSrc.pm (original)
+++ dl10n/trunk/lib/Debian/Pkg/DebSrc.pm Tue Dec 29 10:18:44 2009
@@ -118,9 +118,8 @@
 
         #   Apply the v3 tarball if found
         if ($v3targz) {
-                $self->{v3} = Debian::Pkg::Tar->new("$v3targz", @_);
+                $self->{v3} = Debian::Pkg::Tar->new("$v3targz", @_, prepend_dir=>1);
                 $self->{v3}->parse();
-                $self->{v3}->_prepend_dir($self->{v3}->{dir});
         }
 
         #   Apply patch if found
@@ -195,8 +194,8 @@
         my $self = shift;
         my $file = shift;
 
-        return    $self->SUPER::file_exists($file)
-               or $self->{v3}->file_exists($file);
+        return (   $self->SUPER::file_exists($file)
+                or (defined $self->{v3} and $self->{v3}->file_exists($file)));
 }
 
 =item file_content

Modified: dl10n/trunk/lib/Debian/Pkg/Tar.pm
URL: http://svn.debian.org/wsvn/dl10n/trunk/lib/Debian/Pkg/Tar.pm?rev=2059&op=diff
==============================================================================
--- dl10n/trunk/lib/Debian/Pkg/Tar.pm (original)
+++ dl10n/trunk/lib/Debian/Pkg/Tar.pm Tue Dec 29 10:18:44 2009
@@ -103,6 +103,7 @@
                 _parse_dft      => 0,
                 _debug  => 0,
                 _maxmem => 0,
+                _prepend_dir => 0,
         };
 
         if ($#_ >= 0) {
@@ -271,6 +272,7 @@
 
         my ($name, $type, $size) = $self->_read_header(0) or return 0;
         my $path = '';
+        $name = $self->{dir}."/".$name if $self->{_prepend_dir};
 
         $offset = $self->{offset};
         if ($type eq "file") {




More information about the Debian-l10n-commits mailing list