Gentoo Archives: gentoo-dev

From: Mike Frysinger <vapier@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] RFC: esethome
Date: Wed, 13 Jun 2012 20:52:27
Message-Id: 201206131651.12444.vapier@gentoo.org
In Reply to: Re: [gentoo-dev] RFC: esethome by Ian Stakenvicius
On Wednesday 13 June 2012 15:35:40 Ian Stakenvicius wrote:
> --- user.eclass [some timestamp] > +++ user.eclass.esethome [some other timestamp] > @@ -388,3 +388,63 @@ > } > > fi > + > +# @FUNCTION: esethome
has to be inside the giant if block. so put this above the "fi".
> +# @USAGE: <user> <homedir> > +# @DESCRIPTION: > +# Update the home directory in a platform-agnostic way. > +# Required parameters is the username and the new home directory. > +# Specify -1 if you want to set home to the enewuser default > +# of /dev/null. > +# If the new home directory does not exist, it is created. > +# Any previously existing home directory is NOT moved. > +esethome() { > + _assert_pkg_ebuild_phase ${FUNCNAME} > + > + # get the username > + local euser=$1; shift > + if [[ -z ${euser} ]] ; then > + eerror "No username specified !" > + die "Cannot call esethome without a username" > + fi > + > + # lets see if the username already exists > + if [[ ! -n $(egetent passwd "${euser}") ]] ; then
"! -n" -> "-z" -mike

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] RFC: esethome Peter Stuge <peter@×××××.se>
Re: [gentoo-dev] RFC: esethome Ian Stakenvicius <axs@g.o>