[xen-tools] Re: hook scripts issue, and patch
Eric Lemoine
eric.lemoine at gmail.com
Thu Oct 19 18:29:18 CEST 2006
On 10/19/06, Eric Lemoine <eric.lemoine at gmail.com> wrote:
> On 10/19/06, Eric Lemoine <eric.lemoine at gmail.com> wrote:
> > On 10/19/06, Steve Kemp <steve at steve.org.uk> wrote:
> > > On Thu, Oct 19, 2006 at 06:06:27PM +0200, Eric Lemoine wrote:
> > >
> > > > I like the assert() function. I'm currently looking into a solution
> > > > that keeps assert() around...
> > >
> > > Much appreciated. I'll not do anything tonight and see if you
> > > find a good solution. If not I think on reflection I'd be prepared
> > > to lose them.
> >
> > By the way there's a bug in the assert function. You use the variable
> > $line and then $lineno. I'll address that as well if I can come up
> > with a good solution.
>
> What do you think about that:
>
> assert ()
> {
> lineno="?"
>
> if [ -n "${LINENO}" ]; then
> # our shell defines variable LINENO, great!
> lineno=$1
> shift
> fi
>
> if [ ! $* ] ; then
> echo "assert failed: $0:$lineno [$*]"
> exit
> fi
> }
>
>
> Personnally, I like it ;-)
Patch attached. To be applied on top of my first patch.
--
Eric
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xen-tools-assert.patch
Type: text/x-patch
Size: 613 bytes
Desc: not available
URL: <http://sym.noone.org/pipermail/xen-tools-discuss/attachments/20061019/7cf8b81a/attachment.bin>
More information about the xen-tools-discuss
mailing list