[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 2 of 2] Make tools/check scripts cross-friendly



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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.