From e73c4fe5eb83eaa32b52a9d9eb8e8e00d12564d7 Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Tue, 11 May 1999 08:00:06 +0000 Subject: [PATCH] Preserve /root's dotfiles across upgrades too. PR: 6559 --- release/sysinstall/installUpgrade.c | 6 +++++- usr.sbin/sysinstall/installUpgrade.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/release/sysinstall/installUpgrade.c b/release/sysinstall/installUpgrade.c index b153e02e8b30..49caf3d3b8cc 100644 --- a/release/sysinstall/installUpgrade.c +++ b/release/sysinstall/installUpgrade.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: installUpgrade.c,v 1.65 1999/03/19 08:22:31 jkh Exp $ + * $Id: installUpgrade.c,v 1.66 1999/04/07 03:06:44 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -280,6 +280,8 @@ installUpgrade(dialogMenuItem *self) if (msgYesNo("Unable to backup your /etc into %s.\n" "Do you want to continue anyway?", saved_etc) != 0) return DITEM_FAILURE | DITEM_RESTORE; + msgNotify("Preserving /root directory.."); + vsystem("tar -cBpf - -C / root | tar --unlink -xBpf - -C %s", saved_etc); } msgNotify("chflags'ing old binaries - please wait."); @@ -353,6 +355,8 @@ media: else { /* Now try to resurrect the /etc files */ traverseHitlist(etc_files); + /* Resurrect the root dotfiles */ + vsystem("tar -cBpf - root | tar -xBpf - -C / && rm -rf root"); } msgConfirm("Upgrade completed! All of your old /etc files have been restored.\n" diff --git a/usr.sbin/sysinstall/installUpgrade.c b/usr.sbin/sysinstall/installUpgrade.c index b153e02e8b30..49caf3d3b8cc 100644 --- a/usr.sbin/sysinstall/installUpgrade.c +++ b/usr.sbin/sysinstall/installUpgrade.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: installUpgrade.c,v 1.65 1999/03/19 08:22:31 jkh Exp $ + * $Id: installUpgrade.c,v 1.66 1999/04/07 03:06:44 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -280,6 +280,8 @@ installUpgrade(dialogMenuItem *self) if (msgYesNo("Unable to backup your /etc into %s.\n" "Do you want to continue anyway?", saved_etc) != 0) return DITEM_FAILURE | DITEM_RESTORE; + msgNotify("Preserving /root directory.."); + vsystem("tar -cBpf - -C / root | tar --unlink -xBpf - -C %s", saved_etc); } msgNotify("chflags'ing old binaries - please wait."); @@ -353,6 +355,8 @@ media: else { /* Now try to resurrect the /etc files */ traverseHitlist(etc_files); + /* Resurrect the root dotfiles */ + vsystem("tar -cBpf - root | tar -xBpf - -C / && rm -rf root"); } msgConfirm("Upgrade completed! All of your old /etc files have been restored.\n"