Source-Changes-HG archive

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

[src/trunk]: src/distrib/utils/sysinst nuke ask_ynquestion from orbit. not o...



details:   https://anonhg.NetBSD.org/src/rev/dd128cf8b6a9
branches:  trunk
changeset: 473926:dd128cf8b6a9
user:      cgd <cgd%NetBSD.org@localhost>
date:      Tue Jun 22 02:43:09 1999 +0000

description:
nuke ask_ynquestion from orbit.  not only was it bogus w.r.t. what is
allowed in C (see PR 6431), but it's also bogus w.r.t. sysinst's message
display style, etc.  XXX the French msg file needs translation.

diffstat:

 distrib/utils/sysinst/defs.h    |   3 +-
 distrib/utils/sysinst/msg.mi.en |  18 ++++++----
 distrib/utils/sysinst/msg.mi.fr |  23 +++++++------
 distrib/utils/sysinst/util.c    |  67 +++++++++++++++-------------------------
 4 files changed, 49 insertions(+), 62 deletions(-)

diffs (265 lines):

diff -r 89e7d28c3a58 -r dd128cf8b6a9 distrib/utils/sysinst/defs.h
--- a/distrib/utils/sysinst/defs.h      Tue Jun 22 02:21:58 1999 +0000
+++ b/distrib/utils/sysinst/defs.h      Tue Jun 22 02:43:09 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: defs.h,v 1.43 1999/06/22 00:43:57 cgd Exp $    */
+/*     $NetBSD: defs.h,v 1.44 1999/06/22 02:43:09 cgd Exp $    */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -288,7 +288,6 @@
 void   get_ramsize __P((void));
 void   ask_sizemult __P((void));
 void   reask_sizemult __P((void));
-int    ask_ynquestion __P((char *quest, char def, ...));
 void   run_makedev __P((void));
 int    get_via_floppy __P((void));
 int    get_via_cdrom __P((void));
diff -r 89e7d28c3a58 -r dd128cf8b6a9 distrib/utils/sysinst/msg.mi.en
--- a/distrib/utils/sysinst/msg.mi.en   Tue Jun 22 02:21:58 1999 +0000
+++ b/distrib/utils/sysinst/msg.mi.en   Tue Jun 22 02:43:09 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.mi.en,v 1.46 1999/06/22 02:25:27 cgd Exp $ */
+/*     $NetBSD: msg.mi.en,v 1.47 1999/06/22 02:43:09 cgd Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -520,7 +520,8 @@
 
 message notarfile
 {Release set %s does not exist.
-}
+
+Continue extracting sets?}
 
 message endtarok
 {All selected distribution sets unpacked successfully.}
@@ -529,8 +530,9 @@
 {There were problems unpacking distribution sets.
 Your installation is incomplete. 
 
-You selected %d distribution sets.  I couldn't find %d of those sets at all.
-Of the %d that were found, %d unpacked without errors and %d with errors.
+You selected %d distribution sets.  %d sets couldn't be found
+and %d were skipped after an error occured.  Of the %d
+that were attempted, %d unpacked without errors and %d with errors.
 
 The installation is aborted. Please recheck your distribution source
 and consider reinstalling sets from the main menu.}
@@ -663,11 +665,11 @@
 }
 
 message tarerror
-{There was an error in extracting the file %s.  That means some files
-were not extracted correctly and your system will not be complete.
-The installation is aborting.
+{There was an error in extracting the file %s.  That means
+some files were not extracted correctly and your system will not be
+complete.
 
-Press CR to continue after a short delay.}
+Continue extracting sets?}
 
 message etc_hosts
 {
diff -r 89e7d28c3a58 -r dd128cf8b6a9 distrib/utils/sysinst/msg.mi.fr
--- a/distrib/utils/sysinst/msg.mi.fr   Tue Jun 22 02:21:58 1999 +0000
+++ b/distrib/utils/sysinst/msg.mi.fr   Tue Jun 22 02:43:09 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg.mi.fr,v 1.20 1999/06/20 06:08:15 cgd Exp $ */
+/*     $NetBSD: msg.mi.fr,v 1.21 1999/06/22 02:43:10 cgd Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -532,7 +532,8 @@
 
 message notarfile
 {La distribution %s n'existe pas.
-}
+
+Continue extracting sets?} /* XXX CGD trans */
 
 message endtarok
 {Tous les fichiers ont étés extraits. SVP appuyer sur <entrée> pour continuer.}
@@ -540,9 +541,11 @@
 message endtar
 {Il y a eu des problèmes au décompactage des composants. Votre installation
 est incomplète.
-Sur les %d composants sélectionnés, %d n'ont pas pu etre trouvés du tout.
-Sur les %d qui ont été trouvés, %d se sont décompactés sans erreur et %d
-avec erreur.
+
+/* XXX CGD trans */
+You selected %d distribution sets.  %d sets couldn't be found
+and %d were skipped after an error occured.  Of the %d
+that were attempted, %d unpacked without errors and %d with errors.
 
 La procédure d'installation a échoué. Vérifiez vos composants et
 envisagez une réinstallation des composants depuis le menu principal.}
