public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1 of 1] scripts/functions: extract: portable call for old and defective tars
  2011-11-22  9:34 [PATCH 0 of 1] reworked: using tar with xz and lzma archives Titus von Boxberg
@ 2011-11-22  9:34 ` Titus von Boxberg
  2011-11-22 17:10   ` Yann E. MORIN
  2011-11-25 22:50   ` Yann E. MORIN
  0 siblings, 2 replies; 5+ messages in thread
From: Titus von Boxberg @ 2011-11-22  9:34 UTC (permalink / raw)
  To: crossgcc

# HG changeset patch
# User Titus von Boxberg <titus@v9g.de>
# Date 1321952890 -3600
# Node ID ac30f53965908a4341a5cf21ba67d707a8f0d68e
# Parent  3c1a3fc051cb46d1bad9cbe2a601c5c4aa48876c
scripts/functions: extract: portable call for old and defective tars

Instead of using -J, --lzma, --use-compress-program or the like
use <compressor> -dc <file> | tar -f -

Signed-off-by: titus@v9g.de

diff -r 3c1a3fc051cb -r ac30f5396590 scripts/functions
--- a/scripts/functions	Thu Nov 17 14:18:44 2011 +0100
+++ b/scripts/functions	Tue Nov 22 10:08:10 2011 +0100
@@ -761,15 +761,15 @@
     # - so, if we get an lzma tarball, and either 'xz' or 'lzma' is
     #   missing, we can assume the other is available
     if [ "${CT_CONFIGURE_has_lzma}" = "y" ]; then
-        lzma_prog=lzma
+        lzma_prog="lzma -fdc"
     else
-        lzma_prog=xz
+        lzma_prog="xz -fdc"
     fi
     case "${ext}" in
-        .tar.xz)      CT_DoExecLog FILE tar "${tar_opts[@]}" --use-compress-program=xz -f "${full_file}";;
-        .tar.lzma)    CT_DoExecLog FILE tar "${tar_opts[@]}" --use-compress-program="${lzma_prog}" -f "${full_file}";;
-        .tar.bz2)     CT_DoExecLog FILE tar "${tar_opts[@]}" -j -f "${full_file}";;
-        .tar.gz|.tgz) CT_DoExecLog FILE tar "${tar_opts[@]}" -z -f "${full_file}";;
+        .tar.xz)      xz -fdc "${full_file}" | CT_DoExecLog FILE tar "${tar_opts[@]}" -f -;;
+        .tar.lzma)    ${lzma_prog} "${full_file}" | CT_DoExecLog FILE tar "${tar_opts[@]}" -f -;;
+        .tar.bz2)     bzip2 -dc "${full_file}" | CT_DoExecLog FILE tar "${tar_opts[@]}" -f -;;
+        .tar.gz|.tgz) gzip -dc "${full_file}" | CT_DoExecLog FILE tar "${tar_opts[@]}" -f -;;
         .tar)         CT_DoExecLog FILE tar "${tar_opts[@]}" -f "${full_file}";;
         /.git)        CT_ExtractGit "${basename}" "${@}";;
         *)            CT_DoLog WARN "Don't know how to handle '${basename}${ext}': unknown extension"

--
For unsubscribe information see http://sourceware.org/lists.html#faq

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

* [PATCH 0 of 1] reworked: using tar with xz and lzma archives
@ 2011-11-22  9:34 Titus von Boxberg
  2011-11-22  9:34 ` [PATCH 1 of 1] scripts/functions: extract: portable call for old and defective tars Titus von Boxberg
  0 siblings, 1 reply; 5+ messages in thread
From: Titus von Boxberg @ 2011-11-22  9:34 UTC (permalink / raw)
  To: crossgcc

Yann, all

now use <compressor -dc[f]> | tar -f - for broken tars.
Tested with xz,lzma,bzip2 and gzip compressed files.
Used xz for xz and lzma decompression.

Regards
Titus

--
For unsubscribe information see http://sourceware.org/lists.html#faq

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

* Re: [PATCH 1 of 1] scripts/functions: extract: portable call for old and defective tars
  2011-11-22  9:34 ` [PATCH 1 of 1] scripts/functions: extract: portable call for old and defective tars Titus von Boxberg
@ 2011-11-22 17:10   ` Yann E. MORIN
  2011-11-22 18:08     ` Titus von Boxberg
  2011-11-25 22:50   ` Yann E. MORIN
  1 sibling, 1 reply; 5+ messages in thread
From: Yann E. MORIN @ 2011-11-22 17:10 UTC (permalink / raw)
  To: crossgcc; +Cc: Titus von Boxberg

Titus, All,

