autotools: ensure config.guess and config.sub are writeable before patching them (#19837)
This commit is contained in:
parent
da88c0e6ff
commit
d805be02ec
1 changed files with 4 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
||||||
import itertools
|
import itertools
|
||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
|
import stat
|
||||||
from subprocess import PIPE
|
from subprocess import PIPE
|
||||||
from subprocess import check_call
|
from subprocess import check_call
|
||||||
from typing import List # novm
|
from typing import List # novm
|
||||||
|
@ -174,7 +175,10 @@ def runs_ok(script_abs_path):
|
||||||
# Copy the good files over the bad ones
|
# Copy the good files over the bad ones
|
||||||
for abs_path in to_be_patched:
|
for abs_path in to_be_patched:
|
||||||
name = os.path.basename(abs_path)
|
name = os.path.basename(abs_path)
|
||||||
|
mode = os.stat(abs_path).st_mode
|
||||||
|
os.chmod(abs_path, stat.S_IWUSR)
|
||||||
fs.copy(substitutes[name], abs_path)
|
fs.copy(substitutes[name], abs_path)
|
||||||
|
os.chmod(abs_path, mode)
|
||||||
|
|
||||||
@run_before('configure')
|
@run_before('configure')
|
||||||
def _set_autotools_environment_variables(self):
|
def _set_autotools_environment_variables(self):
|
||||||
|
|
Loading…
Reference in a new issue