Subject: Re: review wanted: su/cvs return code checking (resend)
To: Alistair Crooks <agc@pkgsrc.org>
From: Gavan Fantom <gavan@coolfactor.org>
List: tech-pkg
Date: 11/27/2003 12:37:02
On Thu, 27 Nov 2003, Alistair Crooks wrote:

> How about (not tried):
>
> 	if ${ID} ${CVS_USER} > /dev/null 2>&1; then			\
> 		su - ${CVS_USER} -c 'stty sane ; setenv CVS_RSH ssh ; cd '${USR_PKGSRC}' ; cvs -q update -Pd '"${CVS_FLAGS}"' || exit 0'; \
> 		if [ $? != 0 ]; then					\
> 			...						\
> 		fi;							\
> 	else								\
> 		echo "*** $${CVS_USER} (${CVS_USER}) does not exist ***" 2>&1; \
> 		exit 1;							\
> 	fi

I think we should be losing the reliance on ${CVS_USER} having a csh-style
shell. Maybe by explicitly invoking a shell?

Also, I guess it couldn't hurt to variablise ${SSH} and ${CVS}.

-- 
Gillette - the best a man can forget