[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 3.0.19-bf2.4 install report



#include <hallo.h>
Philip Blundell wrote on Sat Feb 16, 2002 um 05:40:44PM:

> see).  Even if you use "ftp.CC.debian.org", not all countries have a
> mirror so you would need some way of checking if the server exists or
> not.  And, finally, lang->locale is a full locale name like
> "en_GB.ISO-8859-1", not just a language code -- you might have been
> thinking of lang->msgcat, which is just the language name, but even that

I meant msgcat.

> would probably give you the wrong results for pt_BR and ja_JP.

Well, shit happens. We cannot make a more precise selection based on the
first language choice. It is still better then pointing everyone to
ftp.us, and I try to define the nearest server for the majority of the
users.

> If we want to provide suggestions for nearby mirrors, I don't honestly
> think there is any reliable way to derive an address from the locale
> name.  It would almost certainly be better to just add an extra
> "lang->mirror" field or something and let people fill in their favourite
> mirrors in the language .src files.

Okay, what about this patch? It is a hardcoded map, which I put together
using my impressions and http://www.debian.org/distrib/ftplist. Feel
free to change it.

Gruss/Regards,
Eduard.
-- 
!netgod:*! time flies when youre using linux
!doogie:*! yeah, infinite loops in 5 seconds.
!Teknix:*! has anyone re-tested that with 2.2.x ?
!netgod:*! yeah, 4 seconds now
diff -u -r1.53 net-fetch.c
--- net-fetch.c	2002/02/08 05:56:11	1.53
+++ net-fetch.c	2002/02/16 18:38:13
@@ -57,6 +57,29 @@
   { NULL,    0  }
 };
 
+char *mirror_country_map[] = { 
+/*   "en", "us",
+   "ca", "us",
+   "cs", "us",
+   "da", "us", */
+   "de", "de",
+/*   "eo", "us", */
+   "es", "es",
+   "fi", "fi",
+   "fr", "fr",
+/*   "gl", "us", */
+   "hr", "hr",
+   "hu", "hu",
+   "it", "it",
+   "ja", "jp",
+   "pl", "pl",
+/*   "pt", "us", */
+   "ru", "ru",
+/*   "sk", "us",
+   "sv", "us", */
+   "tr", "tr",
+   NULL };
+
 #ifdef _TESTING_
 extern char * get_device        (const char *);
 extern void   release_device    (const char *);
@@ -347,6 +370,20 @@
   // http://http.us.debian.org/debian/dists/potato/main/disks-$arch/current/
   nf_state.method = strdup("http");
   nf_state.server.hostname = strdup("http.us.debian.org");
+#ifdef USE_LANGUAGE_CHOOSER
+  {
+     int i = 0;
+     while(mirror_country_map[i] != NULL) {
+        if(strcmp(lang->msgcat,mirror_country_map[i]) == 0) {
+           sprintf(nf_state.server.hostname, "http.%s.debian.org", mirror_country_map[i+1]);
+           goto hostname_set;
+        }
+        else
+           i+=2;
+     }
+  }
+hostname_set:
+#endif  
   nf_state.server.port = 80;
   nf_state.proxy.hostname = strdup("none");
   nf_state.proxy.port = 8080;

Reply to: