python3/00178-dont-duplicate-flags-in-sysconfig.patch
2021-12-28 19:47:29 +08:00

36 lines
1.3 KiB
Diff

diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
index 37feae5..dab8a09 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -375,7 +375,10 @@ def parse_makefile(fn, g=None):
done[n] = item = ""
if found:
after = value[m.end():]
- value = value[:m.start()] + item + after
+ value = value[:m.start()]
+ if item.strip() not in value:
+ value += item
+ value += after
if "$" in after:
notdone[name] = value
else:
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
index e3f79bf..bec4699 100644
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -301,7 +301,10 @@ def _parse_makefile(filename, vars=None):
if found:
after = value[m.end():]
- value = value[:m.start()] + item + after
+ value = value[:m.start()]
+ if item.strip() not in value:
+ value += item
+ value += after
if "$" in after:
notdone[name] = value
else:
--
1.8.3.1