scripts/functions: cvs retrieval first tries the mirror for tarballs
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Tue Aug 02 18:26:53 2011 +0200 (2011-08-02)
changeset 25924908eb2b6f17
parent 2591 491d62ac2017
child 2593 2472b2f24e3a
scripts/functions: cvs retrieval first tries the mirror for tarballs

The cvs download helper looks for the local tarballs dir to see if it
can find a pre-downloaded tarball, and if it does not find it, does
the actual fetch to upstream via cvs.

In the process, it does not even try to get a tarball from the local
mirror, which can be useful if the mirror has been pre-populated
manually (or with a previously downloaded tree).

Fake a tarball get with the standard tarball-download helper, but
without specifying any upstream URL, which makes the helper directly
try the LAN mirror.

Of course, if no mirror is specified, no URL wil be available, and
the standard cvs retrieval will kick in.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
scripts/functions
     1.1 --- a/scripts/functions	Mon Aug 01 22:46:57 2011 +0200
     1.2 +++ b/scripts/functions	Tue Aug 02 18:26:53 2011 +0200
     1.3 @@ -590,11 +590,11 @@
     1.4      local dirname="$5"
     1.5      local tmp_dir
     1.6  
     1.7 -    # Does it exist localy?
     1.8 -    CT_GetLocal "${basename}" && return 0 || true
     1.9 -    # No, it does not...
    1.10 -
    1.11 -    CT_DoLog EXTRA "Retrieving '${basename}'"
    1.12 +    # First try locally, then the mirror
    1.13 +    if CT_GetFile "${basename}"; then
    1.14 +        # Got it! Return early! :-)
    1.15 +        return 0
    1.16 +    fi
    1.17  
    1.18      CT_MktempDir tmp_dir
    1.19      CT_Pushd "${tmp_dir}"