* [PATCH 0/1] Fix for unpacking deb files
@ 2016-05-25 4:46 Paul Eggleton
2016-05-25 4:46 ` [PATCH 1/1] fetch2: fix unpacking of deb packages Paul Eggleton
0 siblings, 1 reply; 2+ messages in thread
From: Paul Eggleton @ 2016-05-25 4:46 UTC (permalink / raw)
To: bitbake-devel
The following changes since commit d830dccf948d188492cecfcf2ff053f31740dc21:
classes/base.bbclass: Fix missing getVarFlag parameter (2016-05-24 15:55:01 +0100)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib paule/bb-deb
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=paule/bb-deb
Paul Eggleton (1):
fetch2: fix unpacking of deb packages
lib/bb/fetch2/__init__.py | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
--
2.5.5
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 1/1] fetch2: fix unpacking of deb packages
2016-05-25 4:46 [PATCH 0/1] Fix for unpacking deb files Paul Eggleton
@ 2016-05-25 4:46 ` Paul Eggleton
0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggleton @ 2016-05-25 4:46 UTC (permalink / raw)
To: bitbake-devel
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.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
lib/bb/fetch2/__init__.py | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 7d2f350..879a125 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -1398,7 +1398,18 @@ class FetchMethod(object):
else:
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
+ output = subprocess.check_output('ar -t %s' % file, preexec_fn=subprocess_setup, shell=True)
+ datafile = None
+ if output:
+ for line in output.splitlines():
+ if line.startswith('data.tar.'):
+ datafile = line
+ break
+ else:
+ raise UnpackError("Unable to unpack deb/ipk package - does not contain data.tar.* file", urldata.url)
+ else:
+ raise UnpackError("Unable to unpack deb/ipk package - could not list contents", urldata.url)
+ cmd = 'ar x %s %s && tar --no-same-owner -xpf %s && rm %s' % (file, datafile, datafile, datafile)
elif file.endswith('.tar.7z'):
cmd = '7z x -so %s | tar xf - ' % file
elif file.endswith('.7z'):
--
2.5.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-25 4:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-25 4:46 [PATCH 0/1] Fix for unpacking deb files Paul Eggleton
2016-05-25 4:46 ` [PATCH 1/1] fetch2: fix unpacking of deb packages Paul Eggleton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.