Re: Why my AT_CHECK() can't work?

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

 



Could I use regular match in AT_CHECK? Like this:

m4_define([OVS_VSWITCHD_STOP],
>   [AT_CHECK([/etc/init.d/openvswitch stop], [0], [stdout], [])
>   AT_CHECK([[awk '/Killing ovsdb-server/' stdout | sed  -e 's/[ ]*$//g']],
> [0], [Killing ovsdb-server ([0-9]*)
> ])
> ])


2017-08-10 21:40 GMT+08:00 Eric Blake <eblake@xxxxxxxxxx>:

> On 08/09/2017 09:56 PM, Sam wrote:
> > Yes, it's because a space at the end of line:
> >
> > --- -^I2017-08-10 10:51:06.097868811 +0800$
> >> +++
>
> > but in my match, I add a space, I don't know why it doesn't work.
> >
> > AT_CHECK([[awk '/ACTIVE/' stdout | head -4]], [0], [LACP actor_state
> ACTIVE
> >> AGGREGATION SYNC COLLECTING DISTRIBUTING $
> >>      partner_state ACTIVE AGGREGATION SYNC COLLECTING DISTRIBUTING $
> >> LACP actor_state ACTIVE AGGREGATION SYNC COLLECTING DISTRIBUTING $
> >>      partner_state ACTIVE AGGREGATION SYNC COLLECTING DISTRIBUTING $
> >> ])$
>
> Because autoconf eats trailing spaces by default (it's a feature).  You
> can work around it by TELLING autoconf that you intend for there to be
> trailing space:
>
> AT_CHECK(..., [[trailing space preserved here: @&t@
> but not here
> more text]])
>
> The @&t@ quadrigraph (mnemonic 'and-t' sounds similar to 'empty')
> expands to nothing, but is converted after the point when trailing
> whitespace is eaten.
>
> The manual documents this:
> https://www.gnu.org/software/autoconf/manual/autoconf.html#Quadrigraphs
>
> --
> Eric Blake, Principal Software Engineer
> Red Hat, Inc.           +1-919-301-3266
> Virtualization:  qemu.org | libvirt.org
>
>
_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://lists.gnu.org/mailman/listinfo/autoconf



[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux