From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1SfWOj-00026k-0q for garchives@archives.gentoo.org; Fri, 15 Jun 2012 13:17:10 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 697E8E0839; Fri, 15 Jun 2012 13:16:54 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 7D82BE07F7 for ; Fri, 15 Jun 2012 13:16:13 +0000 (UTC) Received: from [192.168.1.145] (CPE002401f30b73-CM001cea3ddad8.cpe.net.cable.rogers.com [99.240.69.152]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: axs) by smtp.gentoo.org (Postfix) with ESMTPSA id D39D11B400F for ; Fri, 15 Jun 2012 13:16:12 +0000 (UTC) Message-ID: <4FDB35AB.8060200@gentoo.org> Date: Fri, 15 Jun 2012 09:16:27 -0400 From: Ian Stakenvicius User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.4) Gecko/20120511 Thunderbird/10.0.4 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] RFC: esethome References: <4FD8B910.3090606@gentoo.org> <201206131514.51074.vapier@gentoo.org> <4FD8EB8C.90701@gentoo.org> <201206131651.12444.vapier@gentoo.org> In-Reply-To: <201206131651.12444.vapier@gentoo.org> X-Enigmail-Version: 1.3.5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Archives-Salt: fde735b9-08e0-47d8-a27a-e5edc1a5de89 X-Archives-Hash: 3d789b7d5b380b4aa6a952b9896ccf95 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 13/06/12 04:51 PM, Mike Frysinger wrote: > 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: +# @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 So outside of syntax issues like above, anyone have any issues with my adding this to user.eclass ? -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) iF4EAREIAAYFAk/bNaoACgkQ2ugaI38ACPAFRgEApwLkrsqSIW0nVK4l/dUTRzV9 ijEnbfa+BLc1skwfW4QA+gKgpmsz/K5VqXnVWyXocGqO98RYJL8lL3qm7k0Hs6uZ =9i38 -----END PGP SIGNATURE-----