aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEric Bénard <eric@eukrea.com>2010-09-06 19:23:56 +0200
committerEric Bénard <eric@eukrea.com>2010-09-06 23:11:26 +0200
commit27c47106edd05d478d09a5d190e7dade5ed21926 (patch)
treeb8b0cd5fcf5194a97460061de250b229cbaba236 /lib
parent1e3df2fdc29d07c43fc4cbcc5f1870b659c9fdec (diff)
downloadopenembedded-27c47106edd05d478d09a5d190e7dade5ed21926.tar.gz
openembedded-27c47106edd05d478d09a5d190e7dade5ed21926.tar.bz2
openembedded-27c47106edd05d478d09a5d190e7dade5ed21926.zip
lib/oe/unpack.py: fix uncompressing .gz .bz2 or .xz
* Actually, the uncompressed file is written into the source path instead of the destination path. * By also removing the source path, this patch should fix this problem. * An other fix could be to not uncompress to stdout but let gunzip|bunzip2| xz uncompress directly to the file. Signed-off-by: Eric Bénard <eric@eukrea.com> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com> Acked-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/oe/unpack.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/oe/unpack.py b/lib/oe/unpack.py
index 34569aa004..6d24c5e2fa 100644
--- a/lib/oe/unpack.py
+++ b/lib/oe/unpack.py
@@ -63,16 +63,16 @@ def unpack_file(file, destdir, dos=False, env=None):
elif file.endswith('.tbz') or file.endswith('.tbz2') or file.endswith('.tar.bz2'):
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)
- cmd = 'gzip -dc %s > %s' % (file, base)
+ root, ext = os.path.splitext(file)
+ cmd = 'gzip -dc %s > %s' % (file, os.path.basename(root))
elif file.endswith('.bz2'):
- base, ext = os.path.splitext(file)
- cmd = 'bzip2 -dc %s > %s' % (file, base)
+ root, ext = os.path.splitext(file)
+ cmd = 'bzip2 -dc %s > %s' % (file, os.path.basename(root))
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)
- cmd = 'xz -dc %s > %s' % (file, base)
+ root, ext = os.path.splitext(file)
+ cmd = 'xz -dc %s > %s' % (file, os.path.basename(root))
elif file.endswith('.zip') or file.endswith('.jar'):
cmd = 'unzip -q -o'
if dos: