Discussion:
[2774] (ftp_prepare) try arched directory for FTP installs too...
root-odJJhXpcy38dnm+
2012-01-23 19:06:17 UTC
Permalink
Revision: 2774
Author: tv
Date: 2012-01-23 20:06:16 +0100 (Mon, 23 Jan 2012)
Log Message:
-----------
(ftp_prepare) try arched directory for FTP installs too...

Modified Paths:
--------------
drakx/trunk/mdk-stage1/NEWS
drakx/trunk/mdk-stage1/network.c

Modified: drakx/trunk/mdk-stage1/NEWS
===================================================================
--- drakx/trunk/mdk-stage1/NEWS 2012-01-23 19:06:13 UTC (rev 2773)
+++ drakx/trunk/mdk-stage1/NEWS 2012-01-23 19:06:16 UTC (rev 2774)
@@ -1,4 +1,4 @@
-- try to use arch-prefixed location for HTTP installs (mga#2578)
+- try to use arch-prefixed location for FTP & HTTP installs (mga#2578)

1.58
- add support for kernel compressed as XZ

Modified: drakx/trunk/mdk-stage1/network.c
===================================================================
--- drakx/trunk/mdk-stage1/network.c 2012-01-23 19:06:13 UTC (rev 2773)
+++ drakx/trunk/mdk-stage1/network.c 2012-01-23 19:06:16 UTC (rev 2774)
@@ -1072,7 +1072,17 @@
fd = ftp_start_download(ftp_serv_response, location_full, &size);
}

+ /* 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) {
char *msg = str_ftp_error(fd);
log_message("FTP: error get %d for remote file %s", fd, location_full);
stg1_error_message("Error: %s.", msg ? msg : "couldn't retrieve Installation program");
Loading...