Patchwork [bitbake-devel,1/1] fetch2: unpack rpm, ipk and deb binary package

login
register
mail settings
Submitter Robert Yang
Date Sept. 2, 2012, 4:08 a.m.
Message ID <2b3b5cbd804f6d0d1949c7f15970be301a6900f4.1346558600.git.liezhi.yang@windriver.com>
Download mbox | patch
Permalink /patch/35625/
State New
Headers show

Comments

Robert Yang - Sept. 2, 2012, 4:08 a.m.
* Unpack the ".rpm" binary package (only .src.rpm in the past)

* Unpack the .deb and .ipk binary package, their unpack commands are the same.

* This is useful for binary package recipe.

[YOCTO #1592]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 bitbake/lib/bb/fetch2/__init__.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Richard Purdie - Sept. 7, 2012, 10:56 a.m.
On Sun, 2012-09-02 at 12:08 +0800, Robert Yang wrote:
> * Unpack the ".rpm" binary package (only .src.rpm in the past)
> 
> * Unpack the .deb and .ipk binary package, their unpack commands are the same.
> 
> * This is useful for binary package recipe.
> 
> [YOCTO #1592]
> 
> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
> ---
>  bitbake/lib/bb/fetch2/__init__.py | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Merged to master, thanks.

Richard

Patch

diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 12ebce2..00fafb6 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -938,7 +938,7 @@  class FetchMethod(object):
                 if dos:
                     cmd = '%s -a' % cmd
                 cmd = "%s '%s'" % (cmd, file)
-            elif file.endswith('.src.rpm') or file.endswith('.srpm'):
+            elif file.endswith('.rpm') or file.endswith('.srpm'):
                 if 'extract' in urldata.parm:
                     unpack_file = urldata.parm.get('extract')
                     cmd = 'rpm2cpio.sh %s | cpio -i %s' % (file, unpack_file)
@@ -946,6 +946,8 @@  class FetchMethod(object):
                     iterate_file = unpack_file
                 else:
                     cmd = 'rpm2cpio.sh %s | cpio -i' % (file)
+            elif file.endswith('.deb') or file.endswith('.ipk'):
+                cmd = 'ar -p %s data.tar.gz | zcat | tar --no-same-owner -xpf -' % file
 
         if not unpack or not cmd:
             # If file == dest, then avoid any copies, as we already put the file into dest!