summaryrefslogtreecommitdiffstats
path: root/mdk-stage1
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-01-23 19:06:13 +0000
committerThierry Vignaud <tv@mageia.org>2012-01-23 19:06:13 +0000
commit9f0728688f938f85b2f1ddc54a5e459a78266e5f (patch)
treebcf774fed219f6005fa0276361ffc808cada4682 /mdk-stage1
parentf46a0b994e37d25a32d82e91bd79619e20e210fc (diff)
downloaddrakx-9f0728688f938f85b2f1ddc54a5e459a78266e5f.tar
drakx-9f0728688f938f85b2f1ddc54a5e459a78266e5f.tar.gz
drakx-9f0728688f938f85b2f1ddc54a5e459a78266e5f.tar.bz2
drakx-9f0728688f938f85b2f1ddc54a5e459a78266e5f.tar.xz
drakx-9f0728688f938f85b2f1ddc54a5e459a78266e5f.zip
(http_prepare) try to use arch-prefixed location for HTTP installs (mga#2578)
Diffstat (limited to 'mdk-stage1')
-rw-r--r--mdk-stage1/NEWS2
-rw-r--r--mdk-stage1/network.c11
2 files changed, 13 insertions, 0 deletions
diff --git a/mdk-stage1/NEWS b/mdk-stage1/NEWS
index e48b69452..1fa1db405 100644
--- a/mdk-stage1/NEWS
+++ b/mdk-stage1/NEWS
@@ -1,3 +1,5 @@
+- try to use arch-prefixed location for HTTP installs (mga#2578)
+
1.58
- add support for kernel compressed as XZ
diff --git a/mdk-stage1/network.c b/mdk-stage1/network.c
index 870173cd1..08766b9dd 100644
--- a/mdk-stage1/network.c
+++ b/mdk-stage1/network.c
@@ -1165,6 +1165,17 @@ enum return_type http_prepare(void)
use_http_proxy = http_proxy_host && http_proxy_port && !streq(http_proxy_host, "") && !streq(http_proxy_port, "");
fd = http_download_file(answers[0], location_full, &size, use_http_proxy ? "http" : NULL, http_proxy_host, http_proxy_port);
+
+ /* Try arched directory */
+ if (fd < 0) {
+ log_message("%s failed.", location_full);
+ char *with_arch = asprintf_("%s%s/%s/%s", answers[1][0] == '/' ? "" : "/", answers[1], ARCH, COMPRESSED_FILE_REL("/"));
+ log_message("trying %s...", with_arch);
+ fd = http_download_file(answers[0], with_arch, &size, use_http_proxy ? "http" : NULL, http_proxy_host, http_proxy_port);
+ if (0 < fd)
+ strcpy(location_full, with_arch);
+ }
+
if (fd < 0) {
log_message("HTTP: error %d", fd);
if (fd == FTPERR_FAILED_CONNECT)