Source-Changes-HG archive

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

[src/trunk]: src/distrib/utils/sysinst Put 'Delete ?' (not "yes or no") in bo...



details:   https://anonhg.NetBSD.org/src/rev/af2f1c527366
branches:  trunk
changeset: 574314:af2f1c527366
user:      dsl <dsl%NetBSD.org@localhost>
date:      Sat Feb 26 17:40:49 2005 +0000

description:
Put 'Delete ?' (not "yes or no") in box when we ask whether the user
want to keep or delete the dist files.
Stop the "type enter to continue" if the rmdir fails - may not be empty.
Report an error if the chroot() (for RUN_CHROOT) fails.
fflush log and script files before writing to them from a child.

diffstat:

 distrib/utils/sysinst/defs.h    |   3 +--
 distrib/utils/sysinst/mbr.c     |   4 +++-
 distrib/utils/sysinst/msg.mi.de |   6 +++---
 distrib/utils/sysinst/msg.mi.en |   5 +++--
 distrib/utils/sysinst/msg.mi.fr |   5 +++--
 distrib/utils/sysinst/msg.mi.pl |   5 +++--
 distrib/utils/sysinst/run.c     |  33 +++++++++++++++++----------------
 distrib/utils/sysinst/util.c    |   4 ++--
 8 files changed, 35 insertions(+), 30 deletions(-)

diffs (246 lines):

diff -r 9eec4b6993cd -r af2f1c527366 distrib/utils/sysinst/defs.h
--- a/distrib/utils/sysinst/defs.h      Sat Feb 26 17:36:32 2005 +0000
+++ b/distrib/utils/sysinst/defs.h      Sat Feb 26 17:40:49 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: defs.h,v 1.122 2005/02/20 20:54:52 dsl Exp $   */
+/*     $NetBSD: defs.h,v 1.123 2005/02/26 17:40:49 dsl Exp $   */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -73,7 +73,6 @@
 #define RUN_CHROOT     0x0004          /* chroot to target disk */
 #define RUN_FULLSCREEN 0x0008          /* fullscreen (use with RUN_DISPLAY) */
 #define RUN_SILENT     0x0010          /* Do not show output */
-#define RUN_SILENT_ERR 0x0020          /* Remain silent even if cmd fails */
 #define RUN_ERROR_OK   0x0040          /* Don't wait for error confirmation */
 #define RUN_PROGRESS   0x0080          /* Output is just progess test */
 #define RUN_NO_CLEAR   0x0100          /* Leave program output after error */
diff -r 9eec4b6993cd -r af2f1c527366 distrib/utils/sysinst/mbr.c
--- a/distrib/utils/sysinst/mbr.c       Sat Feb 26 17:36:32 2005 +0000
+++ b/distrib/utils/sysinst/mbr.c       Sat Feb 26 17:40:49 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mbr.c,v 1.67 2004/11/10 02:41:00 christos Exp $ */
+/*     $NetBSD: mbr.c,v 1.68 2005/02/26 17:40:49 dsl Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -106,7 +106,9 @@
        {MBR_PTYPE_FAT32L,      "Windows FAT32, LBA"},
        {MBR_PTYPE_NTFSVOL,     "NTFS volume set"},
        {MBR_PTYPE_NTFS,        "NTFS"},
+#ifdef MBR_PTYPE_SOLARIS
        {MBR_PTYPE_SOLARIS,     "Solaris"},
+#endif
        {-1,                    "Unknown"},
 };
 
diff -r 9eec4b6993cd -r af2f1c527366 distrib/utils/sysinst/msg.mi.de
--- a/distrib/utils/sysinst/msg.mi.de   Sat Feb 26 17:36:32 2005 +0000
+++ b/distrib/utils/sysinst/msg.mi.de   Sat Feb 26 17:40:49 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.mi.de,v 1.16 2004/11/11 21:24:40 dsl Exp $ */
+/*     $NetBSD: msg.mi.de,v 1.17 2005/02/26 17:40:49 dsl Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -56,7 +56,7 @@
 message On {An}
 message Off {Aus}
 message unchanged {unverändert}
-
+message Delete {Löschen?}
 message install
 {installieren}
 
@@ -667,7 +667,7 @@
 {Welches Verzeichnis möchten Sie für %s nutzen?}
 
 message delete_dist_files
-{Wollen Sie die NetBSD Pakete von %s löschen?
+{Wollen Sie die NetBSD Pakete von %s löschen? 
 (Sie können diese auch dazu beibehalten ein weiteres System zu installieren
 oder zu erneuern.)}
 
diff -r 9eec4b6993cd -r af2f1c527366 distrib/utils/sysinst/msg.mi.en
--- a/distrib/utils/sysinst/msg.mi.en   Sat Feb 26 17:36:32 2005 +0000
+++ b/distrib/utils/sysinst/msg.mi.en   Sat Feb 26 17:40:49 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.mi.en,v 1.135 2005/01/09 19:58:55 snj Exp $        */
+/*     $NetBSD: msg.mi.en,v 1.136 2005/02/26 17:40:49 dsl Exp $        */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -56,6 +56,7 @@
 message On {On}
 message Off {Off}
 message unchanged {unchanged}
+message Delete {Delete?}
 
 message install
 {install}
@@ -639,7 +640,7 @@
 {What directory shall I use for %s? }
 
 message delete_dist_files
-{Do you want to delete the NetBSD sets from %s?
+{Do you want to delete the NetBSD sets from %s? 
 (You can keep them to install/upgrade a second system.)}
 
 message verboseextract
diff -r 9eec4b6993cd -r af2f1c527366 distrib/utils/sysinst/msg.mi.fr
--- a/distrib/utils/sysinst/msg.mi.fr   Sat Feb 26 17:36:32 2005 +0000
+++ b/distrib/utils/sysinst/msg.mi.fr   Sat Feb 26 17:40:49 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.mi.fr,v 1.82 2004/11/11 21:24:40 dsl Exp $ */
+/*     $NetBSD: msg.mi.fr,v 1.83 2005/02/26 17:40:49 dsl Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -56,6 +56,7 @@
 message unchanged {non-modifié}
 message On {On}
 message Off {Off}
+message Delete {Supprimer ?}
 
 message install
 {installer}
@@ -652,7 +653,7 @@
 {Quel répertoire dois je utiliser pour %s ?}
 
 message delete_dist_files
-{Voulez-vous supprimer les fichiers de distribution de NetBSD de %s ?
+{Voulez-vous supprimer les fichiers de distribution de NetBSD de %s ? 
 Vous pouvez les conserver pour installer ou mettre a jour d'autre systèmes.}
 
 message verboseextract
diff -r 9eec4b6993cd -r af2f1c527366 distrib/utils/sysinst/msg.mi.pl
--- a/distrib/utils/sysinst/msg.mi.pl   Sat Feb 26 17:36:32 2005 +0000
+++ b/distrib/utils/sysinst/msg.mi.pl   Sat Feb 26 17:40:49 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.mi.pl,v 1.44 2005/02/12 15:06:59 aymeric Exp $     */
+/*     $NetBSD: msg.mi.pl,v 1.45 2005/02/26 17:40:49 dsl Exp $ */
 /*     Based on english version: */
 /*     NetBSD: msg.mi.pl,v 1.36 2004/04/17 18:55:35 atatat Exp       */
 
@@ -58,6 +58,7 @@
 message unchanged {niezmienione}
 message On {Wlaczone}
 message Off {Wylaczone}
+message Delete {Usunac?}
 
 message install
 {zainstalowac}
@@ -628,7 +629,7 @@
 {Jakiego katalogu powinienem uzyc dla %s? }
 
 message delete_dist_files
-{Czy chcesz usunac pakiety NetBSD z %s?
+{Czy chcesz usunac pakiety NetBSD z %s? 
 (Mozesz je zachowac aby zainstalowac/zaktualizowac kolejny system.)}
 
 message verboseextract
diff -r 9eec4b6993cd -r af2f1c527366 distrib/utils/sysinst/run.c
--- a/distrib/utils/sysinst/run.c       Sat Feb 26 17:36:32 2005 +0000
+++ b/distrib/utils/sysinst/run.c       Sat Feb 26 17:40:49 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: run.c,v 1.58 2004/10/16 12:52:30 dsl Exp $     */
+/*     $NetBSD: run.c,v 1.59 2005/02/26 17:40:49 dsl Exp $     */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -414,6 +414,11 @@
                }
        }
 
+       if (logging)
+               fflush(logfp);
+       if (scripting)
+               fflush(script);
+
        child = fork();
        switch (child) {
        case -1:
@@ -434,27 +439,23 @@
                (void)tcsetattr(slave, TCSANOW, &rtt);
                login_tty(slave);
                if (logging) {
-                       fprintf(logfp, "executing:");
-                       for (i = 0; args[i]; i++)
-                               fprintf(logfp, " %s", args[i]);
-                       fprintf(logfp, "\n");
+                       fprintf(logfp, "executing: %s\n", scmd);
                        fclose(logfp);
                }
                if (scripting) {
-                       for (i = 0; args[i]; i++)
-                               fprintf(script, "%s ", args[i]);
-                       fprintf(script, "\n");
+                       fprintf(script, "%s\n", scmd);
                        fclose(script);
                }
                /*
                 * If target_prefix == "", the chroot will fail, but
                 * that's ok, since we don't need it then.
                 */
-               if ((flags & RUN_CHROOT) != 0)
-                       chroot(target_prefix());
-               execvp(*args, args);
-               /* The parent will see this as the output from the child */
-               warn("execvp %s", *args);
+               if ((flags & RUN_CHROOT) != 0 && chroot(target_prefix()) != 0)
+                       warn("chroot(%s) for %s", target_prefix(), *args);
+               else {
+                       execvp(*args, args);
+                       warn("execvp %s", *args);
+               }
                _exit(EXIT_FAILURE);
                break; /* end of child */
        default:
@@ -562,7 +563,6 @@
  *     RUN_CHROOT      chroot to target before the exec
  *     RUN_FULLSCREEN  display output only
  *     RUN_SILENT      do not display program output
- *     RUN_DISPLAY_ERR display status if program fails
  *     RUN_ERROR_OK    don't wait for key if program fails
  *     RUN_PROGRESS    don't wait for key if program has output
  * If both RUN_DISPLAY and RUN_SILENT are clear then the program name will
@@ -614,7 +614,7 @@
        ret = launch_subwin(&actionwin, args, &win, flags, scmd, &errstr);
 
        /* If the command failed, show command name */
-       if (ret != 0 && actionwin == NULL && !(flags & RUN_SILENT_ERR))
+       if (actionwin == NULL && ret != 0 && !(flags & RUN_ERROR_OK))
                actionwin = show_cmd(scmd, &win);
 
        if (actionwin != NULL) {
@@ -647,10 +647,11 @@
                        refresh();
                        getchar();
                } else {
-                       if (y + x != 0)
+                       if (y + x != 0) {
                                /* give user 1 second to see messages */
                                refresh();
                                sleep(1);
+                       }
                }
        }
 
diff -r 9eec4b6993cd -r af2f1c527366 distrib/utils/sysinst/util.c
--- a/distrib/utils/sysinst/util.c      Sat Feb 26 17:36:32 2005 +0000
+++ b/distrib/utils/sysinst/util.c      Sat Feb 26 17:40:49 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: util.c,v 1.134 2005/02/26 17:36:32 dsl Exp $   */
+/*     $NetBSD: util.c,v 1.135 2005/02/26 17:40:50 dsl Exp $   */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -796,7 +796,7 @@
        /* Clean up dist dir (use absolute path name) */
        if (clean_dist_dir) {
                msg_display(MSG_delete_dist_files, dist_dir);
-               process_menu(MENU_yesno, NULL);
+               process_menu(MENU_yesno, deconst(MSG_Delete));
                if (yesno) {
                        for (list = dist_list; list->desc != NULL; list++) {
                                if (list->name == NULL)



Home | Main Index | Thread Index | Old Index