From 6c7f5488ee9e7c89acc50827b4f9813624e241e0 Mon Sep 17 00:00:00 2001 From: "Benoît THÉBAUDEAU\"" Date: Fri, 29 Jul 2011 13:04:49 +0200 Subject: scripts/functions: force extract folder to archive basename MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 afterwards, e.g. when patching. E.g.: gcc-linaro-4.5-2011.07.tar.bz2 extracts to gcc-linaro-4.5-2011.07-0/ This patch changes CT_Extract() to force the extraction of all archives to 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/ Signed-off-by: "Benoît THÉBAUDEAU" --- scripts/functions | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/functions b/scripts/functions index 0ccbbae6..ffe54419 100644 --- a/scripts/functions +++ b/scripts/functions @@ -728,10 +728,11 @@ CT_Extract() { CT_Pushd "${nochdir}" 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) CT_DoExecLog FILE tar --strip-components=1 -C "${basename}" -xvjf "${full_file}";; + .tar.gz|.tgz) CT_DoExecLog FILE tar --strip-components=1 -C "${basename}" -xvzf "${full_file}";; + .tar) CT_DoExecLog FILE tar --strip-components=1 -C "${basename}" -xvf "${full_file}";; /.git) CT_ExtractGit "${basename}" "${@}";; *) CT_DoLog WARN "Don't know how to handle '${basename}${ext}': unknown extension" return 1 -- cgit v1.2.3