Source-Changes-HG archive

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

[src/netbsd-7]: src/usr.sbin/sysinst Pull up following revision(s) (requested...



details:   https://anonhg.NetBSD.org/src/rev/eed266344d3d
branches:  netbsd-7
changeset: 799323:eed266344d3d
user:      snj <snj%NetBSD.org@localhost>
date:      Thu May 14 07:58:49 2015 +0000

description:
Pull up following revision(s) (requested by martin in ticket #756):
        usr.sbin/sysinst/arch/arc/md.c: revision 1.4
        usr.sbin/sysinst/arch/atari/md.c: revision 1.3
        usr.sbin/sysinst/arch/cobalt/md.c: revision 1.4
        usr.sbin/sysinst/arch/emips/md.c: revision 1.3
        usr.sbin/sysinst/arch/evbarm/md.c: revision 1.4
        usr.sbin/sysinst/arch/evbarm64/md.c: revision 1.2
        usr.sbin/sysinst/arch/hp300/md.c: revision 1.4
        usr.sbin/sysinst/arch/i386/md.c: revision 1.6
        usr.sbin/sysinst/arch/mac68k/md.c: revision 1.3
        usr.sbin/sysinst/arch/mac68k/md.c: revision 1.4
        usr.sbin/sysinst/arch/mac68k/menus.md.de: revisions 1.3, 1.4
        usr.sbin/sysinst/arch/mac68k/menus.md.en: revisions 1.3, 1.4
        usr.sbin/sysinst/arch/mac68k/menus.md.es: revisions 1.3, 1.4
        usr.sbin/sysinst/arch/mac68k/menus.md.pl: revisions 1.3, 1.4
        usr.sbin/sysinst/arch/mvme68k/md.c: revision 1.4
        usr.sbin/sysinst/arch/ofppc/md.c: revision 1.3
        usr.sbin/sysinst/arch/prep/md.c: revisions 1.3, 1.4
        usr.sbin/sysinst/arch/prep/menus.md.en: revision 1.2
        usr.sbin/sysinst/arch/x68k/md.c: revision 1.4
        usr.sbin/sysinst/configmenu.c: revisions 1.4, 1.5
        usr.sbin/sysinst/defs.h: revisions 1.8, 1.9
        usr.sbin/sysinst/disks.c: revision 1.9
        usr.sbin/sysinst/install.c: revision 1.4
        usr.sbin/sysinst/label.c: revision 1.3
        usr.sbin/sysinst/mbr.c: revision 1.5
        usr.sbin/sysinst/menus.mi: revisions 1.9, 1.10
        usr.sbin/sysinst/net.c: revisions 1.18-1.20
        usr.sbin/sysinst/partman.c: revision 1.10
        usr.sbin/sysinst/upgrade.c: revision 1.4
        usr.sbin/sysinst/util.c: revisions 1.6, 1.7
Backout the previous incorrect fix for PR 49440 and redo it more globaly:
get rid of the global "yesno", introduce utility functions "ask_yesno()"
and "ask_noyes()" instead, greatly simplifying a lot of code.
Pass in a pointer to the return value to various "set source" menus.
--
Make it compile on architectures that do not support INET6 in sysinst
--
Remove a few more (ab-)usages of "yesno".
--
More (ab-)usages of "yesno"
--
Make "ask_yesno" and "ask_noyes" take a const char * as argument, moving
the deconst() dance into the utility functions and simplifying all callers.
--
Missed a few more "yesno" in previous

diffstat:

 usr.sbin/sysinst/arch/arc/md.c           |  11 +---
 usr.sbin/sysinst/arch/atari/md.c         |   5 +-
 usr.sbin/sysinst/arch/cobalt/md.c        |  11 +---
 usr.sbin/sysinst/arch/emips/md.c         |   5 +-
 usr.sbin/sysinst/arch/evbarm/md.c        |   5 +-
 usr.sbin/sysinst/arch/evbarm64/md.c      |   5 +-
 usr.sbin/sysinst/arch/hp300/md.c         |   5 +-
 usr.sbin/sysinst/arch/i386/md.c          |  16 ++----
 usr.sbin/sysinst/arch/mac68k/md.c        |  19 ++++----
 usr.sbin/sysinst/arch/mac68k/menus.md.de |  24 +++++-----
 usr.sbin/sysinst/arch/mac68k/menus.md.en |  24 +++++-----
 usr.sbin/sysinst/arch/mac68k/menus.md.es |  24 +++++-----
 usr.sbin/sysinst/arch/mac68k/menus.md.pl |  24 +++++-----
 usr.sbin/sysinst/arch/mvme68k/md.c       |   5 +-
 usr.sbin/sysinst/arch/ofppc/md.c         |  17 ++-----
 usr.sbin/sysinst/arch/prep/md.c          |  16 +++----
 usr.sbin/sysinst/arch/prep/menus.md.en   |   6 +-
 usr.sbin/sysinst/arch/x68k/md.c          |   8 +--
 usr.sbin/sysinst/configmenu.c            |  19 ++++----
 usr.sbin/sysinst/defs.h                  |  12 ++++-
 usr.sbin/sysinst/disks.c                 |   8 +--
 usr.sbin/sysinst/install.c               |   8 +--
 usr.sbin/sysinst/label.c                 |   7 +-
 usr.sbin/sysinst/mbr.c                   |  11 +---
 usr.sbin/sysinst/menus.mi                |  66 +++++++++++++++----------------
 usr.sbin/sysinst/net.c                   |  61 ++++++++++++-----------------
 usr.sbin/sysinst/partman.c               |  14 ++----
 usr.sbin/sysinst/upgrade.c               |   8 +--
 usr.sbin/sysinst/util.c                  |  61 ++++++++++++++++++++--------
 29 files changed, 242 insertions(+), 263 deletions(-)

diffs (truncated from 1527 to 300 lines):

diff -r 2031727e7167 -r eed266344d3d usr.sbin/sysinst/arch/arc/md.c
--- a/usr.sbin/sysinst/arch/arc/md.c    Thu May 14 07:27:47 2015 +0000
+++ b/usr.sbin/sysinst/arch/arc/md.c    Thu May 14 07:58:49 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.2.4.1 2015/01/11 04:32:38 snj Exp $ */
+/*     $NetBSD: md.c,v 1.2.4.2 2015/05/14 07:58:49 snj Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -299,8 +299,7 @@
                        if (part->mbrp_size < (MIN_FAT12_BOOT / 512)) {
                                msg_display(MSG_boottoosmall);
                                msg_display_add(MSG_nobootpart, 0);
-                               process_menu(MENU_yesno, NULL);
-                               if (!yesno)
+                               if (!ask_yesno(NULL))
                                        return 0;
                                nobootfs = 1;
                        }
@@ -339,16 +338,14 @@
        if (pm->bootsize < (MIN_FAT12_BOOT / 512)) {
                msg_display(MSG_boottoosmall);
                msg_display_add(MSG_reeditpart, 0);
-               process_menu(MENU_yesno, NULL);
-               if (!yesno)
+               if (!ask_yesno(NULL))
                        return 0;
                return 1;
        }
        if (pm->bootstart == 0 || pm->bootsize == 0) {
                msg_display(MSG_nobootpart);
                msg_display_add(MSG_reeditpart, 0);
-               process_menu(MENU_yesno, NULL);
-               if (!yesno)
+               if (!ask_yesno(NULL))
                        return 0;
                return 1;
        }
diff -r 2031727e7167 -r eed266344d3d usr.sbin/sysinst/arch/atari/md.c
--- a/usr.sbin/sysinst/arch/atari/md.c  Thu May 14 07:27:47 2015 +0000
+++ b/usr.sbin/sysinst/arch/atari/md.c  Thu May 14 07:58:49 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.2 2014/08/03 16:09:39 martin Exp $ */
+/*     $NetBSD: md.c,v 1.2.4.1 2015/05/14 07:58:49 snj Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -69,8 +69,7 @@
 md_make_bsd_partitions(void)
 {
        msg_display(MSG_infoahdilabel, pm->diskdev);
-       process_menu(MENU_noyes, NULL);
-       if (yesno) {
+       if (ask_noyes(NULL)) {
                run_program(RUN_DISPLAY, "ahdilabel /dev/r%sc", pm->diskdev);
        }
        if (!make_bsd_partitions())
diff -r 2031727e7167 -r eed266344d3d usr.sbin/sysinst/arch/cobalt/md.c
--- a/usr.sbin/sysinst/arch/cobalt/md.c Thu May 14 07:27:47 2015 +0000
+++ b/usr.sbin/sysinst/arch/cobalt/md.c Thu May 14 07:58:49 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.2.4.1 2015/01/11 04:32:38 snj Exp $ */
+/*     $NetBSD: md.c,v 1.2.4.2 2015/05/14 07:58:49 snj Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -317,8 +317,7 @@
                        if (part->mbrp_size < (MIN_EXT2FS_BOOT / 512)) {
                                msg_display(MSG_boottoosmall);
                                msg_display_add(MSG_nobootpart, 0);
-                               process_menu(MENU_yesno, NULL);
-                               if (!yesno)
+                               if (!ask_yesno(NULL))
                                        return 0;
                                nobootfs = 1;
                        }
@@ -357,16 +356,14 @@
        if (pm->bootsize < (MIN_EXT2FS_BOOT / 512)) {
                msg_display(MSG_boottoosmall);
                msg_display_add(MSG_reeditpart, 0);
-               process_menu(MENU_yesno, NULL);
-               if (!yesno)
+               if (!ask_yesno(NULL))
                        return 0;
                return 1;
        }
        if (pm->bootstart == 0 || pm->bootsize == 0) {
                msg_display(MSG_nobootpart);
                msg_display_add(MSG_reeditpart, 0);
-               process_menu(MENU_yesno, NULL);
-               if (!yesno)
+               if (!ask_yesno(NULL))
                        return 0;
                return 1;
        }
diff -r 2031727e7167 -r eed266344d3d usr.sbin/sysinst/arch/emips/md.c
--- a/usr.sbin/sysinst/arch/emips/md.c  Thu May 14 07:27:47 2015 +0000
+++ b/usr.sbin/sysinst/arch/emips/md.c  Thu May 14 07:58:49 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.2 2014/08/03 16:09:39 martin Exp $    */
+/*     $NetBSD: md.c,v 1.2.4.1 2015/05/14 07:58:49 snj Exp $   */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -167,9 +167,8 @@
        strlcpy(ldr_path, target_expand("/boot.emips"), sizeof ldr_path);
 
        msg_display(MSG_dobootblks, "");
-       process_menu(MENU_noyes, NULL);
 
-       if (yesno) {
+       if (ask_noyes(NULL)) {
                if (run_program(RUN_DISPLAY | RUN_NO_CLEAR,
                    "/bin/dd if=%s of=/dev/reflash0c bs=512", ldr_path))
                        process_menu(MENU_ok, deconst("Warning: the system "
diff -r 2031727e7167 -r eed266344d3d usr.sbin/sysinst/arch/evbarm/md.c
--- a/usr.sbin/sysinst/arch/evbarm/md.c Thu May 14 07:27:47 2015 +0000
+++ b/usr.sbin/sysinst/arch/evbarm/md.c Thu May 14 07:58:49 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.2 2014/08/03 16:09:39 martin Exp $ */
+/*     $NetBSD: md.c,v 1.2.4.1 2015/05/14 07:58:49 snj Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -275,8 +275,7 @@
                if (!hasboot) {
                        msg_display(MSG_nomsdospart);
                        msg_display_add(MSG_reeditpart, 0);
-                       process_menu(MENU_yesno, NULL);
-                       if (!yesno)
+                       if (!ask_yesno(NULL))
                                return 0;
                        return 1;
                }
diff -r 2031727e7167 -r eed266344d3d usr.sbin/sysinst/arch/evbarm64/md.c
--- a/usr.sbin/sysinst/arch/evbarm64/md.c       Thu May 14 07:27:47 2015 +0000
+++ b/usr.sbin/sysinst/arch/evbarm64/md.c       Thu May 14 07:58:49 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.1.2.2 2014/12/31 06:17:24 snj Exp $ */
+/*     $NetBSD: md.c,v 1.1.2.3 2015/05/14 07:58:49 snj Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -275,8 +275,7 @@
                if (!hasboot) {
                        msg_display(MSG_nomsdospart);
                        msg_display_add(MSG_reeditpart, 0);
-                       process_menu(MENU_yesno, NULL);
-                       if (!yesno)
+                       if (!ask_yesno(NULL))
                                return 0;
                        return 1;
                }
diff -r 2031727e7167 -r eed266344d3d usr.sbin/sysinst/arch/hp300/md.c
--- a/usr.sbin/sysinst/arch/hp300/md.c  Thu May 14 07:27:47 2015 +0000
+++ b/usr.sbin/sysinst/arch/hp300/md.c  Thu May 14 07:58:49 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.2.4.1 2015/01/11 04:32:38 snj Exp $ */
+/*     $NetBSD: md.c,v 1.2.4.2 2015/05/14 07:58:49 snj Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -150,8 +150,7 @@
                } else {
                        if (start >= pm->bsdlabel[part].pi_offset) {
                                msg_display(MSG_ordering, part+'a');
-                               process_menu(MENU_yesno, NULL);
-                               if (yesno)
+                               if (ask_yesno(NULL))
                                        return 0;
                        }
                        start = pm->bsdlabel[part].pi_offset;
diff -r 2031727e7167 -r eed266344d3d usr.sbin/sysinst/arch/i386/md.c
--- a/usr.sbin/sysinst/arch/i386/md.c   Thu May 14 07:27:47 2015 +0000
+++ b/usr.sbin/sysinst/arch/i386/md.c   Thu May 14 07:58:49 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.3.2.2 2015/02/16 13:52:43 martin Exp $ */
+/*     $NetBSD: md.c,v 1.3.2.3 2015/05/14 07:58:49 snj Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -110,8 +110,7 @@
        if (biosdisk != NULL && (biosdisk->bi_flags & BIFLAG_EXTINT13) == 0) {
                if (mbr_root_above_chs()) {
                        msg_display(MSG_partabovechs);
-                       process_menu(MENU_noyes, NULL);
-                       if (!yesno)
+                       if (!ask_noyes(NULL))
                                goto edit;
                        /* The user is shooting themselves in the foot here...*/
                } else
@@ -169,8 +168,7 @@
                 * don't all have bootmenu texts.
                 */
                msg_display(MSG_missing_bootmenu_text);
-               process_menu(MENU_yesno, NULL);
-               if (yesno)
+               if (ask_yesno(NULL))
                        goto edit;
        }
 
@@ -178,8 +176,7 @@
            (biosdisk == NULL || !(biosdisk->bi_flags & BIFLAG_EXTINT13))) {
                /* Need unsupported LBA reads to read boot sectors */
                msg_display(MSG_no_extended_bootmenu);
-               process_menu(MENU_noyes, NULL);
-               if (!yesno)
+               if (!ask_noyes(NULL))
                        goto edit;
        }
 
@@ -215,8 +212,7 @@
                /* Existing code would (probably) be ok */
                msg_display(MSG_updatembr);
 
-       process_menu(MENU_yesno, NULL);
-       if (!yesno)
+       if (!ask_yesno(NULL))
                /* User doesn't want to update mbr code */
                return 1;
 
@@ -226,7 +222,7 @@
 
        /* This shouldn't happen since the files are in the floppy fs... */
        msg_display("Can't find %s", bootcode);
-       process_menu(MENU_yesno, NULL);
+       ask_yesno(NULL);
 
        return 1;
 }
diff -r 2031727e7167 -r eed266344d3d usr.sbin/sysinst/arch/mac68k/md.c
--- a/usr.sbin/sysinst/arch/mac68k/md.c Thu May 14 07:27:47 2015 +0000
+++ b/usr.sbin/sysinst/arch/mac68k/md.c Thu May 14 07:58:49 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md.c,v 1.2 2014/08/03 16:09:40 martin Exp $ */
+/*     $NetBSD: md.c,v 1.2.4.1 2015/05/14 07:58:49 snj Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -239,7 +239,7 @@
 md_make_bsd_partitions(void)
 {
        FILE *f;
-       int i, j, pl;
+       int i, j, pl, rv;
        EBZB *bzb;
 
        /*
@@ -250,10 +250,10 @@
         */
        while (1) {
            if (check_for_errors()) {
-               process_menu (MENU_sanity, NULL);
-               if (yesno < 0)
+               process_menu (MENU_sanity, &rv);
+               if (rv < 0)
                    return 0;
-               else if (yesno)
+               else if (rv)
                    break;
                edit_diskmap();
            } else
@@ -1141,8 +1141,7 @@
        if (usefull) {
            if (map.usable_cnt > (map.root_cnt+map.swap_cnt+map.usr_cnt)) {
                msg_display (MSG_ovrwrite);
-               process_menu (MENU_noyes, NULL);
-               if (!yesno) {
+               if (!ask_noyes(NULL)) {
                        endwin();
                        return 0;
                }
@@ -1167,7 +1166,7 @@
 {
        char buf[96], type;
        char fstyp[16], use[16], name[64];
-       int i, j;
+       int i, j, rv;
        EBZB *bzb;
 
        msg_clear();
@@ -1188,9 +1187,9 @@
                map.blk[i].pmPyPartStart, fstyp, use, name);
            msg_table_add(MSG_dump_line, buf);
        }
-       process_menu(MENU_okabort, NULL);
+       process_menu(MENU_okabort, &rv);
        msg_clear();
-       return(yesno);
+       return rv;
 }
 #endif /* MD_DEBUG_SORT_MERGE */
 
diff -r 2031727e7167 -r eed266344d3d usr.sbin/sysinst/arch/mac68k/menus.md.de
--- a/usr.sbin/sysinst/arch/mac68k/menus.md.de  Thu May 14 07:27:47 2015 +0000
+++ b/usr.sbin/sysinst/arch/mac68k/menus.md.de  Thu May 14 07:58:49 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: menus.md.de,v 1.2 2014/08/03 16:09:40 martin Exp $     */
+/*     $NetBSD: menus.md.de,v 1.2.4.1 2015/05/14 07:58:49 snj Exp $    */
 



Home | Main Index | Thread Index | Old Index