Source-Changes-HG archive

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

[src/trunk]: src/distrib/utils/sysinst - Don't extract xetc to /, but rather ...



details:   https://anonhg.NetBSD.org/src/rev/d9b8246eb44d
branches:  trunk
changeset: 748027:d9b8246eb44d
user:      snj <snj%NetBSD.org@localhost>
date:      Fri Oct 09 21:11:31 2009 +0000

description:
- Don't extract xetc to /, but rather in /.sysinst (like etc) so that we
  don't blow away existing config files.
- Wait until all sets have been unpacked to run postinstall.  Previously
  we ran it after extracting etc, which meant that /var/db/obsolete/ was
  not fully populated.

diffstat:

 distrib/utils/sysinst/util.c |  43 ++++++++++++++++++++++++-------------------
 1 files changed, 24 insertions(+), 19 deletions(-)

diffs (71 lines):

diff -r 17a222387a71 -r d9b8246eb44d distrib/utils/sysinst/util.c
--- a/distrib/utils/sysinst/util.c      Fri Oct 09 21:06:01 2009 +0000
+++ b/distrib/utils/sysinst/util.c      Fri Oct 09 21:11:31 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: util.c,v 1.160 2009/10/08 06:41:43 snj Exp $   */
+/*     $NetBSD: util.c,v 1.161 2009/10/09 21:11:31 snj Exp $   */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -662,7 +662,7 @@
 
        tarstats.nfound++;      
        /* cd to the target root. */
-       if (update && dist->set == SET_ETC) {
+       if (update && (dist->set == SET_ETC || dist->set == SET_X11_ETC)) {
                make_target_dir("/.sysinst");
                target_chdir_or_die("/.sysinst");
        } else
@@ -696,23 +696,6 @@
                /* Plausibly we should unlink an empty xfer_dir as well */
        }
 
-       if (update && dist->set == SET_ETC) {
-               int oldsendmail;
-               oldsendmail = run_program(RUN_DISPLAY | RUN_CHROOT |
-                                         RUN_ERROR_OK | RUN_PROGRESS,
-                                         "/usr/sbin/postinstall -s /.sysinst -d / check mailerconf");
-               if (oldsendmail == 1) {
-                       msg_display(MSG_oldsendmail);
-                       process_menu(MENU_yesno, NULL);
-                       if (yesno) {
-                               run_program(RUN_DISPLAY | RUN_CHROOT,
-                                           "/usr/sbin/postinstall -s /.sysinst -d / fix mailerconf");
-                       }
-               }
-               run_program(RUN_DISPLAY | RUN_CHROOT,
-                       "/usr/sbin/postinstall -s /.sysinst -d / fix");
-       }
-
        set_status[dist->set] |= SET_INSTALLED;
        tarstats.nsuccess++;
        return SET_OK;
@@ -829,6 +812,28 @@
                msg_clear();
        }
 
+       /*
+        * postinstall needs to be run after extracting all sets, because
+        * otherwise /var/db/obsolete will only have current information
+        * from the base, comp, and etc sets.
+        */
+       if (update && (set_status[SET_ETC] & SET_INSTALLED)) {
+               int oldsendmail;
+               oldsendmail = run_program(RUN_DISPLAY | RUN_CHROOT |
+                                         RUN_ERROR_OK | RUN_PROGRESS,
+                                         "/usr/sbin/postinstall -s /.sysinst -d / check mailerconf");
+               if (oldsendmail == 1) {
+                       msg_display(MSG_oldsendmail);
+                       process_menu(MENU_yesno, NULL);
+                       if (yesno) {
+                               run_program(RUN_DISPLAY | RUN_CHROOT,
+                                           "/usr/sbin/postinstall -s /.sysinst -d / fix mailerconf");
+                       }
+               }
+               run_program(RUN_DISPLAY | RUN_CHROOT,
+                       "/usr/sbin/postinstall -s /.sysinst -d / fix");
+       }
+
        /* Configure the system */
        if (set_status[SET_BASE] & SET_INSTALLED)
                run_makedev();



Home | Main Index | Thread Index | Old Index