summaryrefslogtreecommitdiffstats
path: root/mdk-stage1
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2001-08-24 19:10:30 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2001-08-24 19:10:30 +0000
commita7e7894247de459f0be84c29c45f39c35a595b4d (patch)
tree18f99968220cd9774b6d50208d035f2b1ecb4d71 /mdk-stage1
parenta1c0fbf2e70fa42b7bf3f0167b9b564dccd6bc4c (diff)
downloaddrakx-backup-do-not-use-a7e7894247de459f0be84c29c45f39c35a595b4d.tar
drakx-backup-do-not-use-a7e7894247de459f0be84c29c45f39c35a595b4d.tar.gz
drakx-backup-do-not-use-a7e7894247de459f0be84c29c45f39c35a595b4d.tar.bz2
drakx-backup-do-not-use-a7e7894247de459f0be84c29c45f39c35a595b4d.tar.xz
drakx-backup-do-not-use-a7e7894247de459f0be84c29c45f39c35a595b4d.zip
allow unsetting of automatic mode if not enough parameter provided in network steps
Diffstat (limited to 'mdk-stage1')
-rw-r--r--mdk-stage1/network.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/mdk-stage1/network.c b/mdk-stage1/network.c
index 6eb28e5e5..ae2c685d2 100644
--- a/mdk-stage1/network.c
+++ b/mdk-stage1/network.c
@@ -640,8 +640,10 @@ enum return_type nfs_prepare(void)
results = ask_from_entries_auto("Please enter the name or IP address of your NFS server, "
"and the directory containing the " DISTRIB_NAME " Distribution.",
questions, &answers, 40, questions_auto, NULL);
- if (results != RETURN_OK)
+ if (results != RETURN_OK || streq(answers[0], "")) {
+ unset_param(MODE_AUTOMATIC); /* we are in a fallback mode */
return nfs_prepare();
+ }
nfsmount_location = malloc(strlen(answers[0]) + strlen(answers[1]) + 2);
strcpy(nfsmount_location, answers[0]);
@@ -706,8 +708,10 @@ enum return_type ftp_prepare(void)
"the directory containing the " DISTRIB_NAME " Distribution, "
"and the login/pass if necessary (leave login blank for anonymous).",
questions, &answers, 40, questions_auto, NULL);
- if (results != RETURN_OK)
+ if (results != RETURN_OK || streq(answers[0], "")) {
+ unset_param(MODE_AUTOMATIC); /* we are in a fallback mode */
return ftp_prepare();
+ }
log_message("FTP: trying to connect to %s", answers[0]);
@@ -723,7 +727,6 @@ enum return_type ftp_prepare(void)
results = RETURN_BACK;
continue;
}
-
strcpy(location_full, answers[1]);
strcat(location_full, get_ramdisk_realname());
@@ -790,8 +793,10 @@ enum return_type http_prepare(void)
results = ask_from_entries_auto("Please enter the name or IP address of the HTTP server, "
"and the directory containing the " DISTRIB_NAME " Distribution.",
questions, &answers, 40, questions_auto, NULL);
- if (results != RETURN_OK)
+ if (results != RETURN_OK || streq(answers[0], "")) {
+ unset_param(MODE_AUTOMATIC); /* we are in a fallback mode */
return http_prepare();
+ }
strcpy(location_full, answers[1]);
strcat(location_full, get_ramdisk_realname());