Module Name: src Committed By: sborrill Date: Sat Oct 10 20:22:34 UTC 2009
Modified Files: src/distrib/utils/sysinst [netbsd-5]: util.c Log Message: Pull up the following revisions(s) (requested by snj in ticket #1082): distrib/utils/sysinst/util.c: revision 1.161 Don't extract xetc to /, but rather in /.sysinst (like etc) so 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. To generate a diff of this commit: cvs rdiff -u -r1.151.14.3 -r1.151.14.4 src/distrib/utils/sysinst/util.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/distrib/utils/sysinst/util.c diff -u src/distrib/utils/sysinst/util.c:1.151.14.3 src/distrib/utils/sysinst/util.c:1.151.14.4 --- src/distrib/utils/sysinst/util.c:1.151.14.3 Fri Oct 9 08:09:24 2009 +++ src/distrib/utils/sysinst/util.c Sat Oct 10 20:22:34 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: util.c,v 1.151.14.3 2009/10/09 08:09:24 sborrill Exp $ */ +/* $NetBSD: util.c,v 1.151.14.4 2009/10/10 20:22:34 sborrill Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -669,7 +669,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 @@ -710,23 +710,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; @@ -847,6 +830,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();