From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11670 invoked by alias); 22 Nov 2011 17:10:05 -0000 Received: (qmail 11644 invoked by uid 22791); 22 Nov 2011 17:10:03 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,TW_BZ,TW_LZ,TW_XZ X-Spam-Check-By: sourceware.org Received: from smtp04.smtpout.orange.fr (HELO smtp.smtpout.orange.fr) (80.12.242.126) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 22 Nov 2011 17:09:48 +0000 Received: from treguer.localnet ([90.32.33.236]) by mwinf5d39 with ME id 0H9l1i00855gilm03H9l7A; Tue, 22 Nov 2011 18:09:46 +0100 From: "Yann E. MORIN" To: crossgcc@sourceware.org Subject: Re: [PATCH 1 of 1] scripts/functions: extract: portable call for old and defective tars Date: Tue, 22 Nov 2011 17:10:00 -0000 User-Agent: KMail/1.13.5 (Linux/3.1.1-treguer; KDE/4.4.5; x86_64; ; ) Cc: Titus von Boxberg References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201111221809.44609.yann.morin.1998@anciens.enib.fr> Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org X-SW-Source: 2011-11/txt/msg00126.txt.bz2 Titus, All, On Tuesday 22 November 2011 10:30:23 Titus von Boxberg wrote: > # HG changeset patch > # User Titus von Boxberg > # 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 -dc | 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