From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aron Griffis Subject: Re: [PATCH 2 of 2] Make tools/check scripts cross-friendly Date: Mon, 21 Jan 2008 09:50:08 -0500 Message-ID: <20080121145008.GA9541@fc.hp.com> References: <735710fbd87c8c3701bb.1200715351@jenkins.nashua> <200801211205.42249.Christoph.Egger@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <200801211205.42249.Christoph.Egger@amd.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Christoph Egger Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Christoph Egger wrote: [Mon Jan 21 2008, 06:05:42AM EST] > > diff -r 79cf8ffbc667 -r 735710fbd87c tools/check/check_udev > > --- a/tools/check/check_udev Fri Jan 18 22:59:53 2008 -0500 > > +++ b/tools/check/check_udev Fri Jan 18 22:59:53 2008 -0500 > > @@ -1,34 +1,19 @@ > > #!/bin/sh > > # CHECK-INSTALL > > > > -RC=0 > > +. funcs.sh > > > > -case ${OS} in > > +case $OS in > > OpenBSD|NetBSD|FreeBSD) > > - TOOL="vnconfig" > > - which ${TOOL} 1>/dev/null 2>&1 || RC=1 > > + has_or_fail vncconfig > ^^^^^^ > Typo!! Thanks, will fix and repost. > > -if test "${OS}" = "SunOS"; then > > +if [ "$OS" = "SunOS" ]; then > > What does this fix? I tried to make the scripts more consistently written while working on them. > Don't change this if you can't test on Solaris. *shrug* This works on every Bourne shell on every Solaris. I'll change it back if you want, but it's pointless. > > +has_lib() { > > + check_sys_root || return 1 > > + > > + # subshell to prevent pollution of caller's environment > > + ( > > + PATH=/sbin:$PATH # for ldconfig > > + > > + # This relatively common in a sys-root; libs are installed but > > + # ldconfig hasn't run there, so ldconfig -p won't work. We can > > + # only fix it if it's writeable. > > + [ "$OS" != Linux ] || \ > > + [ -f "$CROSS_SYS_ROOT/etc/ld.so.cache" ] || \ > > + ldconfig -r "$CROSS_SYS_ROOT" && \ > > + ldconfig -p ${CROSS_SYS_ROOT+-r "$CROSS_SYS_ROOT"} | grep -Fq "$1" > > + return $? > > + ) > > +} > > This can be more readable with "if test" constructs. Yeah, I wasn't very happy with that either. I'll make it better, thanks. Aron