On Tuesday 22 November 2011 10:30:23 Titus von Boxberg wrote:
> # HG changeset patch
> # User Titus von Boxberg <titus@v9g.de>
> # Date 1321952890 -3600
> # Node ID ac30f53965908a4341a5cf21ba67d707a8f0d68e
> # Parent  3c1a3fc051cb46d1bad9cbe2a601c5c4aa48876c
> scripts/functions: extract: portable call for old and defective tars
> 
> Instead of using -J, --lzma, --use-compress-program or the like
> use <compressor> -dc <file> | tar -f -
> 
> Signed-off-by: titus@v9g.de
> 
> diff -r 3c1a3fc051cb -r ac30f5396590 scripts/functions
> --- a/scripts/functions	Thu Nov 17 14:18:44 2011 +0100
> +++ b/scripts/functions	Tue Nov 22 10:08:10 2011 +0100
> @@ -761,15 +761,15 @@
>      # - so, if we get an lzma tarball, and either 'xz' or 'lzma' is
>      #   missing, we can assume the other is available
>      if [ "${CT_CONFIGURE_has_lzma}" = "y" ]; then
> -        lzma_prog=lzma
> +        lzma_prog="lzma -fdc"
>      else
> -        lzma_prog=xz
> +        lzma_prog="xz -fdc"
>      fi
>      case "${ext}" in
> -        .tar.xz)      CT_DoExecLog FILE tar "${tar_opts[@]}" --use-compress-program=xz -f "${full_file}";;
> -        .tar.lzma)    CT_DoExecLog FILE tar "${tar_opts[@]}" --use-compress-program="${lzma_prog}" -f "${full_file}";;
> -        .tar.bz2)     CT_DoExecLog FILE tar "${tar_opts[@]}" -j -f "${full_file}";;
> -        .tar.gz|.tgz) CT_DoExecLog FILE tar "${tar_opts[@]}" -z -f "${full_file}";;
> +        .tar.xz)      xz -fdc "${full_file}" | CT_DoExecLog FILE tar "${tar_opts[@]}" -f -;;
> +        .tar.lzma)    ${lzma_prog} "${full_file}" | CT_DoExecLog FILE tar "${tar_opts[@]}" -f -;;
> +        .tar.bz2)     bzip2 -dc "${full_file}" | CT_DoExecLog FILE tar "${tar_opts[@]}" -f -;;
> +        .tar.gz|.tgz) gzip -dc "${full_file}" | CT_DoExecLog FILE tar "${tar_opts[@]}" -f -;;

Why not use:
  xz    : xzcat
  lzma  : lzcat
  bzip2 : bzcat
  gzip  : zcat

I believe that, if  a specific compressor is available, the corresponding
'cat' counterpart is also available. At least, that has been my experience
with all the "standard" distro I've used.

Otherwise, OK.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

--
For unsubscribe information see http://sourceware.org/lists.html#faq

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

* Re: [PATCH 1 of 1] scripts/functions: extract: portable call for old and defective tars
  2011-11-22 17:10   ` Yann E. MORIN
@ 2011-11-22 18:08     ` Titus von Boxberg
  0 siblings, 0 replies; 5+ messages in thread
From: Titus von Boxberg @ 2011-11-22 18:08 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: crossgcc

Am 22.11.2011 um 18:09 schrieb Yann E. MORIN:

> Titus, All,
> 
> On Tuesday 22 November 2011 10:30:23 Titus von Boxberg wrote:
>> # HG changeset patch
>> # User Titus von Boxberg <titus@v9g.de>
>> # Date 1321952890 -3600
>> # Node ID ac30f53965908a4341a5cf21ba67d707a8f0d68e
>> # Parent  3c1a3fc051cb46d1bad9cbe2a601c5c4aa48876c
>> scripts/functions: extract: portable call for old and defective tars
> 
> Why not use:
>  xz    : xzcat
>  lzma  : lzcat
>  bzip2 : bzcat
>  gzip  : zcat
> 
> I believe that, if  a specific compressor is available, the corresponding
> 'cat' counterpart is also available. At least, that has been my experience
> with all the "standard" distro I've used.
Yann,

you gave the reason yourself:
That <compressor>cat would always be available is just belief.

The availability of <compressor -dc> is granted by definition.

Regards
Titus


--
For unsubscribe information see http://sourceware.org/lists.html#faq

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

* Re: [PATCH 1 of 1] scripts/functions: extract: portable call for old and defective tars
  2011-11-22  9:34 ` [PATCH 1 of 1] scripts/functions: extract: portable call for old and defective tars Titus von Boxberg
  2011-11-22 17:10   ` Yann E. MORIN
@ 2011-11-25 22:50   ` Yann E. MORIN
  1 sibling, 0 replies; 5+ messages in thread
From: Yann E. MORIN @ 2011-11-25 22:50 UTC (permalink / raw)
  To: crossgcc; +Cc: Titus von Boxberg

Titus, All,

On Tuesday 22 November 2011 10:30:23 Titus von Boxberg wrote:
> # HG changeset patch
> # User Titus von Boxberg <titus@v9g.de>
> # Date 1321952890 -3600
> # Node ID ac30f53965908a4341a5cf21ba67d707a8f0d68e
> # Parent  3c1a3fc051cb46d1bad9cbe2a601c5c4aa48876c
> scripts/functions: extract: portable call for old and defective tars
> 
> Instead of using -J, --lzma, --use-compress-program or the like
> use <compressor> -dc <file> | tar -f -

Applied as #49af7802dcd5, thank you!

> Signed-off-by: titus@v9g.de

Next time, could you use your full name when you SoB:
  Signed-off-by: John R. Doe <john@doe>

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

--
For unsubscribe information see http://sourceware.org/lists.html#faq

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

end of thread, other threads:[~2011-11-25 22:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-22  9:34 [PATCH 0 of 1] reworked: using tar with xz and lzma archives Titus von Boxberg
2011-11-22  9:34 ` [PATCH 1 of 1] scripts/functions: extract: portable call for old and defective tars Titus von Boxberg
2011-11-22 17:10   ` Yann E. MORIN
2011-11-22 18:08     ` Titus von Boxberg
2011-11-25 22:50   ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).