Backports Archive mirror
 help / color / mirror / Atom feed
From: Arend van Spriel <arend.vanspriel@broadcom.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: backports@vger.kernel.org
Subject: Re: backports Kconfig processing
Date: Thu, 25 Feb 2021 09:44:19 +0100	[thread overview]
Message-ID: <1bc87970-6521-63c5-6736-8fd850ee591d@broadcom.com> (raw)
In-Reply-To: <1aae3fb1963fc525a587dbef7317ebc0fd988f0f.camel@sipsolutions.net>

[-- Attachment #1: Type: text/plain, Size: 3401 bytes --]

On 25-02-2021 09:42, Johannes Berg wrote:
> On Thu, 2021-02-25 at 09:31 +0100, Arend van Spriel wrote:
>>
>> On 24-02-2021 15:32, Johannes Berg wrote:
>>> Hi Arend,
>>>
>>>> I was made aware that the select line in brcm80211 Kconfig is not
>>>> working in backports:
>>>>
>>>> select WANT_DEV_COREDUMP if BRCMFMAC
>>>>
>>>> Is this something that can be fixed in backports?
>>>
>>> I guess it can be, but what do you mean by "not working"?
>>>
>>> It should be rewritten to
>>>
>>> select BPAUTO_WANT_DEV_COREDUMP if BRCMFMAC
>>>
>>> but quite possibly the parser doesn't understand the " if BRCMFMAC" part
>>> there.
>>
>> That exactly what is being reported. Things were working fine until I
>> added the "if BRCMFMAC" part.
> 
> Yeah, so lib/kconfig.py has this
> 
> sel_line = re.compile(r'^(?P<spc>\s+)select\s+(?P<sym>[^\s]*)\s*$')
> 
> which doesn't cover the case of "if ..." on the select line.
> 
> I guess you could either look at that and fix it - need to fix the regex
> to allow all_selects() to find it, and modify_selects() to preserve the
> "if ..." part.
> 
> Probably something like
> 
> diff --git a/lib/kconfig.py b/lib/kconfig.py
> index a77f8a54eea7..46df636d7594 100644
> --- a/lib/kconfig.py
> +++ b/lib/kconfig.py
> @@ -8,7 +8,7 @@ src_line_rel = re.compile(r'^\s*source\s+(?P<src>[^\s"]*)"?\s*$')
>   tri_line = re.compile(r'^(?P<spc>\s+)tristate')
>   bool_line = re.compile(r'^(?P<spc>\s+)bool')
>   cfg_line = re.compile(r'^(?P<opt>config|menuconfig)\s+(?P<sym>[^\s]*)')
> -sel_line = re.compile(r'^(?P<spc>\s+)select\s+(?P<sym>[^\s]*)\s*$')
> +sel_line = re.compile(r'^(?P<spc>\s+)select\s+(?P<sym>[^\s]*)(?P<ifexpr>.*)$')
>   backport_line = re.compile(r'^\s+#(?P<key>[ch]-file|module-name)\s*(?P<name>.*)')
>   
>   class ConfigTree(object):
> @@ -230,9 +230,9 @@ class ConfigTree(object):
>                   m = sel_line.match(l)
>                   if m and not m.group('sym') in syms:
>                       if 'BPAUTO_' + m.group('sym') in syms:
> -                        out += m.group('spc') + "select BPAUTO_" + m.group('sym') + '\n'
> +                        out += m.group('spc') + "select BPAUTO_" + m.group('sym') + m.group('ifexpr') + '\n'
>                       else:
> -                        out += m.group('spc') + "depends on " + m.group('sym') + '\n'
> +                        out += m.group('spc') + "depends on " + m.group('sym') + m.group('ifexpr') + '\n'
>                   else:
>                       out += l
>               outf = open(os.path.join(self.bpid.target_dir, nf), 'w')

Thanks for the suggestion. I will give it a try.

Regards,
Arend

-- 
This electronic communication and the information and any files transmitted 
with it, or attached to it, are confidential and are intended solely for 
the use of the individual or entity to whom it is addressed and may contain 
information that is confidential, legally privileged, protected by privacy 
laws, or otherwise restricted from disclosure to anyone else. If you are 
not the intended recipient or the person responsible for delivering the 
e-mail to the intended recipient, you are hereby notified that any use, 
copying, distributing, dissemination, forwarding, printing, or copying of 
this e-mail is strictly prohibited. If you received this e-mail in error, 
please return the e-mail to the sender, delete it from your computer, and 
destroy any printed copy of it.

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4219 bytes --]

      reply	other threads:[~2021-02-25  8:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-24 12:13 backports Kconfig processing Arend van Spriel
2021-02-24 14:32 ` Johannes Berg
2021-02-25  8:31   ` Arend van Spriel
2021-02-25  8:42     ` Johannes Berg
2021-02-25  8:44       ` Arend van Spriel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1bc87970-6521-63c5-6736-8fd850ee591d@broadcom.com \
    --to=arend.vanspriel@broadcom.com \
    --cc=backports@vger.kernel.org \
    --cc=johannes@sipsolutions.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).