diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2024-02-15 03:22:55 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2024-02-15 04:28:27 -0800 |
commit | 6a2512bf1605a4208dd94ef67408488d8acb2409 (patch) | |
tree | 978eae17fb76faed290714529f07a3aecdac06ef /scripts | |
parent | dbae3a3940940977b8b8190a145a444732846219 (diff) | |
download | glibc-6a2512bf1605a4208dd94ef67408488d8acb2409.zip glibc-6a2512bf1605a4208dd94ef67408488d8acb2409.tar.gz glibc-6a2512bf1605a4208dd94ef67408488d8acb2409.tar.bz2 |
sort-makefile-lines.py: Allow '_' in name and "^# name"
'_' 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.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/sort-makefile-lines.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/sort-makefile-lines.py b/scripts/sort-makefile-lines.py index f65ee40..b2249ae 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). |