public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
From: Titus von Boxberg <titus@v9g.de>
To: crossgcc@sourceware.org
Subject: [PATCH 1 of 1] scripts/functions: extract: portable call for old and defective tars
Date: Tue, 22 Nov 2011 09:34:00 -0000	[thread overview]
Message-ID: <ac30f53965908a4341a5.1321954223@stetschkin.alsteraero.lan> (raw)
In-Reply-To: <patchbomb.1321954222@stetschkin.alsteraero.lan>

# 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

  reply	other threads:[~2011-11-22  9:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2011-11-22 17:10   ` [PATCH 1 of 1] scripts/functions: extract: portable call for old and defective tars Yann E. MORIN
2011-11-22 18:08     ` Titus von Boxberg
2011-11-25 22:50   ` Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ac30f53965908a4341a5.1321954223@stetschkin.alsteraero.lan \
    --to=titus@v9g.de \
    --cc=crossgcc@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).