- 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.
This commit is contained in:
snj 2009-10-09 21:11:31 +00:00
parent c9e443d2ee
commit f01642e2c0
1 changed files with 24 additions and 19 deletions

View File

@ -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();