/[gentoo-x86]/eclass/user.eclass
Gentoo

Diff of /eclass/user.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.19 Revision 1.20
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2012 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.19 2012/06/18 16:51:34 axs Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/user.eclass,v 1.20 2012/06/22 15:14:10 axs Exp $
4 4
5# @ECLASS: user.eclass 5# @ECLASS: user.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# base-system@gentoo.org (Linux) 7# base-system@gentoo.org (Linux)
8# Joe Jezak <josejx@gmail.com> (OS X) 8# Joe Jezak <josejx@gmail.com> (OS X)
422 if [[ ${ehome} == "-1" ]] ; then 422 if [[ ${ehome} == "-1" ]] ; then
423 ehome="/dev/null" 423 ehome="/dev/null"
424 fi 424 fi
425 einfo " - Home: ${ehome}" 425 einfo " - Home: ${ehome}"
426 426
427 # update the home directory 427 # ensure home directory exists, otherwise update will fail
428 case ${CHOST} in
429 *-darwin*)
430 dscl . change "/users/${euser}" home "${ehome}"
431 ;;
432
433 *-freebsd*|*-dragonfly*)
434 pw usermod "${euser}" -d "${ehome}" || die
435 ;;
436
437 *)
438 usermod -d "${ehome}" "${euser}" || die
439 ;;
440 esac
441
442 if [[ ! -e ${ROOT}/${ehome} ]] ; then 428 if [[ ! -e ${ROOT}/${ehome} ]] ; then
443 einfo " - Creating ${ehome} in ${ROOT}" 429 einfo " - Creating ${ehome} in ${ROOT}"
444 mkdir -p "${ROOT}/${ehome}" 430 mkdir -p "${ROOT}/${ehome}"
445 chown "${euser}" "${ROOT}/${ehome}" 431 chown "${euser}" "${ROOT}/${ehome}"
446 chmod 755 "${ROOT}/${ehome}" 432 chmod 755 "${ROOT}/${ehome}"
447 fi 433 fi
434
435 # update the home directory
436 case ${CHOST} in
437 *-darwin*)
438 dscl . change "/users/${euser}" home "${ehome}"
439 ;;
440
441 *-freebsd*|*-dragonfly*)
442 pw usermod "${euser}" -d "${ehome}" || die
443 ;;
444
445 *)
446 usermod -d "${ehome}" "${euser}" || die
447 ;;
448 esac
449
448} 450}
449 451
450fi 452fi

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

  ViewVC Help
Powered by ViewVC 1.1.20