summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mdk-stage1/NEWS3
-rw-r--r--mdk-stage1/network.c17
2 files changed, 17 insertions, 3 deletions
diff --git a/mdk-stage1/NEWS b/mdk-stage1/NEWS
index 05ed7a9e0..6f7a51b39 100644
--- a/mdk-stage1/NEWS
+++ b/mdk-stage1/NEWS
@@ -1,3 +1,6 @@
+- fix URL passed to stage2 when user didn't provide the arch in the
+ install path (mga#6823)
+
1.71
- silent hid_generic loading
diff --git a/mdk-stage1/network.c b/mdk-stage1/network.c
index 7be509810..55249fa34 100644
--- a/mdk-stage1/network.c
+++ b/mdk-stage1/network.c
@@ -1001,6 +1001,7 @@ enum return_type ftp_prepare(void)
char location_full[500];
int ftp_serv_response = -1;
int fd, size;
+ int need_arch = 0;
char ftp_hostname[500];
if (!IS_AUTOMATIC) {
@@ -1077,8 +1078,10 @@ enum return_type ftp_prepare(void)
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)
+ if (0 < fd) {
strcpy(location_full, with_arch);
+ need_arch = 1;
+ }
}
if (fd < 0) {
@@ -1103,12 +1106,16 @@ enum return_type ftp_prepare(void)
if (use_http_proxy) {
add_to_env("METHOD", "http");
sprintf(location_full, "ftp://%s%s", ftp_hostname, answers[1]);
+ if (need_arch)
+ strcat(location_full, "/" ARCH);
add_to_env("URLPREFIX", location_full);
add_to_env("PROXY", http_proxy_host);
add_to_env("PROXYPORT", http_proxy_port);
} else {
add_to_env("METHOD", "ftp");
add_to_env("HOST", answers[0]);
+ if (need_arch)
+ strcat(answers[1], "/" ARCH);
add_to_env("PREFIX", answers[1]);
if (!streq(answers[2], "")) {
add_to_env("LOGIN", answers[2]);
@@ -1144,7 +1151,7 @@ enum return_type http_prepare(void)
do {
char location_full[500];
- int fd, size;
+ int fd, size, need_arch = 0;
int use_http_proxy;
if (!IS_AUTOMATIC) {
@@ -1181,8 +1188,10 @@ enum return_type http_prepare(void)
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)
+ if (0 < fd) {
strcpy(location_full, with_arch);
+ need_arch = 1;
+ }
}
if (fd < 0) {
@@ -1204,6 +1213,8 @@ enum return_type http_prepare(void)
add_to_env("METHOD", "http");
sprintf(location_full, "http://%s%s%s", answers[0], answers[1][0] == '/' ? "" : "/", answers[1]);
+ if (need_arch)
+ strcat(location_full, "/" ARCH);
add_to_env("URLPREFIX", location_full);
if (!streq(http_proxy_host, ""))
add_to_env("PROXY", http_proxy_host);