From owner-freebsd-ports Tue Apr 18 01:39:53 1995 Return-Path: ports-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id BAA24776 for ports-outgoing; Tue, 18 Apr 1995 01:39:53 -0700 Received: from silvia.HIP.Berkeley.EDU (silvia.HIP.Berkeley.EDU [136.152.64.181]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id BAA24768 ; Tue, 18 Apr 1995 01:39:44 -0700 Received: (from asami@localhost) by silvia.HIP.Berkeley.EDU (8.6.9/8.6.9) id BAA03357; Tue, 18 Apr 1995 01:39:33 -0700 Date: Tue, 18 Apr 1995 01:39:33 -0700 Message-Id: <199504180839.BAA03357@silvia.HIP.Berkeley.EDU> To: rgrimes@gndrsh.aac.dev.com CC: adam@FreeBSD.org, pst@FreeBSD.org, ports@FreeBSD.org In-reply-to: <199504180818.BAA11997@gndrsh.aac.dev.com> (rgrimes@gndrsh.aac.dev.com) Subject: Re: cnews fails if user "news" doesn't exist From: asami@cs.berkeley.edu (Satoshi Asami | =?ISO-2022-JP?B?GyRCQHUbKEI=?= =?ISO-2022-JP?B?GyRCOCsbKEIgGyRCOC0bKEI=?=) Sender: ports-owner@FreeBSD.org Precedence: bulk * > 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