Add CT_GetSVN to commonalise retrieval from SVN (ala CT_GetCVS).
/trunk/scripts/functions | 34 33 1 0 +++++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
1.1 --- a/scripts/functions Sun Mar 08 11:14:03 2009 +0000
1.2 +++ b/scripts/functions Sun Mar 08 11:14:54 2009 +0000
1.3 @@ -560,7 +560,7 @@
1.4 # No, it does not...
1.5
1.6 # Are downloads allowed ?
1.7 - CT_TestAndAbort "File '${file}' not present locally, and downloads are not allowed" "${CT_FORBID_DOWNLOAD}" = "y"
1.8 + CT_TestAndAbort "File '${basename}' not present locally, and downloads are not allowed" "${CT_FORBID_DOWNLOAD}" = "y"
1.9
1.10 CT_DoLog EXTRA "Retrieving '${basename}'"
1.11
1.12 @@ -577,6 +577,38 @@
1.13 CT_DoExecLog ALL rm -rf "${tmp_dir}"
1.14 }
1.15
1.16 +# Check out from SVN, and build the associated tarball
1.17 +# The tarball will be called ${basename}.tar.bz2
1.18 +# Prerequisite: either the server does not require password,
1.19 +# or the user must already be logged in.
1.20 +# 'rev' is the revision to retrieve
1.21 +# Usage: CT_GetSVN <basename> <url> [rev]
1.22 +CT_GetSVN() {
1.23 + local basename="$1"
1.24 + local uri="$2"
1.25 + local rev="$3"
1.26 +
1.27 + # Does it exist localy?
1.28 + CT_GetLocal "${basename}" && return 0 || true
1.29 + # No, it does not...
1.30 +
1.31 + # Are downloads allowed ?
1.32 + CT_TestAndAbort "File '${basename}' not present locally, and downloads are not allowed" "${CT_FORBID_DOWNLOAD}" = "y"
1.33 +
1.34 + CT_DoLog EXTRA "Retrieving '${basename}'"
1.35 +
1.36 + CT_MktempDir tmp_dir
1.37 + CT_Pushd "${tmp_dir}"
1.38 +
1.39 + CT_DoSetProxy ${CT_PROXY_TYPE}
1.40 + CT_DoExecLog ALL svn export ${rev:+-r ${rev}} "${uri}" "${basename}"
1.41 + CT_DoExecLog ALL tar cjf "${CT_TARBALLS_DIR}/${basename}.tar.bz2" "${basename}"
1.42 + CT_SaveLocal "${CT_TARBALLS_DIR}/${basename}.tar.bz2"
1.43 +
1.44 + CT_Popd
1.45 + CT_DoExecLog ALL rm -rf "${tmp_dir}"
1.46 +}
1.47 +
1.48 # Extract a tarball
1.49 # Some tarballs need to be extracted in specific places. Eg.: glibc addons
1.50 # must be extracted in the glibc directory; uCLibc locales must be extracted