All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lib/oe/unpack.py: fix uncompressing .gz .bz2 or .xz
@ 2010-09-06 18:48 Eric Bénard
  2010-09-06 19:50 ` Chris Larson
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Bénard @ 2010-09-06 18:48 UTC (permalink / raw)
  To: openembedded-devel

* 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@eukrea.com>
Acked-by: Frans Meulenbroeks <fransmeulenbroeks@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




^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-09-06 21:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-06 18:48 [PATCH] lib/oe/unpack.py: fix uncompressing .gz .bz2 or .xz Eric Bénard
2010-09-06 19:50 ` Chris Larson
2010-09-06 20:57   ` [PATCH v2] " Eric Bénard
2010-09-06 21:06     ` Chris Larson
2010-09-06 21:00   ` [PATCH] " Eric Bénard
2010-09-06 21:02   ` [PATCH] asterisk: replace termcap by tinfo Eric Bénard

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.