Fix issue with config.guess patching when the overwritten config.guess did not have write permissions. (#3494)
This commit is contained in:
parent
22f3c9de84
commit
5ac6421f14
@ -27,6 +27,8 @@
|
|||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
import shutil
|
import shutil
|
||||||
|
from os import stat
|
||||||
|
from stat import *
|
||||||
from subprocess import PIPE
|
from subprocess import PIPE
|
||||||
from subprocess import check_call
|
from subprocess import check_call
|
||||||
|
|
||||||
@ -131,16 +133,8 @@ def _do_patch_config_guess(self):
|
|||||||
path = os.path.join(automake_path, 'config.guess')
|
path = os.path.join(automake_path, 'config.guess')
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
config_guess = path
|
config_guess = path
|
||||||
if config_guess is not None:
|
|
||||||
try:
|
|
||||||
check_call([config_guess], stdout=PIPE, stderr=PIPE)
|
|
||||||
shutil.copyfile(config_guess, my_config_guess)
|
|
||||||
return True
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
|
|
||||||
# Look for the system's config.guess
|
# Look for the system's config.guess
|
||||||
if os.path.exists('/usr/share'):
|
if config_guess is None and os.path.exists('/usr/share'):
|
||||||
automake_dir = [s for s in os.listdir('/usr/share') if
|
automake_dir = [s for s in os.listdir('/usr/share') if
|
||||||
"automake" in s]
|
"automake" in s]
|
||||||
if automake_dir:
|
if automake_dir:
|
||||||
@ -151,6 +145,8 @@ def _do_patch_config_guess(self):
|
|||||||
if config_guess is not None:
|
if config_guess is not None:
|
||||||
try:
|
try:
|
||||||
check_call([config_guess], stdout=PIPE, stderr=PIPE)
|
check_call([config_guess], stdout=PIPE, stderr=PIPE)
|
||||||
|
mod = stat(my_config_guess).st_mode & 0777 | S_IWUSR
|
||||||
|
os.chmod(my_config_guess, mod)
|
||||||
shutil.copyfile(config_guess, my_config_guess)
|
shutil.copyfile(config_guess, my_config_guess)
|
||||||
return True
|
return True
|
||||||
except Exception:
|
except Exception:
|
||||||
|
Loading…
Reference in New Issue
Block a user