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

Re: [Xen-devel] [PATCH v4 13/16] osstest: change the meaning of need_build_host



On Thu, Jul 06, 2017 at 04:37:10PM +0100, Ian Jackson wrote:
> Roger Pau Monne writes ("[PATCH v4 13/16] osstest: change the meaning of 
> need_build_host"):
> > Make need_build_host store a string instead of a boolean. This is
> > later going to be expanded to handle the FreeBSD build jobs.
> ...
> > -    if {$need_build_host} { catching-otherwise broken allocate-build-host }
> > +    if {[llength $need_build_host]} {
> > +        catching-otherwise broken allocate-build-host $need_build_host
> > +    }
> 
> I think you mean
> 
>   +    if {[llength $need_build_host]} {
>   +        catching-otherwise broken { allocate-build-host $need_build_host }
>   +    }
> 
> catching-otherwise takes a script as its second argument.  The script
> can be a whole { } block and can refer to variables in the same scope
> (since it is invoked with uplevel).
> 
> Ie, catching-otherwise is a user-defined control construct.  You can
> use it like "if" or something.  The omission of the braces in the old
> code is simply because if the code to be executed is a single
> argumentless procedure call, they aren't needed.

Heh, I told you I would try to do it the C way ;). Thanks for the
comment, it's now fixed.

> So:
> 
> > -    if {$need_build_host} { catching-otherwise broken prepare-build-host }
> > +    if {[llength $need_build_host]} {
> > +        catching-otherwise broken \
> > +                           prepare-build-host-[string tolower 
> > $need_build_host]
> 
> Instead:
> 
>   +        catching-otherwise broken {
>   +            prepare-build-host-[string tolower $need_build_host]
>   +        }
> > +    }
> 
> > -proc need-hosts/build {} { return BUILD }
> > -proc need-hosts/build-kern {} { return BUILD }
> > -proc need-hosts/build-libvirt {} { return BUILD }
> > -proc need-hosts/build-rumprun {} { return BUILD }
> > -proc need-hosts/build-xtf {} { return BUILD }
> > +proc need-hosts/build {} { return BUILD_LINUX }
> > +proc need-hosts/build-kern {} { return BUILD_LINUX }
> > +proc need-hosts/build-libvirt {} { return BUILD_LINUX }
> > +proc need-hosts/build-rumprun {} { return BUILD_LINUX }
> > +proc need-hosts/build-xtf {} { return BUILD_LINUX }
> 
> I wish I had made these line up neatly!  Sorry.

Would you like me to align the '{ return ...' block (align on the
first { of the body).

Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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