diff -r b5db8db61f93 -r ea45530f42c1 scripts/functions --- a/scripts/functions Wed Mar 04 18:25:58 2009 +0000 +++ b/scripts/functions Sun Mar 08 11:14:54 2009 +0000 @@ -560,7 +560,7 @@ # No, it does not... # Are downloads allowed ? - CT_TestAndAbort "File '${file}' not present locally, and downloads are not allowed" "${CT_FORBID_DOWNLOAD}" = "y" + CT_TestAndAbort "File '${basename}' not present locally, and downloads are not allowed" "${CT_FORBID_DOWNLOAD}" = "y" CT_DoLog EXTRA "Retrieving '${basename}'" @@ -577,6 +577,38 @@ CT_DoExecLog ALL rm -rf "${tmp_dir}" } +# Check out from SVN, and build the associated tarball +# The tarball will be called ${basename}.tar.bz2 +# Prerequisite: either the server does not require password, +# or the user must already be logged in. +# 'rev' is the revision to retrieve +# Usage: CT_GetSVN [rev] +CT_GetSVN() { + local basename="$1" + local uri="$2" + local rev="$3" + + # Does it exist localy? + CT_GetLocal "${basename}" && return 0 || true + # No, it does not... + + # Are downloads allowed ? + CT_TestAndAbort "File '${basename}' not present locally, and downloads are not allowed" "${CT_FORBID_DOWNLOAD}" = "y" + + CT_DoLog EXTRA "Retrieving '${basename}'" + + CT_MktempDir tmp_dir + CT_Pushd "${tmp_dir}" + + CT_DoSetProxy ${CT_PROXY_TYPE} + CT_DoExecLog ALL svn export ${rev:+-r ${rev}} "${uri}" "${basename}" + CT_DoExecLog ALL tar cjf "${CT_TARBALLS_DIR}/${basename}.tar.bz2" "${basename}" + CT_SaveLocal "${CT_TARBALLS_DIR}/${basename}.tar.bz2" + + CT_Popd + CT_DoExecLog ALL rm -rf "${tmp_dir}" +} + # Extract a tarball # Some tarballs need to be extracted in specific places. Eg.: glibc addons # must be extracted in the glibc directory; uCLibc locales must be extracted