From d387f3a0a99b84c361775c58a44002ed3511c815 Mon Sep 17 00:00:00 2001 From: jkh Date: Tue, 16 Sep 1997 10:14:23 +0000 Subject: MF22: pst's changes. Submitted by: pst --- usr.sbin/sysinstall/dist.c | 9 +++++---- usr.sbin/sysinstall/label.c | 38 ++++++++++++++++++++------------------ usr.sbin/sysinstall/package.c | 9 ++++++--- usr.sbin/sysinstall/termcap.c | 13 ++++++++----- 4 files changed, 39 insertions(+), 30 deletions(-) (limited to 'usr.sbin/sysinstall') diff --git a/usr.sbin/sysinstall/dist.c b/usr.sbin/sysinstall/dist.c index ed40651..f0f3d19 100644 --- a/usr.sbin/sysinstall/dist.c +++ b/usr.sbin/sysinstall/dist.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: dist.c,v 1.111 1997/07/01 03:50:58 jkh Exp $ + * $Id: dist.c,v 1.112 1997/09/09 16:26:29 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -390,13 +390,14 @@ distSetByName(Distribution *dist, char *name) /* This is shorthand for "dist currently disabled" */ if (!dist[i].my_dir) continue; - else if (!strcmp(dist[i].my_name, name)) { + if (!strcmp(dist[i].my_name, name)) { *(dist[i].my_mask) |= dist[i].my_bit; status = TRUE; } - else if (dist[i].my_dist) { - if (distSetByName(dist[i].my_dist, name)) + if (dist[i].my_dist) { + if (distSetByName(dist[i].my_dist, name)) { status = TRUE; + } } } return status; diff --git a/usr.sbin/sysinstall/label.c b/usr.sbin/sysinstall/label.c index 0e745ed..161560d 100644 --- a/usr.sbin/sysinstall/label.c +++ b/usr.sbin/sysinstall/label.c @@ -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.72 1997/08/11 13:08:26 jkh Exp $ + * $Id: label.c,v 1.73 1997/09/09 16:32:01 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -756,25 +756,27 @@ diskLabel(char *str) sz = atoi(cp) * ONE_MEG; else sz = space_free(label_chunk_info[here].c); - if (!sz || sz < (USR_MIN_SIZE * ONE_MEG)) { - msgConfirm("Less than %dMB free for /usr - you will need to\n" - "partition your disk manually with a custom install!", USR_MIN_SIZE); - clear_wins(); - break; - } + if (sz) { + if (sz < (USR_MIN_SIZE * ONE_MEG)) { + msgConfirm("Less than %dMB free for /usr - you will need to\n" + "partition your disk manually with a custom install!", USR_MIN_SIZE); + clear_wins(); + break; + } - tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk, - label_chunk_info[here].c, - sz, part, FS_BSDFFS, 0); - if (!tmp) { - msgConfirm("Unable to create the /usr partition. Not enough space?\n" - "You will need to partition your disk manually with a custom install!"); - clear_wins(); - break; + tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk, + label_chunk_info[here].c, + sz, part, FS_BSDFFS, 0); + if (!tmp) { + msgConfirm("Unable to create the /usr partition. Not enough space?\n" + "You will need to partition your disk manually with a custom install!"); + clear_wins(); + break; + } + tmp->private_data = new_part("/usr", TRUE, tmp->size); + tmp->private_free = safe_free; + record_label_chunks(devs); } - tmp->private_data = new_part("/usr", TRUE, tmp->size); - tmp->private_free = safe_free; - record_label_chunks(devs); } /* At this point, we're reasonably "labelled" */ if (((cp = variable_get(DISK_LABELLED)) == NULL) || (strcmp(cp, "written"))) diff --git a/usr.sbin/sysinstall/package.c b/usr.sbin/sysinstall/package.c index ba56291..25cd40b 100644 --- a/usr.sbin/sysinstall/package.c +++ b/usr.sbin/sysinstall/package.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: package.c,v 1.61 1997/03/22 15:20:51 jkh Exp $ + * $Id: package.c,v 1.62 1997/06/13 17:55:32 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -96,7 +96,7 @@ int package_extract(Device *dev, char *name, Boolean depended) { char path[511]; - int ret; + int ret, last_msg = 0; FILE *fp; /* Check to make sure it's not already there */ @@ -165,7 +165,10 @@ package_extract(Device *dev, char *name, Boolean depended) seconds = stop.tv_sec + (stop.tv_usec / 1000000.0); if (!seconds) seconds = 1; - msgInfo("%10d bytes read from package %s @ %4.1f KBytes/second", tot, name, (tot / seconds) / 1024.0); + if (seconds != last_msg) { + last_msg = seconds; + msgInfo("%10d bytes read from package %s @ %4.1f KBytes/second", tot, name, (tot / seconds) / 1024.0); + } /* Write it out */ if (sigpipe_caught || write(pfd[1], buf, i) != i) { msgInfo("Write failure to pkg_add! Package may be corrupt."); diff --git a/usr.sbin/sysinstall/termcap.c b/usr.sbin/sysinstall/termcap.c index fa9c19f..1569479 100644 --- a/usr.sbin/sysinstall/termcap.c +++ b/usr.sbin/sysinstall/termcap.c @@ -94,17 +94,20 @@ set_termcap(void) if (setenv("TERMCAP", termcap, 1) < 0) return -1; } - if (DebugFD == -1) - DebugFD = dup(1); + if (DebugFD < 0) + DebugFD = open("/dev/null", O_RDWR, 0); } else { int i, on; if (getpid() == 1) { DebugFD = open("/dev/ttyv1", O_WRONLY); - on = 1; - i = ioctl(DebugFD, TIOCCONS, (char *)&on); - msgDebug("ioctl(%d, TIOCCONS, NULL) = %d (%s)\n", DebugFD, i, !i ? "success" : strerror(errno)); + if (DebugFD != -1) { + on = 1; + i = ioctl(DebugFD, TIOCCONS, (char *)&on); + msgDebug("ioctl(%d, TIOCCONS, NULL) = %d (%s)\n", + DebugFD, i, !i ? "success" : strerror(errno)); + } } if (ColorDisplay) { if (!term) { -- cgit v1.1