diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2009-10-26 19:49:50 +0100 |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2009-10-26 19:49:50 +0100 |
commit | e73418236d013152b3891948faa791a45ddc9c20 (patch) | |
tree | 204be119a77bd661571f78211ca2ed24fc52eeb8 /scripts/functions | |
parent | 68b9b30f6bdcfab194408b06a3fcbc6363fb7ede (diff) | |
download | crosstool-ng-e73418236d013152b3891948faa791a45ddc9c20.tar.gz crosstool-ng-e73418236d013152b3891948faa791a45ddc9c20.tar.bz2 crosstool-ng-e73418236d013152b3891948faa791a45ddc9c20.zip |
functions: allow using sub-dir of a module
Some projects' module (eg. newlib) are checked-out into a sudirectory
rather than into their own directory. Handle this case in the CT_GetCVS
function.
Diffstat (limited to 'scripts/functions')
-rw-r--r-- | scripts/functions | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/scripts/functions b/scripts/functions index f6cbdf17..730ecf13 100644 --- a/scripts/functions +++ b/scripts/functions @@ -477,7 +477,8 @@ CT_GetFile() { # 'tag' is the tag to retrieve. Must be specified, but can be empty. # If dirname is specified, then module will be renamed to dirname # prior to building the tarball. -# Usage: CT_GetCVS <basename> <url> <module> <tag> [dirname] +# Usage: CT_GetCVS <basename> <url> <module> <tag> [dirname[=subdir]] +# Note: if '=subdir' is given, then it is used instead of 'module'. CT_GetCVS() { local basename="$1" local uri="$2" @@ -499,8 +500,18 @@ CT_GetCVS() { CT_Pushd "${tmp_dir}" CT_DoExecLog ALL cvs -z 9 -d "${uri}" co -P ${tag} "${module}" - [ -n "${dirname}" ] && CT_DoExecLog ALL mv "${module}" "${dirname}" - CT_DoExecLog ALL tar cjf "${CT_TARBALLS_DIR}/${basename}.tar.bz2" "${dirname:-${module}}" + if [ -n "${dirname}" ]; then + case "${dirname}" in + *=*) + CT_DoExecLog DEBUG mv "${dirname%%=*}" "${dirname#*=}" + CT_DoExecLog ALL tar cjf "${CT_TARBALLS_DIR}/${basename}.tar.bz2" "${dirname#*=}" + ;; + *) + CT_DoExecLog ALL mv "${module}" "${dirname}" + CT_DoExecLog ALL tar cjf "${CT_TARBALLS_DIR}/${basename}.tar.bz2" "${dirname:-${module}}" + ;; + esac + fi CT_SaveLocal "${CT_TARBALLS_DIR}/${basename}.tar.bz2" CT_Popd |