[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why my AT_CHECK() can't work?
From: |
Sam |
Subject: |
Re: Why my AT_CHECK() can't work? |
Date: |
Fri, 18 Aug 2017 11:54:51 +0800 |
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 <address@hidden>:
> 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
>
>
- Why my AT_CHECK() can't work?, Sam, 2017/08/09
- Re: Why my AT_CHECK() can't work?, Sam, 2017/08/09
- Re: Why my AT_CHECK() can't work?, Eric Blake, 2017/08/09
- Re: Why my AT_CHECK() can't work?, Zack Weinberg, 2017/08/09
- Re: Why my AT_CHECK() can't work?, Sam, 2017/08/09
- Re: Why my AT_CHECK() can't work?, Sam, 2017/08/09
- Re: Why my AT_CHECK() can't work?, Eric Blake, 2017/08/10
- Re: Why my AT_CHECK() can't work?,
Sam <=
- Re: Why my AT_CHECK() can't work?, Eric Blake, 2017/08/18
Re: Why my AT_CHECK() can't work?, Eric Blake, 2017/08/09