summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Stakenvicius <axs@gentoo.org>2012-06-22 18:57:33 +0000
committerIan Stakenvicius <axs@gentoo.org>2012-06-22 18:57:33 +0000
commit32ed5de243de6618bab1651796bfc004d6d90def (patch)
tree4a9e54a840804432584fdc02511700f6a103dcc6 /eclass/user.eclass
parentAdd missing user eclass inherit (diff)
downloadgentoo-2-32ed5de243de6618bab1651796bfc004d6d90def.tar.gz
gentoo-2-32ed5de243de6618bab1651796bfc004d6d90def.tar.bz2
gentoo-2-32ed5de243de6618bab1651796bfc004d6d90def.zip
esethome: eerror and not die when home dir cannot be updated, due to for instance user being in use
Diffstat (limited to 'eclass/user.eclass')
-rw-r--r--eclass/user.eclass15
1 files changed, 11 insertions, 4 deletions
diff --git a/eclass/user.eclass b/eclass/user.eclass
index 5261c2ddd47e..9f9f684d66b7 100644
--- a/eclass/user.eclass
+++ b/eclass/user.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.20 2012/06/22 15:14:10 axs Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.21 2012/06/22 18:57:33 axs Exp $
# @ECLASS: user.eclass
# @MAINTAINER:
@@ -439,14 +439,21 @@ esethome() {
;;
*-freebsd*|*-dragonfly*)
- pw usermod "${euser}" -d "${ehome}" || die
+ pw usermod "${euser}" -d "${ehome}" && return 0
+ [[ $? == 8 ]] && eerror "${euser} is in use, cannot update home"
+ eerror "There was an error when attempting to update the home directory for ${euser}"
+ eerror "Please update it manually on your system:"
+ eerror "\t pw usermod \"${euser}\" -d \"${ehome}\""
;;
*)
- usermod -d "${ehome}" "${euser}" || die
+ usermod -d "${ehome}" "${euser}" && return 0
+ [[ $? == 8 ]] && eerror "${euser} is in use, cannot update home"
+ eerror "There was an error when attempting to update the home directory for ${euser}"
+ eerror "Please update it manually on your system (as root):"
+ eerror "\t usermod -d \"${ehome}\" \"${euser}\""
;;
esac
-
}
fi