tags 770077 + patch
thanks

On 18/11/14 at 18:48 +0100, Lucas Nussbaum wrote:
> Package: libmail-mbox-messageparser-perl
> Version: 1.5002-2
> Severity: wishlist
> Tags: patch
> 
> Hi,
> 
> It would be great if libmail-mbox-messageparser-perl could be patched to
> support xz compressed mailboxes.
> 
> There's an upstream patch at 
> https://rt.cpan.org/Public/Bug/Display.html?id=68286

Patch attached, against the current git tree.

- Lucas
commit 8206e9994ff9c7ef0af3e0d5fd3e986afd679a2a
Author: Lucas Nussbaum <[email protected]>
Date:   Thu Feb 12 17:24:08 2015 +0100

    debian/patches/xz-support.patch: Add support for XZ-compressed mailboxes. (Closes: #770077)

diff --git a/debian/changelog b/debian/changelog
index a1c7b13..d2d649b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -17,6 +17,10 @@ libmail-mbox-messageparser-perl (1.5002-3) UNRELEASED; urgency=low
   [ Salvatore Bonaccorso ]
   * Update Vcs-Browser URL to cgit web frontend
 
+  [ Lucas Nussbaum ]
+  * debian/patches/xz-support.patch: Add support for XZ-compressed mailboxes.
+    (Closes: #770077)
+
  -- Ansgar Burchardt <[email protected]>  Mon, 01 Nov 2010 11:16:56 +0100
 
 libmail-mbox-messageparser-perl (1.5002-2) unstable; urgency=low
diff --git a/debian/patches/series b/debian/patches/series
index b8d2039..b8d2355 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 paths.patch
 fix-pod-errors.patch
 warnings.patch
+xz-support.patch
diff --git a/debian/patches/xz-support.patch b/debian/patches/xz-support.patch
new file mode 100644
index 0000000..a3997e0
--- /dev/null
+++ b/debian/patches/xz-support.patch
@@ -0,0 +1,44 @@
+Description: Add support for XZ-compressed mailboxes
+Origin: https://rt.cpan.org/Public/Bug/Display.html?id=68286
+Bug-Debian: https://bugs.debian.org/770077
+Bug: https://rt.cpan.org/Public/Bug/Display.html?id=68286
+
+--- a/lib/Mail/Mbox/MessageParser/Config.pm
++++ b/lib/Mail/Mbox/MessageParser/Config.pm
+@@ -13,6 +13,7 @@ $VERSION = sprintf "%d.%02d%02d", q/0.1.
+     'diff' => '/usr/bin/diff',
+     'grep' => '/bin/grep',
+     'gzip' => '/bin/gzip',
++    'xz' => '/usr/bin/xz',
+   },
+ 
+   'max_testchar_buffer_size' => 1048576,
+--- a/lib/Mail/Mbox/MessageParser.pm
++++ b/lib/Mail/Mbox/MessageParser.pm
+@@ -390,6 +390,7 @@ sub _GET_FILE_TYPE
+   # See "magic" on unix systems for details on how to identify file types
+   return 'bzip2' if substr($test_chars, 0, 3) eq 'BZh';
+   return 'bzip' if substr($test_chars, 0, 2) eq 'BZ';
++  return 'xz' if substr($test_chars, 1, 4) eq '7zXZ';
+ #  return 'zip' if substr($test_chars, 0, 2) eq 'PK' &&
+ #    ord(substr($test_chars,3,1)) == 0003 && ord(substr($test_chars,4,1)) == 0004;
+   return 'gzip' if
+@@ -483,7 +484,7 @@ sub _IS_COMPRESSED_TYPE
+   
+   local $" = '|';
+ 
+-  my @types = qw( gzip bzip bzip2 compress );
++  my @types = qw( gzip bzip bzip2 xz compress );
+   my $file_type_pattern = "(@types)";
+ 
+   return $file_type =~ /^$file_type_pattern$/;
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -55,6 +55,7 @@ sub Configure_Programs
+                                    numbers => '[2.1,)', },
+                       },
+                     },
++      'xz'       => { default => 'xz', argname => 'XZ' },
+       'gzip'     => { default => 'gzip', argname => 'GZIP' },
+       'bzip'     => { default => 'bzip2', argname => 'BZIP',
+                       types => {

Reply via email to