[oe] [PATCH] lib/oe/unpack.py: fix uncompressing .gz .bz2 or .xz

Eric Bénard eric at eukrea.com
Mon Sep 6 18:48:55 UTC 2010


* Actually, the destination file has the full path (ie it's uncompressed
in the download directory) as only the extension is removed.
* By also removing the path, this patch should fix this problem.
* An other fix could be to no uncompress to stdout but let gunzip|bunzip2|
xz uncompress directly to the file.

Signed-off-by: Eric Bénard <eric at eukrea.com>
Acked-by: Frans Meulenbroeks <fransmeulenbroeks at gmail.com>
---
 lib/oe/unpack.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/lib/oe/unpack.py b/lib/oe/unpack.py
index 34569aa..8fc329a 100644
--- a/lib/oe/unpack.py
+++ b/lib/oe/unpack.py
@@ -64,14 +64,17 @@ def unpack_file(file, destdir, dos=False, env=None):
         cmd = 'bzip2 -dc %s | tar x --no-same-owner -f -' % file
     elif file.endswith('.gz') or file.endswith('.Z') or file.endswith('.z'):
         base, ext = os.path.splitext(file)
+        ext, base = os.path.split(base)
         cmd = 'gzip -dc %s > %s' % (file, base)
     elif file.endswith('.bz2'):
         base, ext = os.path.splitext(file)
+        ext, base = os.path.split(base)
         cmd = 'bzip2 -dc %s > %s' % (file, base)
     elif file.endswith('.tar.xz'):
         cmd = 'xz -dc %s | tar x --no-same-owner -f -' % file
     elif file.endswith('.xz'):
         base, ext = os.path.splitext(file)
+        ext, base = os.path.split(base)
         cmd = 'xz -dc %s > %s' % (file, base)
     elif file.endswith('.zip') or file.endswith('.jar'):
         cmd = 'unzip -q -o'
-- 
1.6.3.3





More information about the Openembedded-devel mailing list