]> xenbits.xensource.com Git - libvirt.git/commit
virt-result.m4: Colourize summary printings
authorMichal Privoznik <mprivozn@redhat.com>
Sat, 7 Sep 2019 11:11:59 +0000 (13:11 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 12 Sep 2019 13:10:39 +0000 (15:10 +0200)
commit4b3ab5d2135a0dccd654491ef3a4f5b71575deae
treeda23f3bc7178ababe29f0f2b4b2fcdff6d65891c
parentc98174ce087fe23f567292132e961d4685faf337
virt-result.m4: Colourize summary printings

The LIBVIRT_RESULT function takes two or three arguments. The
first one is the name of the result (aka CHECK_NAME). It is
printed before the colon character. The rest of the arguments is
printed after the character. To produce colourized output a
couple of changes needs to be made.

Firstly, we need to print the CHECK_NAME using "echo -n" so that
the new line is not appended at the end of the message. To
achieve this, AS_MESSAGE_N function is introduced. It's a
verbatim copy of AS_MESSAGE (which is just another alias to
AC_MSG_NOTICE) except it doesn't put '\n' at the EOL.

The alias is defined at /usr/share/autoconf-*/autoconf/general.m4
and the AS_MESSAGE is then defined at
/usr/share/autoconf-2.69/m4sugar/m4sh.m4.

Secondly, the rest of the arguments are printed colourized and to
achieve that and also keep printing them into the log file the
_AS_ECHO and COLORIZE_RESULT functions need to be called.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
m4/virt-result.m4