summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/__init__.py
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-05-25 16:46:44 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-03 13:13:31 +0100
commit02ac95ab5df879bc7b2a706d320a4ab1b2830f13 (patch)
tree70713f22e5adb1aaa5bfcdba3cdff670c6386d84 /bitbake/lib/bb/fetch2/__init__.py
parent08c6808d01a3d5cde26cb7efcaf19603e6f806a6 (diff)
downloadpoky-02ac95ab5df879bc7b2a706d320a4ab1b2830f13.tar.gz
bitbake: fetch2: fix unpacking of deb packages
deb packages in modern Debian versions have the data tarball compressed with xz rather than gzip, and thus explicitly extracting data.tar.gz fails. Unfortunately ar doesn't support wildcards matching items to extract, so we have to find out what the name of the file is first and then extract it, relying on tar to figure out how to unpack it based on the filename rather than doing it with pipes and making that determination ourselves. (Bitbake rev: 17ff08d225a8fa7faffd683c028369574954fba9) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2/__init__.py')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index be01bdbb34..f612318cc5 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -1392,7 +1392,18 @@ class FetchMethod(object):
1392 else: 1392 else:
1393 cmd = 'rpm2cpio.sh %s | cpio -id' % (file) 1393 cmd = 'rpm2cpio.sh %s | cpio -id' % (file)
1394 elif file.endswith('.deb') or file.endswith('.ipk'): 1394 elif file.endswith('.deb') or file.endswith('.ipk'):
1395 cmd = 'ar -p %s data.tar.gz | zcat | tar --no-same-owner -xpf -' % file 1395 output = subprocess.check_output('ar -t %s' % file, preexec_fn=subprocess_setup, shell=True)
1396 datafile = None
1397 if output:
1398 for line in output.splitlines():
1399 if line.startswith('data.tar.'):
1400 datafile = line
1401 break
1402 else:
1403 raise UnpackError("Unable to unpack deb/ipk package - does not contain data.tar.* file", urldata.url)
1404 else:
1405 raise UnpackError("Unable to unpack deb/ipk package - could not list contents", urldata.url)
1406 cmd = 'ar x %s %s && tar --no-same-owner -xpf %s && rm %s' % (file, datafile, datafile, datafile)
1396 elif file.endswith('.tar.7z'): 1407 elif file.endswith('.tar.7z'):
1397 cmd = '7z x -so %s | tar xf - ' % file 1408 cmd = '7z x -so %s | tar xf - ' % file
1398 elif file.endswith('.7z'): 1409 elif file.endswith('.7z'):