From ab29f587e9e3d270978de356c19d569d4ef6987d Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Thu, 20 Mar 2008 17:47:29 +0000 Subject: replace home path in user config files when renaming a user (#30380) --- perl-install/NEWS | 1 + perl-install/standalone/finish-install | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/perl-install/NEWS b/perl-install/NEWS index a000794c6..460d4535b 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -7,6 +7,7 @@ cancel is clicked (clean wizard window instead) - finish-install: o allow to ask both root and user accounts in the same step + o replace home path in user config files when renaming a user (#30380) Version 10.17 - 20 March 2008 diff --git a/perl-install/standalone/finish-install b/perl-install/standalone/finish-install index b4c11cb62..4618ab2aa 100755 --- a/perl-install/standalone/finish-install +++ b/perl-install/standalone/finish-install @@ -118,6 +118,12 @@ sub ask_users() { any::add_users($users, $authentication); any::set_autologin($in->do_pkgs, $users->[0]{name}, $autologin_first) if $autologin_first; + if ($old_user) { + #- replace home path in user config files + my $old_home = "/home/$old_user"; + my $new_home = "/home/$users->[0]{name}"; + run_program::run("grep -rl $old_home $new_home/.??* | while read f; do perl -pi -e 's,$old_home,$new_home,g' \"\$f\"; done"); + } } sub ask_glx() { -- cgit v1.2.1