From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20930 invoked by alias); 28 Jul 2011 21:00:30 -0000 Received: (qmail 20916 invoked by uid 22791); 28 Jul 2011 21:00:29 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,TW_BZ,TW_VJ,TW_VZ,TW_XV X-Spam-Check-By: sourceware.org Received: from smtp11.smtpout.orange.fr (HELO smtp.smtpout.orange.fr) (80.12.242.133) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 28 Jul 2011 21:00:13 +0000 Received: from treguer.localnet ([90.32.163.132]) by mwinf5d34 with ME id DZ0C1h0012riECi03Z0ChX; Thu, 28 Jul 2011 23:00:12 +0200 X-ME-engine: default From: "Yann E. MORIN" To: crossgcc@sourceware.org Subject: Re: [PATCH 5 of 5] scripts/functions: force extract folder to archive basename Date: Thu, 28 Jul 2011 21:00:00 -0000 User-Agent: KMail/1.13.5 (Linux/3.0.0-treguer; KDE/4.4.5; x86_64; ; ) Cc: =?utf-8?q?Beno=C3=AEt_TH=C3=89BAUDEAU?= References: <50c28edc0a0ebe6bf285.1311880213@advlt005-ubuntu> In-Reply-To: <50c28edc0a0ebe6bf285.1311880213@advlt005-ubuntu> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201107282300.11588.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-07/txt/msg00053.txt.bz2 Beno=C3=AEt, All, On Thursday 28 July 2011 21:10:13 Beno=C3=AEt TH=C3=89BAUDEAU wrote: > # HG changeset patch > # User "Beno=C3=AEt TH=C3=89BAUDEAU" > # Date 1311867232 -7200 > # Node ID 50c28edc0a0ebe6bf285b6656233365e2ed88df0 > # Parent ac0f1f93198fca8e2f28b9499e197fa387c67234 > scripts/functions: force extract folder to archive basename >=20 > Some archives like those of the 2011.07 revisions of Linaro GCC contain a= folder > name different from the archive basename, which leads to errors afterward= s, e.g. > when patching. E.g.: > gcc-linaro-4.5-2011.07.tar.bz2 extracts to gcc-linaro-4.5-2011.07-0/ >=20 > This patch changes CT_Extract() to force the extraction of all archives t= o a > folder named like the archive basename. E.g.: > gcc-linaro-4.5-2011.07.tar.bz2 now extracts to gcc-linaro-4.5-2011.07/ >=20 > Signed-off-by: "Beno=C3=AEt TH=C3=89BAUDEAU" >=20 > diff --git a/scripts/functions b/scripts/functions > --- a/scripts/functions > +++ b/scripts/functions > @@ -728,10 +728,15 @@ > CT_Pushd "${nochdir}" >=20=20 > CT_DoLog EXTRA "Extracting '${basename}'" > + CT_DoExecLog FILE mkdir -p "${basename}" > case "${ext}" in > - .tar.bz2) CT_DoExecLog FILE tar xvjf "${full_file}";; > - .tar.gz|.tgz) CT_DoExecLog FILE tar xvzf "${full_file}";; > - .tar) CT_DoExecLog FILE tar xvf "${full_file}";; > + .tar.bz2) { bzcat "${full_file}" \ > + |tar --strip-components=3D1 -C "${basename}" -xv= f - ; > + } 2>&1 |CT_DoLog FILE;; Why don't you use: CT_DoExecLog FILE tar --strip-components=3D1 -C "${basename}" -xvjf "${fu= ll_file}";; ... > + .tar.gz|.tgz) { gzip -d -c "${full_file}" \ > + |tar --strip-components=3D1 -C "${basename}" -xv= f - ; > + } 2>&1 |CT_DoLog FILE;; ... and here with -xvzf ... > + .tar) CT_DoExecLog FILE tar --strip-components=3D1 -C "$= {basename}" -xvf "${full_file}";; ... while you are using it here? > /.git) CT_ExtractGit "${basename}" "${@}";; > *) CT_DoLog WARN "Don't know how to handle '${basenam= e}${ext}': unknown extension" > return 1 >=20 Regards, Yann E. MORIN. --=20 .-----------------.--------------------.------------------.----------------= ----. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspira= cy: | | +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 conspirac= y. | '------------------------------^-------^------------------^----------------= ----' -- For unsubscribe information see http://sourceware.org/lists.html#faq