Skip to contentSkip to conversation

fetch2: add .lz compression support

PATCH New Koen Kooi 1 participant 1 message Oct 26, 2014

lore
Share & tools
lore

Koen Kooi

author
#0 lore raw

PATCH 1/1 fetch2: add .lz compression support

See http://www.nongnu.org/lzip/lzip.html for details on the compression format.

---
 lib/bb/fetch2/__init__.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
lib/bb/fetch2/__init__.py +5 -1
index 59a7f1b..cc29864 100644
@@ -1198,7 +1198,7 @@ class FetchMethod(object):
                      (file, urldata.parm.get('unpack')))
 
         dots = file.split(".")
-        if dots[-1] in ['gz', 'bz2', 'Z', 'xz']:
+        if dots[-1] in ['gz', 'bz2', 'Z', 'xz', 'lz']:
             efile = os.path.join(rootdir, os.path.basename('.'.join(dots[0:-1])))
         else:
             efile = file
@@ -1219,6 +1219,10 @@ class FetchMethod(object):
                 cmd = 'xz -dc %s | tar x --no-same-owner -f -' % file
             elif file.endswith('.xz'):
                 cmd = 'xz -dc %s > %s' % (file, efile)
+            elif file.endswith('.tar.lz'):
+                cmd = 'lzip -dc %s | tar x --no-same-owner -f -' % file
+            elif file.endswith('.lz'):
+                cmd = 'lzip -dc %s > %s' % (file, efile)
             elif file.endswith('.zip') or file.endswith('.jar'):
                 try:
                     dos = bb.utils.to_boolean(urldata.parm.get('dos'), False)
Signature · 1 line
1.9.0