From: "H.J. Lu" <hjl.tools@gmail.com>
To: Sunil Pandey <skpgkp2@gmail.com>
Cc: libc-alpha@sourceware.org, carlos@redhat.com
Subject: Re: [PATCH v2] sort-makefile-lines.py: Allow '_' in name and "^# name"
Date: Thu, 15 Feb 2024 10:46:37 -0800 [thread overview]
Message-ID: <CAMe9rOr_nx1W_f+sJUsxTufSE_KV9ibbMffTJEMPmbB3WOid-w@mail.gmail.com> (raw)
In-Reply-To: <CAMAf5_eiTa8ZAmOGOX0wuxGrchyTtjaZdY8=cLTxaETtbptF7w@mail.gmail.com>
On Thu, Feb 15, 2024 at 9:28 AM Sunil Pandey <skpgkp2@gmail.com> wrote:
>
>
>
> On Thu, Feb 15, 2024 at 4:29 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>>
>> '_' is used in Makefile variable names and many variables end with
>> "^# name". Relax sort-makefile-lines.py to allow '_' in name and
>> "^# name" as variable end. This fixes BZ #31385.
>> ---
>> scripts/sort-makefile-lines.py | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/scripts/sort-makefile-lines.py b/scripts/sort-makefile-lines.py
>> index f65ee40e27..b2249aef6d 100755
>> --- a/scripts/sort-makefile-lines.py
>> +++ b/scripts/sort-makefile-lines.py
>> @@ -129,7 +129,7 @@ def sort_makefile_lines():
>> for i in range(len(lines)):
>> # Look for things like "var = \", "var := \" or "var += \"
>> # to start the sorted list.
>> - var = re.search(r'^([a-zA-Z0-9-]*) [\+:]?\= \\$', lines[i])
>> + var = re.search(r'^([-_a-zA-Z0-9]*) [\+:]?\= \\$', lines[i])
>> if var:
>> # Remember the index and the name.
>> startmarks.append((i, var.group(1)))
>> @@ -140,7 +140,7 @@ def sort_makefile_lines():
>> rangemarks = []
>> for sm in startmarks:
>> # Look for things like " # var" to end the sorted list.
>> - reg = r'^ # ' + sm[1] + r'$'
>> + reg = r'^ *# ' + sm[1] + r'$'
>> for j in range(sm[0] + 1, len(lines)):
>> if re.search(reg, lines[j]):
>> # Remember the block to sort (inclusive).
>> --
>> 2.43.0
>
>
> LGTM
>
> --Sunil
I checked it in. I am pushing:
https://patchwork.sourceware.org/project/glibc/list/?series=30990
to update Makefiles.
--
H.J.
prev parent reply other threads:[~2024-02-15 18:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-15 12:29 H.J. Lu
2024-02-15 17:28 ` Sunil Pandey
2024-02-15 18:46 ` H.J. Lu [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=CAMe9rOr_nx1W_f+sJUsxTufSE_KV9ibbMffTJEMPmbB3WOid-w@mail.gmail.com \
--to=hjl.tools@gmail.com \
--cc=carlos@redhat.com \
--cc=libc-alpha@sourceware.org \
--cc=skpgkp2@gmail.com \
/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).