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

* Re: [PATCH] lib/oe/unpack.py: fix uncompressing .gz .bz2 or .xz
  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
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Chris Larson @ 2010-09-06 19:50 UTC (permalink / raw)
  To: openembedded-devel

On Mon, Sep 6, 2010 at 11:48 AM, Eric Bénard <eric@eukrea.com> wrote:

> * 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.
>

Thanks for looking into this.  I appreciate your putting together a fix.
See code comments below.

Please improve the wording of the commit message here.  "has the full path"
is unclear.  I'd suggest referring to the fact that it's currently writing
into the *source* path rather than the *destination* path, to clarify a bit.

    elif file.endswith('.gz') or file.endswith('.Z') or file.endswith('.z'):
>         base, ext = os.path.splitext(file)
> +        ext, base = os.path.split(base)
>

This variable naming is wrong and misleading.  The leading portion of the
split is not an extension, so 'ext' is not correct.  Also, you just throw
away the leading portion anyway, so there's no need to use os.path.split at
all.  Instead, I'd suggest changing this:

    base, ext = os.path.splitext(file)
    cmd = 'bzip2 -dc %s > %s' % (file, base)

to this:

    root, ext = os.path.splitext(file)
    cmd = 'bzip2 -dc %s > %s' % (file, os.path.basename(root))

Thanks again,
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics


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

* [PATCH v2] lib/oe/unpack.py: fix uncompressing .gz .bz2 or .xz
  2010-09-06 19:50 ` Chris Larson
@ 2010-09-06 20:57   ` 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
  2 siblings, 1 reply; 6+ messages in thread
From: Eric Bénard @ 2010-09-06 20:57 UTC (permalink / raw)
  To: openembedded-devel

* 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>
---
v2:
	python part reworked as per Chris Larson's suggestion
	commit message rephrased to clarify it.

 lib/oe/unpack.py |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/oe/unpack.py b/lib/oe/unpack.py
index 34569aa..6d24c5e 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:
-- 
1.6.3.3




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

* Re: [PATCH] lib/oe/unpack.py: fix uncompressing .gz .bz2 or .xz
  2010-09-06 19:50 ` Chris Larson
  2010-09-06 20:57   ` [PATCH v2] " Eric Bénard
@ 2010-09-06 21:00   ` Eric Bénard
  2010-09-06 21:02   ` [PATCH] asterisk: replace termcap by tinfo Eric Bénard
  2 siblings, 0 replies; 6+ messages in thread
From: Eric Bénard @ 2010-09-06 21:00 UTC (permalink / raw)
  To: openembedded-devel

Hi Chris,

Le 06/09/2010 21:50, Chris Larson a écrit :
> On Mon, Sep 6, 2010 at 11:48 AM, Eric Bénard<eric@eukrea.com>  wrote:
>
>> * 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.
>>
>
> Thanks for looking into this.  I appreciate your putting together a fix.
> See code comments below.
>
> Please improve the wording of the commit message here.  "has the full path"
> is unclear.  I'd suggest referring to the fact that it's currently writing
> into the *source* path rather than the *destination* path, to clarify a bit.
>
>      elif file.endswith('.gz') or file.endswith('.Z') or file.endswith('.z'):
>>          base, ext = os.path.splitext(file)
>> +        ext, base = os.path.split(base)
>>
>
> This variable naming is wrong and misleading.  The leading portion of the
> split is not an extension, so 'ext' is not correct.  Also, you just throw
> away the leading portion anyway, so there's no need to use os.path.split at
> all.  Instead, I'd suggest changing this:
>
>      base, ext = os.path.splitext(file)
>      cmd = 'bzip2 -dc %s>  %s' % (file, base)
>
> to this:
>
>      root, ext = os.path.splitext(file)
>      cmd = 'bzip2 -dc %s>  %s' % (file, os.path.basename(root))
>
thanks for the review. I've updated the patch following your comments.

Eric



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

* [PATCH] asterisk: replace termcap by tinfo
  2010-09-06 19:50 ` Chris Larson
  2010-09-06 20:57   ` [PATCH v2] " Eric Bénard
  2010-09-06 21:00   ` [PATCH] " Eric Bénard
@ 2010-09-06 21:02   ` Eric Bénard
  2 siblings, 0 replies; 6+ messages in thread
From: Eric Bénard @ 2010-09-06 21:02 UTC (permalink / raw)
  To: openembedded-devel

* this fix the following configure problem :
checking for tgetent in -ltermcap... no
configure: ***
configure: *** The Termcap installation on this system appears to be broken.
configure: *** Either correct the installation, or run configure
configure: *** without explicitly specifying --with-termcap
* PR bumped

Signed-off-by: Eric Bénard <eric@eukrea.com>
Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
---
 recipes/asterisk/asterisk_1.4.23.1.bb |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/recipes/asterisk/asterisk_1.4.23.1.bb b/recipes/asterisk/asterisk_1.4.23.1.bb
index af6967a..5869187 100644
--- a/recipes/asterisk/asterisk_1.4.23.1.bb
+++ b/recipes/asterisk/asterisk_1.4.23.1.bb
@@ -5,8 +5,9 @@ HOMEPAGE = "http://www.asterisk.org"
 LICENSE = "GPLv2"
 PRIORITY = "optional"
 SECTION = "console/telephony"
-DEPENDS = "speex readline zlib openssl curl popt gnutls sqlite libogg libvorbis"
+DEPENDS = "speex readline zlib openssl curl popt gnutls sqlite libogg libvorbis ncurses"
 #RRECOMMENDS_${PN} = "logrotate"
+PR = "r1"
 
 SRC_URI="http://downloads.digium.com/pub/asterisk/releases/asterisk-${PV}.tar.gz \
 #	file://sounds.xml.patch \
@@ -28,7 +29,7 @@ inherit autotools update-rc.d
 EXTRA_OECONF =  "--with-ssl=${STAGING_EXECPREFIXDIR} \
 			--with-z=${STAGING_EXECPREFIXDIR} \
 			--with-curl=${STAGING_EXECPREFIXDIR} \
-			--with-termcap=${STAGING_EXECPREFIXDIR} \
+			--with-tinfo=${STAGING_EXECPREFIXDIR} \
 			--with-ogg=${STAGING_EXECPREFIXDIR} \
 			--with-vorbis=${STAGING_EXECPREFIXDIR} \
 			--with-sqlite=${STAGING_EXECPREFIXDIR} \
-- 
1.6.3.3




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

* Re: [PATCH v2] lib/oe/unpack.py: fix uncompressing .gz .bz2 or .xz
  2010-09-06 20:57   ` [PATCH v2] " Eric Bénard
@ 2010-09-06 21:06     ` Chris Larson
  0 siblings, 0 replies; 6+ messages in thread
From: Chris Larson @ 2010-09-06 21:06 UTC (permalink / raw)
  To: openembedded-devel

On Mon, Sep 6, 2010 at 1:57 PM, Eric Bénard <eric@eukrea.com> wrote:

> * 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>
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics


^ permalink raw reply	[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.