path: root/scripts
diff options
authorBenoît THÉBAUDEAU" <>2011-07-29 11:04:49 (GMT)
committerBenoît THÉBAUDEAU" <>2011-07-29 11:04:49 (GMT)
commit6c7f5488ee9e7c89acc50827b4f9813624e241e0 (patch)
tree8919e7be0d4164a3b1ba0f54e330b8d87bcf4d6f /scripts
parent2ea05ecaa77cafacdb5664e0c5bec73a0164e15b (diff)
scripts/functions: force extract folder to archive basename
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" <>
Diffstat (limited to 'scripts')
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/functions b/scripts/functions
index 0ccbbae..ffe5441 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