Deleted Added
full compact
config.c (14694) config.c (14738)
1/*
2 * The new sysinstall program.
3 *
4 * This is probably the last program in the `sysinstall' line - the next
5 * generation being essentially a complete rewrite.
6 *
1/*
2 * The new sysinstall program.
3 *
4 * This is probably the last program in the `sysinstall' line - the next
5 * generation being essentially a complete rewrite.
6 *
7 * $Id: config.c,v 1.19 1996/03/18 15:27:44 jkh Exp $
7 * $Id: config.c,v 1.20 1996/03/19 11:51:36 jkh Exp $
8 *
9 * Copyright (c) 1995
10 * Jordan Hubbard. All rights reserved.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright

--- 387 unchanged lines hidden (view full) ---

403 return variable_get_value(VAR_ROUTEDFLAGS,
404 "Specify the flags for routed; -q is the default, -s is\n"
405 "a good choice for gateway machines.") ? RET_SUCCESS : RET_FAIL;
406}
407
408int
409configPackages(char *str)
410{
8 *
9 * Copyright (c) 1995
10 * Jordan Hubbard. All rights reserved.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright

--- 387 unchanged lines hidden (view full) ---

403 return variable_get_value(VAR_ROUTEDFLAGS,
404 "Specify the flags for routed; -q is the default, -s is\n"
405 "a good choice for gateway machines.") ? RET_SUCCESS : RET_FAIL;
406}
407
408int
409configPackages(char *str)
410{
411 PkgNode top, plist;
411 static PkgNode top, plist;
412 static Boolean index_initted = FALSE;
413 PkgNodePtr tmp;
412 int fd;
413
414 if (!mediaVerify())
415 return RET_FAIL;
416
417 if (!mediaDevice->init(mediaDevice))
418 return RET_FAIL;
414 int fd;
415
416 if (!mediaVerify())
417 return RET_FAIL;
418
419 if (!mediaDevice->init(mediaDevice))
420 return RET_FAIL;
419
420 msgNotify("Attempting to fetch packages/INDEX file from selected media.");
421 fd = mediaDevice->get(mediaDevice, "packages/INDEX", TRUE);
422 if (fd < 0) {
423 dialog_clear();
424 msgConfirm("Unable to get packages/INDEX file from selected media.\n"
425 "This may be because the packages collection is not available at\n"
426 "on the distribution media you've chosen (most likely an FTP site\n"
427 "without the packages collection mirrored). Please verify media\n"
428 "(or path to media) and try again. If your local site does not\n"
429 "carry the packages collection, then we recommend either a CD\n"
430 "distribution or the master distribution on ftp.freebsd.org.");
431 return RET_FAIL;
432 }
433 msgNotify("Got INDEX successfully, now building packages menu..");
434 index_init(&top, &plist);
435 if (index_read(fd, &top)) {
436 dialog_clear();
437 msgConfirm("I/O or format error on packages/INDEX file.\n"
438 "Please verify media (or path to media) and try again.");
421
422 if (!index_initted) {
423 msgNotify("Attempting to fetch packages/INDEX file from selected media.");
424 fd = mediaDevice->get(mediaDevice, "packages/INDEX", TRUE);
425 if (fd < 0) {
426 dialog_clear();
427 msgConfirm("Unable to get packages/INDEX file from selected media.\n"
428 "This may be because the packages collection is not available at\n"
429 "on the distribution media you've chosen (most likely an FTP site\n"
430 "without the packages collection mirrored). Please verify media\n"
431 "(or path to media) and try again. If your local site does not\n"
432 "carry the packages collection, then we recommend either a CD\n"
433 "distribution or the master distribution on ftp.freebsd.org.");
434 return RET_FAIL;
435 }
436 msgNotify("Got INDEX successfully, now building packages menu..");
437 index_init(&top, &plist);
438 if (index_read(fd, &top)) {
439 dialog_clear();
440 msgConfirm("I/O or format error on packages/INDEX file.\n"
441 "Please verify media (or path to media) and try again.");
442 mediaDevice->close(mediaDevice, fd);
443 return RET_FAIL;
444 }
439 mediaDevice->close(mediaDevice, fd);
445 mediaDevice->close(mediaDevice, fd);
440 return RET_FAIL;
446 index_sort(&top);
447 index_initted = TRUE;
441 }
448 }
442 mediaDevice->close(mediaDevice, fd);
443 index_sort(&top);
444 while (1) {
445 int ret, pos, scroll;
446
447 /* Bring up the packages menu */
448 pos = scroll = 0;
449 index_menu(&top, &plist, &pos, &scroll);
450
451 if (plist.kids) {

--- 8 unchanged lines hidden (view full) ---

460 }
461 }
462 else {
463 dialog_clear();
464 msgConfirm("No packages were selected for extraction.");
465 break;
466 }
467 }
449 while (1) {
450 int ret, pos, scroll;
451
452 /* Bring up the packages menu */
453 pos = scroll = 0;
454 index_menu(&top, &plist, &pos, &scroll);
455
456 if (plist.kids) {

--- 8 unchanged lines hidden (view full) ---

465 }
466 }
467 else {
468 dialog_clear();
469 msgConfirm("No packages were selected for extraction.");
470 break;
471 }
472 }
468 index_node_free(&top, &plist);
473 tmp = &plist;
474 while (tmp) {
475 PkgNodePtr tmp2 = tmp->next;
476
477 safe_free(tmp);
478 tmp = tmp2;
479 }
480 index_init(NULL, &plist);
469 mediaDevice->shutdown(mediaDevice);
470 return RET_SUCCESS;
471}
472
473int
474configPorts(char *str)
475{
476 char *cp, *dist = NULL; /* Shut up compiler */

--- 60 unchanged lines hidden ---
481 mediaDevice->shutdown(mediaDevice);
482 return RET_SUCCESS;
483}
484
485int
486configPorts(char *str)
487{
488 char *cp, *dist = NULL; /* Shut up compiler */

--- 60 unchanged lines hidden ---