This should fix the last of the ftp path problems.

It was all a bit more complex than it first looked.
This commit is contained in:
jkh 1995-05-26 11:21:53 +00:00
parent 42fcb45257
commit feafd49ede
7 changed files with 64 additions and 50 deletions

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: label.c,v 1.24 1995/05/25 01:22:16 jkh Exp $
* $Id: label.c,v 1.25 1995/05/25 18:48:26 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -201,7 +201,7 @@ get_mountpoint(struct chunk *old)
val = msgGetInput(old && old->private ? ((PartInfo *)old->private)->mountpoint : NULL,
"Please specify a mount point for the partition");
if (!val) {
if (!val || !*val) {
if (!old)
return NULL;
else {
@ -369,8 +369,7 @@ print_label_chunks(void)
}
for (j = 0; j < MAX_MOUNT_NAME && mountpoint[j]; j++)
onestr[PART_MOUNT_COL + j] = mountpoint[j];
snprintf(num, 10, "%4ldMB", label_chunk_info[i].c->size ?
label_chunk_info[i].c->size / ONE_MEG : 0);
snprintf(num, 10, "%4ldMB", label_chunk_info[i].c->size ? label_chunk_info[i].c->size / ONE_MEG : 0);
memcpy(onestr + PART_SIZE_COL, num, strlen(num));
memcpy(onestr + PART_NEWFS_COL, newfs, strlen(newfs));
onestr[PART_NEWFS_COL + strlen(newfs)] = '\0';
@ -495,8 +494,15 @@ diskLabelEditor(char *str)
size *= ONE_MEG;
else if (toupper(*cp) == 'C')
size *= (label_chunk_info[here].c->disk->bios_hd * label_chunk_info[here].c->disk->bios_sect);
else if (*cp == '%')
size = sz * (size * 0.10);
else if (*cp == '%') {
float fsz, fsize;
fsz = (float)sz;
fsize = (float)size;
fsize *= 0.10;
fsz *= fsize;
size = (int)fsz;
}
}
type = get_partition_type();
if (type == PART_NONE)

View File

@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
* $Id: media_strategy.c,v 1.24 1995/05/26 10:20:47 jkh Exp $
* $Id: media_strategy.c,v 1.25 1995/05/26 10:58:51 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -711,8 +711,10 @@ mediaGetFTP(char *dist, char *path)
const char *tmp;
struct attribs *dist_attr;
if (!path)
path = "";
msgNotify("Attempting to retreive `%s' over FTP", dist);
snprintf(buf, PATH_MAX, "/stand/info/%s%s.inf", path ? path : "", dist);
snprintf(buf, PATH_MAX, "/stand/info/%s%s.inf", path, dist);
if (!access(buf, R_OK)) {
msgDebug("Parsing attributes file for %s\n", dist);
dist_attr = safe_malloc(sizeof(struct attribs) * MAX_ATTRIBS);
@ -731,11 +733,11 @@ mediaGetFTP(char *dist, char *path)
/* Take the lack of an info file to mean we're a fully qualified name */
if (!numchunks) {
sprintf(buf, "%s%s", path ? path : "", dist);
sprintf(buf, "%s%s", path, dist);
return(FtpGet(ftp, buf));
}
else if (numchunks == 1) {
snprintf(buf, 512, "%s.aa", dist);
snprintf(buf, 512, "%s%s.aa", path, dist);
return(FtpGet(ftp, buf));
}
@ -764,7 +766,7 @@ mediaGetFTP(char *dist, char *path)
char buffer[10240];
int n;
snprintf(buf, 512, "%s.%c%c", dist, (chunk / 26) + 'a', (chunk % 26) + 'a');
snprintf(buf, 512, "%s%s.%c%c", path, dist, (chunk / 26) + 'a', (chunk % 26) + 'a');
fd = FtpGet(ftp, buf);
if (fd < 0)

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: menus.c,v 1.30 1995/05/25 18:48:29 jkh Exp $
* $Id: menus.c,v 1.31 1995/05/26 08:41:46 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -590,16 +590,14 @@ your disk until you select the \"Install\" menu item (and even then, only\n\
after a final confirmation). Select Cancel to leave this menu.",
"Press F1 to read the installation guide",
"install.hlp",
{ { "Distributions", "Choose the type of installation you want", /* T */
DMENU_SUBMENU, &MenuInstallType, 0, 0 },
{ "Media", "Choose the installation media type", /* M */
DMENU_SUBMENU, &MenuMedia, 0, 0 },
{ "Partition", "Allocate disk space for FreeBSD", /* P */
{ { "Partition", "Allocate disk space for FreeBSD", /* P */
DMENU_CALL, diskPartitionEditor, 0, 0 },
{ "Label", "Label allocated disk partitions", /* L */
DMENU_CALL, diskLabelEditor, 0, 0 },
{ "Networking", "Configure this host on a network", /* N */
DMENU_CALL, tcpDeviceSelect, 0, 0 },
{ "Distributions", "Choose the type of installation you want", /* T */
DMENU_SUBMENU, &MenuInstallType, 0, 0 },
{ "Media", "Choose the installation media type", /* M */
DMENU_SUBMENU, &MenuMedia, 0, 0 },
{ "Install", "Install FreeBSD onto your hard disk(s)", /* I */
DMENU_CALL, installCommit, 0, 0 },
{ "Configure", "Do post-install configuration of FreeBSD", /* C */
@ -643,7 +641,7 @@ When you're done, select Cancel",
"configure.hlp",
{ { "Add User", "Add users to the system",
DMENU_SYSTEM_COMMAND, "adduser", 0, 0 },
{ "Networking", "Configure network",
{ "Networking", "Configure additional network devices",
DMENU_CALL, tcpDeviceSelect, 0, 0 },
{ "Time Zone", "Set which time zone you're in",
DMENU_SYSTEM_COMMAND, "tzsetup", 0, 0 },

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: label.c,v 1.24 1995/05/25 01:22:16 jkh Exp $
* $Id: label.c,v 1.25 1995/05/25 18:48:26 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -201,7 +201,7 @@ get_mountpoint(struct chunk *old)
val = msgGetInput(old && old->private ? ((PartInfo *)old->private)->mountpoint : NULL,
"Please specify a mount point for the partition");
if (!val) {
if (!val || !*val) {
if (!old)
return NULL;
else {
@ -369,8 +369,7 @@ print_label_chunks(void)
}
for (j = 0; j < MAX_MOUNT_NAME && mountpoint[j]; j++)
onestr[PART_MOUNT_COL + j] = mountpoint[j];
snprintf(num, 10, "%4ldMB", label_chunk_info[i].c->size ?
label_chunk_info[i].c->size / ONE_MEG : 0);
snprintf(num, 10, "%4ldMB", label_chunk_info[i].c->size ? label_chunk_info[i].c->size / ONE_MEG : 0);
memcpy(onestr + PART_SIZE_COL, num, strlen(num));
memcpy(onestr + PART_NEWFS_COL, newfs, strlen(newfs));
onestr[PART_NEWFS_COL + strlen(newfs)] = '\0';
@ -495,8 +494,15 @@ diskLabelEditor(char *str)
size *= ONE_MEG;
else if (toupper(*cp) == 'C')
size *= (label_chunk_info[here].c->disk->bios_hd * label_chunk_info[here].c->disk->bios_sect);
else if (*cp == '%')
size = sz * (size * 0.10);
else if (*cp == '%') {
float fsz, fsize;
fsz = (float)sz;
fsize = (float)size;
fsize *= 0.10;
fsz *= fsize;
size = (int)fsz;
}
}
type = get_partition_type();
if (type == PART_NONE)

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: menus.c,v 1.30 1995/05/25 18:48:29 jkh Exp $
* $Id: menus.c,v 1.31 1995/05/26 08:41:46 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -590,16 +590,14 @@ your disk until you select the \"Install\" menu item (and even then, only\n\
after a final confirmation). Select Cancel to leave this menu.",
"Press F1 to read the installation guide",
"install.hlp",
{ { "Distributions", "Choose the type of installation you want", /* T */
DMENU_SUBMENU, &MenuInstallType, 0, 0 },
{ "Media", "Choose the installation media type", /* M */
DMENU_SUBMENU, &MenuMedia, 0, 0 },
{ "Partition", "Allocate disk space for FreeBSD", /* P */
{ { "Partition", "Allocate disk space for FreeBSD", /* P */
DMENU_CALL, diskPartitionEditor, 0, 0 },
{ "Label", "Label allocated disk partitions", /* L */
DMENU_CALL, diskLabelEditor, 0, 0 },
{ "Networking", "Configure this host on a network", /* N */
DMENU_CALL, tcpDeviceSelect, 0, 0 },
{ "Distributions", "Choose the type of installation you want", /* T */
DMENU_SUBMENU, &MenuInstallType, 0, 0 },
{ "Media", "Choose the installation media type", /* M */
DMENU_SUBMENU, &MenuMedia, 0, 0 },
{ "Install", "Install FreeBSD onto your hard disk(s)", /* I */
DMENU_CALL, installCommit, 0, 0 },
{ "Configure", "Do post-install configuration of FreeBSD", /* C */
@ -643,7 +641,7 @@ When you're done, select Cancel",
"configure.hlp",
{ { "Add User", "Add users to the system",
DMENU_SYSTEM_COMMAND, "adduser", 0, 0 },
{ "Networking", "Configure network",
{ "Networking", "Configure additional network devices",
DMENU_CALL, tcpDeviceSelect, 0, 0 },
{ "Time Zone", "Set which time zone you're in",
DMENU_SYSTEM_COMMAND, "tzsetup", 0, 0 },

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: label.c,v 1.24 1995/05/25 01:22:16 jkh Exp $
* $Id: label.c,v 1.25 1995/05/25 18:48:26 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -201,7 +201,7 @@ get_mountpoint(struct chunk *old)
val = msgGetInput(old && old->private ? ((PartInfo *)old->private)->mountpoint : NULL,
"Please specify a mount point for the partition");
if (!val) {
if (!val || !*val) {
if (!old)
return NULL;
else {
@ -369,8 +369,7 @@ print_label_chunks(void)
}
for (j = 0; j < MAX_MOUNT_NAME && mountpoint[j]; j++)
onestr[PART_MOUNT_COL + j] = mountpoint[j];
snprintf(num, 10, "%4ldMB", label_chunk_info[i].c->size ?
label_chunk_info[i].c->size / ONE_MEG : 0);
snprintf(num, 10, "%4ldMB", label_chunk_info[i].c->size ? label_chunk_info[i].c->size / ONE_MEG : 0);
memcpy(onestr + PART_SIZE_COL, num, strlen(num));
memcpy(onestr + PART_NEWFS_COL, newfs, strlen(newfs));
onestr[PART_NEWFS_COL + strlen(newfs)] = '\0';
@ -495,8 +494,15 @@ diskLabelEditor(char *str)
size *= ONE_MEG;
else if (toupper(*cp) == 'C')
size *= (label_chunk_info[here].c->disk->bios_hd * label_chunk_info[here].c->disk->bios_sect);
else if (*cp == '%')
size = sz * (size * 0.10);
else if (*cp == '%') {
float fsz, fsize;
fsz = (float)sz;
fsize = (float)size;
fsize *= 0.10;
fsz *= fsize;
size = (int)fsz;
}
}
type = get_partition_type();
if (type == PART_NONE)

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: menus.c,v 1.30 1995/05/25 18:48:29 jkh Exp $
* $Id: menus.c,v 1.31 1995/05/26 08:41:46 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -590,16 +590,14 @@ your disk until you select the \"Install\" menu item (and even then, only\n\
after a final confirmation). Select Cancel to leave this menu.",
"Press F1 to read the installation guide",
"install.hlp",
{ { "Distributions", "Choose the type of installation you want", /* T */
DMENU_SUBMENU, &MenuInstallType, 0, 0 },
{ "Media", "Choose the installation media type", /* M */
DMENU_SUBMENU, &MenuMedia, 0, 0 },
{ "Partition", "Allocate disk space for FreeBSD", /* P */
{ { "Partition", "Allocate disk space for FreeBSD", /* P */
DMENU_CALL, diskPartitionEditor, 0, 0 },
{ "Label", "Label allocated disk partitions", /* L */
DMENU_CALL, diskLabelEditor, 0, 0 },
{ "Networking", "Configure this host on a network", /* N */
DMENU_CALL, tcpDeviceSelect, 0, 0 },
{ "Distributions", "Choose the type of installation you want", /* T */
DMENU_SUBMENU, &MenuInstallType, 0, 0 },
{ "Media", "Choose the installation media type", /* M */
DMENU_SUBMENU, &MenuMedia, 0, 0 },
{ "Install", "Install FreeBSD onto your hard disk(s)", /* I */
DMENU_CALL, installCommit, 0, 0 },
{ "Configure", "Do post-install configuration of FreeBSD", /* C */
@ -643,7 +641,7 @@ When you're done, select Cancel",
"configure.hlp",
{ { "Add User", "Add users to the system",
DMENU_SYSTEM_COMMAND, "adduser", 0, 0 },
{ "Networking", "Configure network",
{ "Networking", "Configure additional network devices",
DMENU_CALL, tcpDeviceSelect, 0, 0 },
{ "Time Zone", "Set which time zone you're in",
DMENU_SYSTEM_COMMAND, "tzsetup", 0, 0 },