From f01642e2c02fb1eea836b7722bb3b730e782f63b Mon Sep 17 00:00:00 2001 From: snj Date: Fri, 9 Oct 2009 21:11:31 +0000 Subject: [PATCH] - 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. --- distrib/utils/sysinst/util.c | 43 ++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/distrib/utils/sysinst/util.c b/distrib/utils/sysinst/util.c index 4440ce884bea..ca93ac029652 100644 --- a/distrib/utils/sysinst/util.c +++ b/distrib/utils/sysinst/util.c @@ -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 @@ extract_file(distinfo *dist, int update) 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 @@ extract_file(distinfo *dist, int update) /* 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 @@ get_and_unpack_sets(int update, msg setupdone_msg, msg success_msg, msg failure_ 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();