diff options
author | jkh <jkh@FreeBSD.org> | 1995-05-07 03:38:03 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1995-05-07 03:38:03 +0000 |
commit | c1b5993cf895a37502a3b5ae658e2bc90605c080 (patch) | |
tree | e3d8896e4065dea04b57dd9af9325069f2ccb31c /usr.sbin | |
parent | c4a6192603a89e8d5fb51a76d609c24131568108 (diff) | |
download | FreeBSD-src-c1b5993cf895a37502a3b5ae658e2bc90605c080.zip FreeBSD-src-c1b5993cf895a37502a3b5ae658e2bc90605c080.tar.gz |
Correct a few ordering errors in how the partitions were being displayed.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/sade/devices.c | 11 | ||||
-rw-r--r-- | usr.sbin/sade/disks.c | 35 | ||||
-rw-r--r-- | usr.sbin/sade/main.c | 5 | ||||
-rw-r--r-- | usr.sbin/sade/msg.c | 10 | ||||
-rw-r--r-- | usr.sbin/sade/system.c | 8 | ||||
-rw-r--r-- | usr.sbin/sysinstall/devices.c | 11 | ||||
-rw-r--r-- | usr.sbin/sysinstall/disks.c | 35 | ||||
-rw-r--r-- | usr.sbin/sysinstall/main.c | 5 | ||||
-rw-r--r-- | usr.sbin/sysinstall/msg.c | 10 | ||||
-rw-r--r-- | usr.sbin/sysinstall/system.c | 8 |
10 files changed, 74 insertions, 64 deletions
diff --git a/usr.sbin/sade/devices.c b/usr.sbin/sade/devices.c index 6260b78..d361580 100644 --- a/usr.sbin/sade/devices.c +++ b/usr.sbin/sade/devices.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: devices.c,v 1.5 1995/05/05 23:47:38 jkh Exp $ + * $Id: devices.c,v 1.6 1995/05/06 09:34:09 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -102,11 +102,10 @@ print_chunks(struct disk *d) { int row; int i; - int b_attr = ColorDisplay ? A_BOLD : A_UNDERLINE; attrset(A_NORMAL); mvaddstr(0, 0, "Disk name:\t"); - attrset(b_attr); addstr(d->name); attrset(A_NORMAL); + attrset(A_REVERSE); addstr(d->name); attrset(A_NORMAL); attrset(A_REVERSE); mvaddstr(0, 55, "Master Partition Editor"); attrset(A_NORMAL); mvprintw(1, 0, "BIOS Geometry:\t%lu cyls/%lu heads/%lu sectors", @@ -116,7 +115,7 @@ print_chunks(struct disk *d) "Subtype", "Flags"); for (i = 0, row = CHUNK_START_ROW; chunk_info[i]; i++, row++) { if (i == current_chunk) - attrset(b_attr); + attrset(A_REVERSE); mvprintw(row, 2, "%10lu %10lu %10lu %8s %8d %8s %8d %6lx", chunk_info[i]->offset, chunk_info[i]->size, chunk_info[i]->end, chunk_info[i]->name, @@ -130,14 +129,12 @@ print_chunks(struct disk *d) static void print_command_summary() { - int b_attr = ColorDisplay ? A_BOLD : A_UNDERLINE; - mvprintw(14, 0, "The following commands are supported (in upper or lower case):"); mvprintw(16, 0, "A = Use Entire Disk B = Bad Block Scan C = Create Partition"); mvprintw(17, 0, "D = Delete Partition G = Set BIOS Geometry S = Set Bootable"); mvprintw(18, 0, "U = Undo All Changes W = `Wizard' Mode ESC = Proceed to next screen"); mvprintw(20, 0, "The currently selected partition is displayed in "); - attrset(b_attr); addstr(ColorDisplay ? "bold" : "underline"); attrset(A_NORMAL); + attrset(A_REVERSE); addstr("reverse video"); attrset(A_NORMAL); move(0, 0); } diff --git a/usr.sbin/sade/disks.c b/usr.sbin/sade/disks.c index 39b5d44..730f3b2 100644 --- a/usr.sbin/sade/disks.c +++ b/usr.sbin/sade/disks.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: disks.c,v 1.3 1995/05/06 09:34:11 jkh Exp $ + * $Id: disks.c,v 1.4 1995/05/07 02:04:25 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -135,15 +135,22 @@ record_fbsd_chunks(struct disk **disks) if (!disks[i]->chunks) msgFatal("No chunk list found for %s!", disks[i]->name); - c1 = disks[i]->chunks->part; - while (c1) { - if (c1->type == freebsd) { - struct chunk *c2 = c1->part; + /* Put the freebsd chunks first */ + for (c1 = disks[i]->chunks->part; c1; c1 = c1->next) { + if (c1->type == freebsd) { fbsd_chunk_info[j].type = PART_SLICE; fbsd_chunk_info[j].d = disks[i]; fbsd_chunk_info[j].c = c1; fbsd_chunk_info[j++].p = NULL; + } + } + + /* Then buzz through and pick up the partitions */ + for (c1 = disks[i]->chunks->part; c1; c1 = c1->next) { + if (c1->type == freebsd) { + struct chunk *c2 = c1->part; + while (c2) { if (c2->type == part) { if (c2->subtype == FS_SWAP) @@ -157,7 +164,6 @@ record_fbsd_chunks(struct disk **disks) c2 = c2->next; } } - c1 = c1->next; } } fbsd_chunk_info[j].d = NULL; @@ -227,7 +233,7 @@ get_partition_type(struct chunk *c) static void print_fbsd_chunks(void) { - int i, srow, prow, pcol; + int i, j, srow, prow, pcol; int sz; attrset(A_REVERSE); @@ -246,8 +252,9 @@ print_fbsd_chunks(void) attrset(A_NORMAL); attrset(A_UNDERLINE); - mvaddstr(CHUNK_PART_START_ROW - 1, PART_SIZE_COL + (i * PART_OFF), + mvaddstr(CHUNK_PART_START_ROW - 1, PART_SIZE_COL + (i * PART_OFF) + 2, "Size"); + attrset(A_NORMAL); attrset(A_UNDERLINE); mvaddstr(CHUNK_PART_START_ROW - 1, PART_NEWFS_COL + (i * PART_OFF), @@ -260,7 +267,7 @@ print_fbsd_chunks(void) for (i = 0; fbsd_chunk_info[i].d; i++) { if (i == current_chunk) - attrset(ColorDisplay ? A_BOLD : A_UNDERLINE); + attrset(A_REVERSE); /* Is it a slice entry displayed at the top? */ if (fbsd_chunk_info[i].type == PART_SLICE) { sz = space_free(fbsd_chunk_info[i].c); @@ -293,8 +300,8 @@ print_fbsd_chunks(void) mountpoint = "swap"; newfs = " "; } - for (i = 0; i < MAX_MOUNT_NAME && mountpoint[i]; i++) - mvaddch(prow, pcol + PART_MOUNT_COL + i, mountpoint[i]); + for (j = 0; j < MAX_MOUNT_NAME && mountpoint[j]; j++) + mvaddch(prow, pcol + PART_MOUNT_COL + j, mountpoint[j]); mvprintw(prow, pcol + PART_SIZE_COL, "%4dMB", fbsd_chunk_info[i].c->size ? fbsd_chunk_info[i].c->size / 2048 : 0); @@ -309,16 +316,14 @@ print_fbsd_chunks(void) static void print_command_summary() { - int attrs = ColorDisplay ? A_BOLD : A_UNDERLINE; - mvprintw(19, 0, "The following commands are valid here (upper or lower case):"); mvprintw(20, 0, "C = Create FreeBSD Partition D = Delete Partition"); mvprintw(21, 0, "M = Mount Partition (no newfs) ESC = Proceed to summary screen"); mvprintw(22, 0, "The default target will be displayed in "); - attrset(attrs); - addstr(ColorDisplay ? "bold" : "underline"); + attrset(A_REVERSE); + addstr("reverse video"); attrset(A_NORMAL); move(0, 0); } diff --git a/usr.sbin/sade/main.c b/usr.sbin/sade/main.c index 7a89927..c5b85cd 100644 --- a/usr.sbin/sade/main.c +++ b/usr.sbin/sade/main.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated for what's essentially a complete rewrite. * - * $Id: main.c,v 1.2 1995/05/04 03:51:17 jkh Exp $ + * $Id: main.c,v 1.4 1995/05/05 23:47:42 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -60,6 +60,9 @@ main(int argc, char **argv) /* Welcome user to FreeBSD */ systemWelcome(); + /* Default to English */ + /* lang_set_English(NULL); */ + /* Begin user dialog at outer menu */ while (1) { choice = scroll = curr = max = 0; diff --git a/usr.sbin/sade/msg.c b/usr.sbin/sade/msg.c index 9c60c1d..7208994 100644 --- a/usr.sbin/sade/msg.c +++ b/usr.sbin/sade/msg.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: msg.c,v 1.3 1995/05/04 03:51:21 jkh Exp $ + * $Id: msg.c,v 1.6 1995/05/05 23:47:44 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -58,7 +58,7 @@ msgYap(char *fmt, ...) vsnprintf((char *)(errstr + strlen(errstr)), FILENAME_MAX, fmt, args); va_end(args); attrs = getattrs(stdscr); - attrset(A_BOLD); + attrset(A_REVERSE); mvaddstr(23, 0, errstr); attrset(attrs); refresh(); @@ -101,7 +101,7 @@ msgWarn(char *fmt, ...) va_end(args); attrs = getattrs(stdscr); beep(); - attrset(A_BOLD); + attrset(A_REVERSE); mvaddstr(23, 0, errstr); attrset(attrs); refresh(); @@ -123,7 +123,7 @@ msgError(char *fmt, ...) va_end(args); beep(); attrs = getattrs(stdscr); - attrset(A_BOLD); + attrset(A_REVERSE); mvaddstr(23, 0, errstr); attrset(attrs); refresh(); @@ -145,7 +145,7 @@ msgFatal(char *fmt, ...) va_end(args); beep(); attrs = getattrs(stdscr); - attrset(A_BOLD); + attrset(A_REVERSE); mvaddstr(23, 0, errstr); addstr(" - "); addstr("PRESS ANY KEY TO "); diff --git a/usr.sbin/sade/system.c b/usr.sbin/sade/system.c index aad9887..d7783c2 100644 --- a/usr.sbin/sade/system.c +++ b/usr.sbin/sade/system.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: system.c,v 1.5 1995/05/05 23:47:46 jkh Exp $ + * $Id: system.c,v 1.6 1995/05/06 09:34:22 jkh Exp $ * * Jordan Hubbard * @@ -201,7 +201,7 @@ systemHelpFile(char *file, char *buf) fname = buf; } } - else { + if (!fname) { snprintf(buf, FILENAME_MAX, "help/en_US.ISO8859-1/%s", file); if (file_readable(buf)) fname = buf; @@ -238,12 +238,12 @@ systemChangeTerminal(char *color, const u_char c_term[], if (ColorDisplay) { setenv("TERM", color, 1); setenv("TERMCAP", c_term, 1); - setterm(color); + /* setterm(color); */ } else { setenv("TERM", mono, 1); setenv("TERMCAP", m_term, 1); - setterm(mono); + /* setterm(mono); */ } } } diff --git a/usr.sbin/sysinstall/devices.c b/usr.sbin/sysinstall/devices.c index 6260b78..d361580 100644 --- a/usr.sbin/sysinstall/devices.c +++ b/usr.sbin/sysinstall/devices.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: devices.c,v 1.5 1995/05/05 23:47:38 jkh Exp $ + * $Id: devices.c,v 1.6 1995/05/06 09:34:09 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -102,11 +102,10 @@ print_chunks(struct disk *d) { int row; int i; - int b_attr = ColorDisplay ? A_BOLD : A_UNDERLINE; attrset(A_NORMAL); mvaddstr(0, 0, "Disk name:\t"); - attrset(b_attr); addstr(d->name); attrset(A_NORMAL); + attrset(A_REVERSE); addstr(d->name); attrset(A_NORMAL); attrset(A_REVERSE); mvaddstr(0, 55, "Master Partition Editor"); attrset(A_NORMAL); mvprintw(1, 0, "BIOS Geometry:\t%lu cyls/%lu heads/%lu sectors", @@ -116,7 +115,7 @@ print_chunks(struct disk *d) "Subtype", "Flags"); for (i = 0, row = CHUNK_START_ROW; chunk_info[i]; i++, row++) { if (i == current_chunk) - attrset(b_attr); + attrset(A_REVERSE); mvprintw(row, 2, "%10lu %10lu %10lu %8s %8d %8s %8d %6lx", chunk_info[i]->offset, chunk_info[i]->size, chunk_info[i]->end, chunk_info[i]->name, @@ -130,14 +129,12 @@ print_chunks(struct disk *d) static void print_command_summary() { - int b_attr = ColorDisplay ? A_BOLD : A_UNDERLINE; - mvprintw(14, 0, "The following commands are supported (in upper or lower case):"); mvprintw(16, 0, "A = Use Entire Disk B = Bad Block Scan C = Create Partition"); mvprintw(17, 0, "D = Delete Partition G = Set BIOS Geometry S = Set Bootable"); mvprintw(18, 0, "U = Undo All Changes W = `Wizard' Mode ESC = Proceed to next screen"); mvprintw(20, 0, "The currently selected partition is displayed in "); - attrset(b_attr); addstr(ColorDisplay ? "bold" : "underline"); attrset(A_NORMAL); + attrset(A_REVERSE); addstr("reverse video"); attrset(A_NORMAL); move(0, 0); } diff --git a/usr.sbin/sysinstall/disks.c b/usr.sbin/sysinstall/disks.c index 39b5d44..730f3b2 100644 --- a/usr.sbin/sysinstall/disks.c +++ b/usr.sbin/sysinstall/disks.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: disks.c,v 1.3 1995/05/06 09:34:11 jkh Exp $ + * $Id: disks.c,v 1.4 1995/05/07 02:04:25 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -135,15 +135,22 @@ record_fbsd_chunks(struct disk **disks) if (!disks[i]->chunks) msgFatal("No chunk list found for %s!", disks[i]->name); - c1 = disks[i]->chunks->part; - while (c1) { - if (c1->type == freebsd) { - struct chunk *c2 = c1->part; + /* Put the freebsd chunks first */ + for (c1 = disks[i]->chunks->part; c1; c1 = c1->next) { + if (c1->type == freebsd) { fbsd_chunk_info[j].type = PART_SLICE; fbsd_chunk_info[j].d = disks[i]; fbsd_chunk_info[j].c = c1; fbsd_chunk_info[j++].p = NULL; + } + } + + /* Then buzz through and pick up the partitions */ + for (c1 = disks[i]->chunks->part; c1; c1 = c1->next) { + if (c1->type == freebsd) { + struct chunk *c2 = c1->part; + while (c2) { if (c2->type == part) { if (c2->subtype == FS_SWAP) @@ -157,7 +164,6 @@ record_fbsd_chunks(struct disk **disks) c2 = c2->next; } } - c1 = c1->next; } } fbsd_chunk_info[j].d = NULL; @@ -227,7 +233,7 @@ get_partition_type(struct chunk *c) static void print_fbsd_chunks(void) { - int i, srow, prow, pcol; + int i, j, srow, prow, pcol; int sz; attrset(A_REVERSE); @@ -246,8 +252,9 @@ print_fbsd_chunks(void) attrset(A_NORMAL); attrset(A_UNDERLINE); - mvaddstr(CHUNK_PART_START_ROW - 1, PART_SIZE_COL + (i * PART_OFF), + mvaddstr(CHUNK_PART_START_ROW - 1, PART_SIZE_COL + (i * PART_OFF) + 2, "Size"); + attrset(A_NORMAL); attrset(A_UNDERLINE); mvaddstr(CHUNK_PART_START_ROW - 1, PART_NEWFS_COL + (i * PART_OFF), @@ -260,7 +267,7 @@ print_fbsd_chunks(void) for (i = 0; fbsd_chunk_info[i].d; i++) { if (i == current_chunk) - attrset(ColorDisplay ? A_BOLD : A_UNDERLINE); + attrset(A_REVERSE); /* Is it a slice entry displayed at the top? */ if (fbsd_chunk_info[i].type == PART_SLICE) { sz = space_free(fbsd_chunk_info[i].c); @@ -293,8 +300,8 @@ print_fbsd_chunks(void) mountpoint = "swap"; newfs = " "; } - for (i = 0; i < MAX_MOUNT_NAME && mountpoint[i]; i++) - mvaddch(prow, pcol + PART_MOUNT_COL + i, mountpoint[i]); + for (j = 0; j < MAX_MOUNT_NAME && mountpoint[j]; j++) + mvaddch(prow, pcol + PART_MOUNT_COL + j, mountpoint[j]); mvprintw(prow, pcol + PART_SIZE_COL, "%4dMB", fbsd_chunk_info[i].c->size ? fbsd_chunk_info[i].c->size / 2048 : 0); @@ -309,16 +316,14 @@ print_fbsd_chunks(void) static void print_command_summary() { - int attrs = ColorDisplay ? A_BOLD : A_UNDERLINE; - mvprintw(19, 0, "The following commands are valid here (upper or lower case):"); mvprintw(20, 0, "C = Create FreeBSD Partition D = Delete Partition"); mvprintw(21, 0, "M = Mount Partition (no newfs) ESC = Proceed to summary screen"); mvprintw(22, 0, "The default target will be displayed in "); - attrset(attrs); - addstr(ColorDisplay ? "bold" : "underline"); + attrset(A_REVERSE); + addstr("reverse video"); attrset(A_NORMAL); move(0, 0); } diff --git a/usr.sbin/sysinstall/main.c b/usr.sbin/sysinstall/main.c index 7a89927..c5b85cd 100644 --- a/usr.sbin/sysinstall/main.c +++ b/usr.sbin/sysinstall/main.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated for what's essentially a complete rewrite. * - * $Id: main.c,v 1.2 1995/05/04 03:51:17 jkh Exp $ + * $Id: main.c,v 1.4 1995/05/05 23:47:42 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -60,6 +60,9 @@ main(int argc, char **argv) /* Welcome user to FreeBSD */ systemWelcome(); + /* Default to English */ + /* lang_set_English(NULL); */ + /* Begin user dialog at outer menu */ while (1) { choice = scroll = curr = max = 0; diff --git a/usr.sbin/sysinstall/msg.c b/usr.sbin/sysinstall/msg.c index 9c60c1d..7208994 100644 --- a/usr.sbin/sysinstall/msg.c +++ b/usr.sbin/sysinstall/msg.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: msg.c,v 1.3 1995/05/04 03:51:21 jkh Exp $ + * $Id: msg.c,v 1.6 1995/05/05 23:47:44 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -58,7 +58,7 @@ msgYap(char *fmt, ...) vsnprintf((char *)(errstr + strlen(errstr)), FILENAME_MAX, fmt, args); va_end(args); attrs = getattrs(stdscr); - attrset(A_BOLD); + attrset(A_REVERSE); mvaddstr(23, 0, errstr); attrset(attrs); refresh(); @@ -101,7 +101,7 @@ msgWarn(char *fmt, ...) va_end(args); attrs = getattrs(stdscr); beep(); - attrset(A_BOLD); + attrset(A_REVERSE); mvaddstr(23, 0, errstr); attrset(attrs); refresh(); @@ -123,7 +123,7 @@ msgError(char *fmt, ...) va_end(args); beep(); attrs = getattrs(stdscr); - attrset(A_BOLD); + attrset(A_REVERSE); mvaddstr(23, 0, errstr); attrset(attrs); refresh(); @@ -145,7 +145,7 @@ msgFatal(char *fmt, ...) va_end(args); beep(); attrs = getattrs(stdscr); - attrset(A_BOLD); + attrset(A_REVERSE); mvaddstr(23, 0, errstr); addstr(" - "); addstr("PRESS ANY KEY TO "); diff --git a/usr.sbin/sysinstall/system.c b/usr.sbin/sysinstall/system.c index aad9887..d7783c2 100644 --- a/usr.sbin/sysinstall/system.c +++ b/usr.sbin/sysinstall/system.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: system.c,v 1.5 1995/05/05 23:47:46 jkh Exp $ + * $Id: system.c,v 1.6 1995/05/06 09:34:22 jkh Exp $ * * Jordan Hubbard * @@ -201,7 +201,7 @@ systemHelpFile(char *file, char *buf) fname = buf; } } - else { + if (!fname) { snprintf(buf, FILENAME_MAX, "help/en_US.ISO8859-1/%s", file); if (file_readable(buf)) fname = buf; @@ -238,12 +238,12 @@ systemChangeTerminal(char *color, const u_char c_term[], if (ColorDisplay) { setenv("TERM", color, 1); setenv("TERMCAP", c_term, 1); - setterm(color); + /* setterm(color); */ } else { setenv("TERM", mono, 1); setenv("TERMCAP", m_term, 1); - setterm(mono); + /* setterm(mono); */ } } } |