From 8e49c292559a934308a8a5f6ed3e3bac830e0692 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Sun, 8 Mar 2009 11:14:54 +0000 Subject: 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(-) diff --git a/scripts/functions b/scripts/functions index 19acaed..34a3936 100644 --- a/scripts/functions +++ b/scripts/functions @@ -560,7 +560,7 @@ CT_GetCVS() { # 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_GetCVS() { 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 -- cgit v0.10.2-6-g49f6