Skip to content

Commit 1b97e4a

Browse files
committed
[260] Fix invalid escape sequences in clang package's python files
1 parent 102a740 commit 1b97e4a

File tree

3 files changed

+70
-2
lines changed

3 files changed

+70
-2
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
fix(clang-tools-extra/**.py): fix invalid escape sequences
2+
3+
Based on commit d63be475e889ba3361799f6907b3c95354684c7d from upstream.
4+
Upstream commit Author: Eisuke Kawashima <[email protected]>
5+
Upstream commit Author Date: Tue, 11 Jun 2024 04:05:40 +0900
6+
Upstream commit Committer: Piotr Zegar <[email protected]>
7+
Upstream commit Commit Date: Mon, 10 Jun 2024 21:05:40 +0200
8+
---
9+
clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py | 4 ++--
10+
clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py | 2 +-
11+
2 files changed, 3 insertions(+), 3 deletions(-)
12+
13+
diff -pru llvm-project.orig/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py llvm-project/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py
14+
--- llvm-project.orig/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py 2024-12-04 18:23:06.038522255 -0500
15+
+++ llvm-project/clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py 2024-12-04 18:29:38.919426287 -0500
16+
@@ -172,7 +172,7 @@ def main():
17+
filename = None
18+
lines_by_file = {}
19+
for line in sys.stdin:
20+
- match = re.search('^\+\+\+\ \"?(.*?/){%s}([^ \t\n\"]*)' % args.p, line)
21+
+ match = re.search('^\\+\\+\\+\\ \"?(.*?/){%s}([^ \t\n\"]*)' % args.p, line)
22+
if match:
23+
filename = match.group(2)
24+
if filename is None:
25+
@@ -185,7 +185,7 @@ def main():
26+
if not re.match('^%s$' % args.iregex, filename, re.IGNORECASE):
27+
continue
28+
29+
- match = re.search('^@@.*\+(\d+)(,(\d+))?', line)
30+
+ match = re.search(r'^@@.*\+(\d+)(,(\d+))?', line)
31+
if match:
32+
start_line = int(match.group(1))
33+
line_count = 1
34+
diff -pru llvm-project.orig/clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py llvm-project/clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py
35+
--- llvm-project.orig/clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py 2024-12-04 18:23:06.166522549 -0500
36+
+++ llvm-project/clang-tools-extra/docs/clang-tidy/checks/gen-static-analyzer-docs.py 2024-12-04 18:30:28.843541054 -0500
37+
@@ -44,7 +44,7 @@ def get_checkers(checkers_td_directory):
38+
parent_package_ = parent_package["ParentPackage"]
39+
40+
full_package_name = "clang-analyzer-" + checker_package_prefix + "." + checker_name
41+
- anchor_url = re.sub("\.", "-", checker_package_prefix + "." + checker_name).lower()
42+
+ anchor_url = re.sub(r"\.", "-", checker_package_prefix + "." + checker_name).lower()
43+
44+
if(not hidden and "alpha" not in full_package_name.lower()):
45+
checker["FullPackageName"] = full_package_name
46+
--
47+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Fix one more invalid escape sequence that makes it into the package
2+
---
3+
llvm/tools/opt-viewer/opt-viewer.py | 2 +-
4+
1 file changed, 1 insertion(+), 1 deletion(-)
5+
6+
diff -pru llvm-project.orig/llvm/tools/opt-viewer/opt-viewer.py llvm-project/llvm/tools/opt-viewer/opt-viewer.py
7+
--- llvm-project.orig/llvm/tools/opt-viewer/opt-viewer.py 2024-12-04 18:23:16.754546940 -0500
8+
+++ llvm-project/llvm/tools/opt-viewer/opt-viewer.py 2024-12-04 19:10:24.893308338 -0500
9+
@@ -115,7 +115,7 @@ class SourceFileRenderer:
10+
# Column is the number of characters *including* tabs, keep those and
11+
# replace everything else with spaces.
12+
indent = line[:max(r.Column, 1) - 1]
13+
- indent = re.sub('\S', ' ', indent)
14+
+ indent = re.sub(r'\S', ' ', indent)
15+
16+
# Create expanded message and link if we have a multiline message.
17+
lines = r.message.split('\n')
18+
--
19+

versions.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@
348348
"version_string": "13.0.1",
349349
"license": "Apache-2.0 WITH LLVM-exception",
350350
"consortium_build_number": "0",
351-
"package_revision": "1",
351+
"package_revision": "2",
352352
"externals_root": "opt/irods-externals",
353353
"patches": [
354354
"clang/from-debian/declare_clear_cache.diff",
@@ -389,7 +389,9 @@
389389
"clang/1002-libcxx-Prefer-__has_builtin-for-detecting-compiler-p.patch",
390390
"clang/1003-more-__has_builtin-replacements.patch",
391391
"clang/1004-libcxx-Use-__is_convertible-built-in-when-available.patch",
392-
"clang/1005-libcxx-fix-remove_reference_t.patch"
392+
"clang/1005-libcxx-fix-remove_reference_t.patch",
393+
"clang/1006-clang-tools-extra-py-fix-invalid-escape-sequences.patch",
394+
"clang/1007-opt-viewer-fix-invalid-escape-sequence.patch"
393395
],
394396
"build_steps": [
395397
"mkdir -p ../build",

0 commit comments

Comments
 (0)