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
1 On Wednesday 13 June 2012 15:35:40 Ian Stakenvicius wrote:
2 > --- user.eclass [some timestamp]
3 > +++ user.eclass.esethome [some other timestamp]
4 > @@ -388,3 +388,63 @@
5 > }
6 >
7 > fi
8 > +
9 > +# @FUNCTION: esethome
10
11 has to be inside the giant if block. so put this above the "fi".
12
13 > +# @USAGE: <user> <homedir>
14 > +# @DESCRIPTION:
15 > +# Update the home directory in a platform-agnostic way.
16 > +# Required parameters is the username and the new home directory.
17 > +# Specify -1 if you want to set home to the enewuser default
18 > +# of /dev/null.
19 > +# If the new home directory does not exist, it is created.
20 > +# Any previously existing home directory is NOT moved.
21 > +esethome() {
22 > + _assert_pkg_ebuild_phase ${FUNCNAME}
23 > +
24 > + # get the username
25 > + local euser=$1; shift
26 > + if [[ -z ${euser} ]] ; then
27 > + eerror "No username specified !"
28 > + die "Cannot call esethome without a username"
29 > + fi
30 > +
31 > + # lets see if the username already exists
32 > + if [[ ! -n $(egetent passwd "${euser}") ]] ; then
33
34 "! -n" -> "-z"
35 -mike

Attachments

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

Replies

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