From ded76354d38d3e59c0af857f2eab5a0194b5e966 Mon Sep 17 00:00:00 2001
From: Guillem Jover <guillem@debian.org>
Date: Thu, 8 May 2014 01:50:48 +0200
Subject: [PATCH 3/3] importpkg: add support for data.tar.lzma

Creating packages with lzma compression has been deprecated since dpkg
1.16.4, but there might be some of those in the wild and supporting them
is strightforward when xz is already supported.

Signed-off-by: Guillem Jover <guillem@debian.org>
---
 importpkg.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/importpkg.py b/importpkg.py
index 7482c4f..247965f 100755
--- a/importpkg.py
+++ b/importpkg.py
@@ -69,6 +69,10 @@ def process_package(filelike, hash_functions):
         elif name == "data.tar.bz2":
             new_state = "data"
             tf = tarfile.open(fileobj=af, mode="r|bz2")
+        elif name == "data.tar.lzma":
+            new_state = "data"
+            zf = DecompressedStream(af, lzma.LZMADecompressor())
+            tf = tarfile.open(fileobj=zf, mode="r|")
         elif name == "data.tar.xz":
             new_state = "data"
             zf = DecompressedStream(af, lzma.LZMADecompressor())
-- 
2.0.0.rc2.303.gcfa251b

