summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/disk.c
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2004-06-15 09:16:41 +0000
committerOlivier Blin <oblin@mandriva.org>2004-06-15 09:16:41 +0000
commite813e1eb1a495f2d11b9c25c600d5c1fb32fe073 (patch)
tree65d51fc51860b2f2feda2443e4ce872121270f81 /mdk-stage1/disk.c
parent90454d65291b4f33913880d179ae5439e386c7fa (diff)
downloaddrakx-e813e1eb1a495f2d11b9c25c600d5c1fb32fe073.tar
drakx-e813e1eb1a495f2d11b9c25c600d5c1fb32fe073.tar.gz
drakx-e813e1eb1a495f2d11b9c25c600d5c1fb32fe073.tar.bz2
drakx-e813e1eb1a495f2d11b9c25c600d5c1fb32fe073.tar.xz
drakx-e813e1eb1a495f2d11b9c25c600d5c1fb32fe073.zip
redesign of the ISO image selection dialog, add an entry in the list to allow to use the directory as a mirror tree
Diffstat (limited to 'mdk-stage1/disk.c')
-rw-r--r--mdk-stage1/disk.c37
1 files changed, 26 insertions, 11 deletions
diff --git a/mdk-stage1/disk.c b/mdk-stage1/disk.c
index 3d47bc595..83ec0ae01 100644
--- a/mdk-stage1/disk.c
+++ b/mdk-stage1/disk.c
@@ -264,8 +264,8 @@ static enum return_type try_with_device(char *dev_name)
#ifndef MANDRAKE_MOVE
if (!stat(location_full, &statbuf) && S_ISDIR(statbuf.st_mode)) {
char **file;
- char *stage2_isos[100];
- int stage2_iso_number = 0;
+ char *stage2_isos[100] = { "Use directory as a mirror tree", "-----" };
+ int stage2_iso_number = 2;
log_message("\"%s\" exists and is a directory, looking for iso files", location_full);
@@ -305,15 +305,30 @@ static enum return_type try_with_device(char *dev_name)
stage2_isos[stage2_iso_number] = NULL;
- if (stage2_iso_number > 0) {
- results = ask_from_list("Please choose the ISO image to be used to install the " DISTRIB_NAME
- " Distribution, or cancel to use this directory as a mirror tree.",
- stage2_isos, file);
- if (results == RETURN_OK) {
- strcat(location_full, "/");
- strcat(location_full, *file);
- log_message("installer will use ISO image \"%s\"", location_full);
- }
+ if (stage2_iso_number > 2) {
+ do {
+ results = ask_from_list("Please choose the ISO image to be used to install the "
+ DISTRIB_NAME " Distribution.",
+ stage2_isos, file);
+ if (results == RETURN_BACK) {
+ umount(disk_own_mount);
+ return try_with_device(dev_name);
+ } else if (results == RETURN_OK) {
+ if (!strcmp(*file, stage2_isos[0])) {
+ /* use directory as a mirror tree */
+ continue;
+ } else if (!strcmp(*file, stage2_isos[1])) {
+ /* the separator has been selected */
+ results = RETURN_ERROR;
+ continue;
+ } else {
+ /* use selected ISO image */
+ strcat(location_full, "/");
+ strcat(location_full, *file);
+ log_message("installer will use ISO image \"%s\"", location_full);
+ }
+ }
+ } while (results == RETURN_ERROR);
} else {
log_message("no ISO image found in \"%s\" directory", location_full);
}