@@ -685,13 +688,11 @@
 }
 
 message tarerror
-{Il y a eu des erreurs lors de l'extraction du fichier %s. Ceci signifie que
-certains fichiers n'ont pas étés extraits correctement et que votre système 
-n'est pas complet.
-Arrêt de la mise à jour.
+{Il y a eu des erreurs lors de l'extraction du fichier %s.
+Ceci signifie que certains fichiers n'ont pas étés extraits
+correctement et que votre système n'est pas complet.
 
-Appuyer sur <entrée> pour continuer après un court délais.
-}
+Continue extracting sets?}     /* XXX CGD trans */
 
 message etc_hosts
 {
diff -r 89e7d28c3a58 -r dd128cf8b6a9 distrib/utils/sysinst/util.c
--- a/distrib/utils/sysinst/util.c      Tue Jun 22 02:21:58 1999 +0000
+++ b/distrib/utils/sysinst/util.c      Tue Jun 22 02:43:09 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: util.c,v 1.43 1999/06/22 00:57:06 cgd Exp $    */
+/*     $NetBSD: util.c,v 1.44 1999/06/22 02:43:10 cgd Exp $    */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -61,9 +61,10 @@
        int nnotfound;
        int nerror;
        int nsuccess;
+       int nskipped;
 } tarstats;
 
-void   extract_file __P((char *path));
+int    extract_file __P((char *path));
 int    extract_dist __P((void));
 int    cleanup_dist __P((const char *path));
 int    distribution_sets_exist_p __P((const char *path));
@@ -143,33 +144,6 @@
        ask_sizemult();
 }
 
-/*
- * Returns 1 for "y" or "Y" and "n" otherwise.  CR => default.
- */
-int
-ask_ynquestion(char *quest, char def, ...)
-{
-       char line[STRSIZE];
-       va_list ap;
-       char c;
-
-       va_start(ap, def);
-       vsnprintf(line, STRSIZE, quest, ap);
-       va_end(ap);
-
-       if (def)
-               printf("%s [%c]: ", line, def);
-       else
-               printf("%s: ", line);
-       c = getchar();
-       if (c == '\n')
-               return def == 'y';
-
-       while (getchar() != '\n') /* eat characters */;
-
-       return c == 'y' || c == 'Y';
-}
-
 void
 run_makedev()
 {
@@ -466,20 +440,22 @@
        }
 }
 
-void
+int
 extract_file(path)
        char *path;
 {
        char *owd;
-       int   tarexit;
+       int   tarexit, rv;
        
        owd = getcwd (NULL,0);
 
        /* check tarfile exists */
        if (!file_exists_p(path)) {
                tarstats.nnotfound++;
-               ask_ynquestion(msg_string(MSG_notarfile), 0, path);
-               return;
+
+               msg_display(MSG_notarfile, path);
+               process_menu(MENU_noyes);
+               return (yesno == 0);
        }
 
        tarstats.nfound++;      
@@ -493,15 +469,19 @@
        /* Check tarexit for errors and give warning. */
        if (tarexit) {
                tarstats.nerror++;
-               ask_ynquestion(msg_string(MSG_tarerror), 0, path);
-               sleep(3);
+
+               msg_display(MSG_tarerror, path);
+               process_menu(MENU_noyes);
+               rv = (yesno == 0);
        } else {
                tarstats.nsuccess++;
-               sleep(1);
+               rv = 0;
        }
        
        chdir(owd);
        free(owd);
+
+       return (rv);
 }
 
 
@@ -517,15 +497,19 @@
        char distname[STRSIZE];
        char fname[STRSIZE];
        distinfo *list;
+       int punt;
 
        /* reset failure/success counters */
        memset(&tarstats, 0, sizeof(tarstats));
 
        /*endwin();*/
-       list = dist_list;
-       while (list->name) {
+       for (punt = 0, list = dist_list; list->name != NULL; list++) {
                if (list->getit) {
                        tarstats.nselected++;
+                       if (punt) {
+                               tarstats.nskipped++;
+                               continue;
+                       }
                        if (cleanup_dist(list->name) == 0) {
                                msg_display(MSG_cleanup_warn);
                                process_menu(MENU_ok);
@@ -534,9 +518,10 @@
                            dist_postfix);
                        (void)snprintf(fname, STRSIZE, "%s/%s", ext_dir,
                            distname);
-                       extract_file(fname);
+
+                       /* if extraction failed and user aborted, punt. */
+                       punt = extract_file(fname);
                }
-               list++;
        }
 
        puts(CL);               /* XXX */
@@ -550,7 +535,7 @@
        } else {
                /* We encountered  errors. Let the user know. */
                msg_display(MSG_endtar,
-                   tarstats.nselected, tarstats.nnotfound,
+                   tarstats.nselected, tarstats.nnotfound, tarstats.nskipped,
                    tarstats.nfound, tarstats.nsuccess, tarstats.nerror);
                process_menu(MENU_ok);
                return 1;



Home | Main Index | Thread Index | Old Index