Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-2-0]: src/distrib/utils/sysinst Pull up revision 1.57 (requested ...



details:   https://anonhg.NetBSD.org/src/rev/292b0c5d153b
branches:  netbsd-2-0
changeset: 561328:292b0c5d153b
user:      tron <tron%NetBSD.org@localhost>
date:      Mon Jun 07 10:20:51 2004 +0000

description:
Pull up revision 1.57 (requested by dsl in ticket #453):
A load of usability fixes mainly to network installs.
I've made the error retry loops go back as far as the input menus.
Split all the pathname inputs into 2 pieces (base directory and set directory).
Reduced the size of some fixed strings.
Stopped the install aborting if ftp can't find a set (eg the X ones).
The French and Polish transations don't differenciate between Base_dir and
Set_dir - but that can be fixed later.

diffstat:

 distrib/utils/sysinst/run.c |  75 ++++++++++++++++++++++++++++----------------
 1 files changed, 47 insertions(+), 28 deletions(-)

diffs (129 lines):

diff -r 9860586c0a44 -r 292b0c5d153b distrib/utils/sysinst/run.c
--- a/distrib/utils/sysinst/run.c       Mon Jun 07 10:20:45 2004 +0000
+++ b/distrib/utils/sysinst/run.c       Mon Jun 07 10:20:51 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: run.c,v 1.55.2.1 2004/05/22 16:45:01 he Exp $  */
+/*     $NetBSD: run.c,v 1.55.2.2 2004/06/07 10:20:51 tron Exp $        */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -266,6 +266,14 @@
                if (argv == NULL)
                        err(1, "realloc(argv) for %s", cmd);
                asprintf(argv + argc, "%.*s", (int)(cp - cmd), cmd);
+               /* Hack to remove %xx encoded ftp password */
+               dp = strstr(cmd, ":%");
+               if (dp != NULL && dp < cp) {
+                       for (fn = dp + 4; *fn == '%'; fn += 3)
+                               continue;
+                       if (*fn == '@')
+                               memset(dp + 1, '*', fn - dp - 1);
+               }
                if (*cp == '\'')
                        cp++;
                if (cp[-1] != '*')
@@ -319,16 +327,32 @@
 {
        int n, m;
        WINDOW *actionwin;
+       const char *command = msg_string(MSG_Command);
+       int nrow;
 
        wclear(stdscr);
        clearok(stdscr, 1);
        touchwin(stdscr);
        refresh();
 
-       actionwin = subwin(stdscr, win->ws_row - 4, win->ws_col, 4, 0);
+       mvaddstr(0, 4, msg_string(MSG_Status));
+       standout();
+       addstr(msg_string(MSG_Running));
+       standend();
+       mvaddstr(1, 4, msg_string(MSG_Command));
+       standout();
+       printw("%s", scmd);
+       standend();
+       addstr("\n\n");
+       for (n = win->ws_col; (m = min(n, 30)) > 0; n -= m)
+               addstr( "------------------------------" + 30 - m);
+       refresh();
+
+       nrow = getcury(stdscr) + 1;
+
+       actionwin = subwin(stdscr, win->ws_row - nrow, win->ws_col, nrow, 0);
        if (actionwin == NULL) {
-               fprintf(stderr, "sysinst: failed to allocate"
-                           " output window.\n");
+               fprintf(stderr, "sysinst: failed to allocate output window.\n");
                exit(1);
        }
        scrollok(actionwin, TRUE);
@@ -337,20 +361,6 @@
                wattrset(actionwin, getattrs(stdscr));
        }
 
-       mvaddstr(0, 4, msg_string(MSG_Status));
-       standout();
-       addstr(msg_string(MSG_Running));
-       standend();
-       mvaddstr(1, 4, msg_string(MSG_Command));
-       standout();
-       printw("%.*s", win->ws_col - getcurx(stdscr) - 1, scmd);
-       standend();
-
-       move(3, 0);
-       for (n = win->ws_col; (m = min(n, 30)) > 0; n -= m)
-               addstr( "------------------------------" + 30 - m);
-       refresh();
-
        wmove(actionwin, 0, 0);
        wrefresh(actionwin);
 
@@ -611,28 +621,37 @@
        if (actionwin != NULL) {
                int y, x;
                getyx(actionwin, y, x);
-               standout();
+               if (actionwin != stdscr)
+                       mvaddstr(0, 4, msg_string(MSG_Status));
                if (ret != 0) {
-                       if (actionwin != stdscr)
-                               move(0, 13);
-                       else if (x != 0)
+                       if (actionwin == stdscr && x != 0)
                                addstr("\n");
+                       x = 1;  /* force newline below */
+                       standout();
                        addstr(errstr);
-                       x = 1;  /* force newline below */
-               } else
-                       if (actionwin != stdscr)
-                               mvaddstr(0, 13, msg_string(MSG_Finished));
-               standend();
+                       standend();
+               } else {
+                       if (actionwin != stdscr) {
+                               standout();
+                               addstr(msg_string(MSG_Finished));
+                               standend();
+                       }
+               }
                refresh();
                if ((ret != 0 && !(flags & RUN_ERROR_OK)) ||
                    (y + x != 0 && !(flags & RUN_PROGRESS))) {
                        if (actionwin != stdscr)
-                               move(2, 5);
+                               move(getbegy(actionwin) - 2, 5);
                        else if (x != 0)
                                addstr("\n");
                        addstr(msg_string(MSG_Hit_enter_to_continue));
                        refresh();
                        getchar();
+               } else {
+                       if (y + x != 0)
+                               /* give user 1 second to see messages */
+                               refresh();
+                               sleep(1);
                }
        }
 



Home | Main Index | Thread Index | Old Index