]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
fetch2/__init__.py: Add support for 7-Zip
authorJuro Bystricky <juro.bystricky@intel.com>
Mon, 4 Jan 2016 18:51:43 +0000 (10:51 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 5 Jan 2016 17:59:09 +0000 (17:59 +0000)
7-Zip is a file archiver claiming the highest compression ratio.
This patch allows using 7-Zip commpressed files in bitbake recipes.
Two common formats are supported:

SRC_URI = "file://abc.tar.7z"
SRC_URI = "file://abc.7z"

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/fetch2/__init__.py

index 68ebf8b8d202ace386edc9ce0651181a824e5039..0f9c6436952cbf84275e55d506e9e37a70b29b59 100644 (file)
@@ -1407,6 +1407,10 @@ class FetchMethod(object):
                     cmd = 'rpm2cpio.sh %s | cpio -id' % (file)
             elif file.endswith('.deb') or file.endswith('.ipk'):
                 cmd = 'ar -p %s data.tar.gz | zcat | tar --no-same-owner -xpf -' % file
+            elif file.endswith('.tar.7z'):
+                cmd = '7z x -so %s | tar xf - ' % file
+            elif file.endswith('.7z'):
+                cmd = '7za x -y %s 1>/dev/null' % file
 
         if not unpack or not cmd:
             # If file == dest, then avoid any copies, as we already put the file into dest!