Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Apr 1995 02:32:40 -0700
From:      "Jordan K. Hubbard" <jkh@freefall.cdrom.com>
To:        asami@cs.berkeley.edu (Satoshi Asami | =?ISO-2022-JP?B?GyRCQHUbKEI=?= =?ISO-2022-JP?B?GyRCOCsbKEIgGyRCOC0bKEI=?=)
Cc:        rgrimes@gndrsh.aac.dev.com, adam@FreeBSD.org, pst@FreeBSD.org, ports@FreeBSD.org
Subject:   Re: cnews fails if user "news" doesn't exist 
Message-ID:  <27638.798197560@freefall.cdrom.com>
In-Reply-To: Your message of "Tue, 18 Apr 95 01:39:33 PDT." <199504180839.BAA03357@silvia.HIP.Berkeley.EDU> 

next in thread | previous in thread | raw e-mail | index | archive | help
It looks good to me.  I presume you can do this with files/pre-fetch
rather than a target, so that it's easier to clone? :-)

						Jordan

>  * > But a "make world" doesn't update master.passwd, so we still need to
>  * > do something about this from the ports standpoint (for people who did
>  * > a source upgrade).  Any ideas?
>  * 
>  * Use grep -q to find out if the user and the group exists, if it does not
>  * fail the make and tell the user to add the news accounts???
> 
> I was thinking more about using "id".  The grep idea (I assume you are
> saying we should search /etc/passwd, right?) may fail when the site is
> using NIS.
> 
> I guess we can put this in the pre-fetch target for all our news ports 
> (so the user can solve the problem first).  Something like:
> 
> #!/bin/sh
> if ! id -u news > /dev/null 2>&1; then
>   echo "You need an account \"news\" to install this package."
>   if [ `id -u` != 0 ]; then
>     echo "Please become root and either use \"adduser\" or try \"make\" again
."
>     exit 1
>   fi
>   echo "Let me start an adduser for you...."
>   sleep 5
>   adduser
>   if ! id -u news > /dev/null 2>&1; then
>     echo "Hey!  I told you to add an account \"news\"!"
>     echo "Well, I'm giving up now, but please try again, okay."
>     exit 1
>   fi
> fi
> 
> What do you guys think?
> 
> Satoshi




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?27638.798197560>