importpkg: add support for data.tar.lzma
authorGuillem Jover <guillem@debian.org>
Wed, 7 May 2014 23:50:48 +0000 (01:50 +0200)
committerHelmut Grohne <helmut@subdivi.de>
Sun, 11 May 2014 13:29:17 +0000 (15:29 +0200)
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

index 7482c4f..247965f 100755 (executable)
@@ -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())