Subject: bug#18734: [PATCH] vala: Improper parsing of valac arguments leads to garbage in DIST_COMMON

From: Karl Berry <[email-masked]>
Date: Wed, 1 Apr 2020 19:13:04 -0600

Hi Colomban - back on your automake bug report from six years ago (sorry!):

    Date: Wed, 15 Oct 2014 17:17:00 +0200
    From: Colomban Wendling

    [...]
    The problem is that parsing of valac flags uses a non-anchored pattern
    and so any argument happening to be a subset of a parsed argument will
    match it, e.g. `vapi` will match against `--vapi` or `--internal-vapi`.

    [... patch ...]
    --- a/bin/automake.in
    +++ b/bin/automake.in
    @@ -5436,8 +5436,8 @@ sub lang_vala_finish_target
           foreach my $flag ($flags->value_as_list_recursive)
            {
    -	  if (grep (/$lastflag/, ('-H', '-h', '--header', '--internal-header',
    -	                          '--vapi', '--internal-vapi', '--gir')))
    +	  if (grep (/^$lastflag$/, ('-H', '-h', '--header', '--internal-header',
    +	                            '--vapi', '--internal-vapi', '--gir')))
                {

Indeed. I don't see a problem with applying your patch, but before I do,
I just wondered if anything else had come up with vala that needs to be
fixed? Please advise if you can. I've never used vala myself, so
wouldn't know. --thanks, karl.