diff options
author | jkh <jkh@FreeBSD.org> | 1996-07-05 08:36:02 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1996-07-05 08:36:02 +0000 |
commit | 4c968f95bbe4f222217f8694eafd9d9290069d02 (patch) | |
tree | 73d209fa74b62476d2997cbf1de7391d72b8b70e /usr.sbin/sade/system.c | |
parent | 14ae3a02bd9c0b777d8b49e8b75087cb3d0b7625 (diff) | |
download | FreeBSD-src-4c968f95bbe4f222217f8694eafd9d9290069d02.zip FreeBSD-src-4c968f95bbe4f222217f8694eafd9d9290069d02.tar.gz |
Support compressed doc files again.
Add a few strategic screen clears.
Do a lot less wasted screen I/O in restoring screen contents that don't need
restoring.
Use tar instead of cp to back up /etc in installUpdate.
Don't panic when upgrade shell exits.
Diffstat (limited to 'usr.sbin/sade/system.c')
-rw-r--r-- | usr.sbin/sade/system.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/usr.sbin/sade/system.c b/usr.sbin/sade/system.c index b826f3e..936456b 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.58 1996/05/01 03:31:08 jkh Exp $ + * $Id: system.c,v 1.59 1996/05/16 11:47:46 jkh Exp $ * * Jordan Hubbard * @@ -24,6 +24,10 @@ #include <sys/ioctl.h> #include <sys/wait.h> + +/* Where we stick our temporary expanded doc file */ +#define DOC_TMP_FILE "/tmp/doc.tmp" + /* * Handle interrupt signals - this probably won't work in all cases * due to our having bogotified the internal state of dialog or curses, @@ -36,6 +40,16 @@ handle_intr(int sig) systemShutdown(1); } +/* Expand a file into a convenient location, nuking it each time */ +static char * +expand(char *fname) +{ + unlink(DOC_TMP_FILE); + if (vsystem("gzip -c -d %s > %s", fname, DOC_TMP_FILE)) + return NULL; + return DOC_TMP_FILE; +} + /* Initialize system defaults */ void systemInitialize(int argc, char **argv) @@ -94,6 +108,9 @@ systemShutdown(int status) /* Shut down curses */ endwin(); + /* If we have a temporary doc file lying around, nuke it */ + unlink(DOC_TMP_FILE); + /* REALLY exit! */ if (RunningAsInit) { /* Put the console back */ @@ -160,9 +177,9 @@ systemHelpFile(char *file, char *buf) if (!file) return NULL; - snprintf(buf, FILENAME_MAX, "/stand/help/%s.hlp", file); + snprintf(buf, FILENAME_MAX, "/stand/help/%s.hlp.gz", file); if (file_readable(buf)) - return buf; + return expand(buf); snprintf(buf, FILENAME_MAX, "/usr/src/release/sysinstall/help/%s.hlp", file); if (file_readable(buf)) return buf; |