This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: CT_PREFER_MIRROR working?


Andy, All,

On Monday 01 August 2011 17:20:42 ANDY KENNEDY wrote:
> I select the following settings:
> 
> CT_USE_MIRROR=y
> CT_PREFER_MIRROR=y
> CT_MIRROR_BASE_URL="ftp://akennedy_lin/pub/dl";
> 
> with the expectation that for each package needed, the build will go
> look at that location (which _is_ a valid name in our network).
> Unfortunately, there seems to be "custom" downloads for eglibc.

Indeed, eglibc primarily fetches its sources via svn. It first looks in
the local tarballs dir to see if it was already retrieved, and if not,
reverts to using svn.

The mirror stuff is only for upstreams that provide tarballs.

> I
> modified the scripts to avoid that custom download if the
> MIRRO_BASE_URL is set, however, I was wondering if there is already a
> fix for this?

It might be possible to try the mirror for SVN as well. Care to try
the attached patch, please?

> Should _all_ packages attempt to download from the
> PREFER_MIRROR base if it is set?

That was not intended for all packages at first, as it seemed complex to
do so. But if the attached patch works as expected, then it was not that
complex, in fact.

It could be made to work for cvs (newlib) as well.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
diff --git a/scripts/functions b/scripts/functions
--- a/scripts/functions
+++ b/scripts/functions
@@ -556,6 +556,7 @@
     for ext in ${first_ext} .tar.bz2 .tar.gz .tgz .tar ''; do
         # Try all urls in turn
         for url in ${URLS}; do
+            [ -n "${url}" ] || continue
             CT_DoLog DEBUG "Trying '${url}/${file}${ext}'"
             CT_DoGetFile "${url}/${file}${ext}"
             if [ -f "${CT_TARBALLS_DIR}/${file}${ext}" ]; then
@@ -628,9 +629,11 @@
     local uri="$2"
     local rev="$3"
 
-    # Does it exist localy?
-    CT_GetLocal "${basename}" && return 0 || true
-    # No, it does not...
+    # First try locally, then the mirror
+    if CT_GetFile "${basename}"; then
+        # Got it! Return early! :-)
+        return 0
+    fi
 
     CT_DoLog EXTRA "Retrieving '${basename}'"
 

--
For unsubscribe information see http://sourceware.org/lists.html#faq

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]