File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,25 +49,21 @@ patch_corefoundation_tbd() {
4949 local tbd_path=$1
5050
5151 python3 - " $tbd_path " << 'PY '
52- import re
5352import sys
5453from pathlib import Path
5554
5655tbd_path = Path(sys.argv[1])
57- text = tbd_path.read_text()
58-
59- text = re.sub(
60- r"reexported-libraries:\s*(\n\s*-\s*/usr/lib/libobjc\.A\.dylib\s*)+",
61- "reexported-libraries: []\n",
62- text,
63- )
64- text = re.sub(
65- r"reexported-libraries:\s*\[\s*/usr/lib/libobjc\.A\.dylib\s*\]\s*",
66- "reexported-libraries: []\n",
67- text,
68- )
69-
70- tbd_path.write_text(text)
56+ lines = tbd_path.read_text().splitlines()
57+ updated = []
58+
59+ for line in lines:
60+ if "libobjc.A.dylib" in line:
61+ if "reexported-libraries" in line:
62+ updated.append("reexported-libraries: []")
63+ continue
64+ updated.append(line)
65+
66+ tbd_path.write_text("\n".join(updated) + "\n")
7167PY
7268}
7369
You can’t perform that action at this time.
0 commit comments