summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatthew LeGendre <legendre1@llnl.gov>2017-03-20 12:35:38 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2017-03-20 12:35:38 -0700
commit5ac6421f148f43f6f90832978c45a5749f6d154e (patch)
tree526e02fca2b1ff5d45532160186a897a3b7005f2 /lib
parent22f3c9de8454b7ba149f6612539136219f8645a7 (diff)
downloadspack-5ac6421f148f43f6f90832978c45a5749f6d154e.tar.gz
spack-5ac6421f148f43f6f90832978c45a5749f6d154e.tar.bz2
spack-5ac6421f148f43f6f90832978c45a5749f6d154e.tar.xz
spack-5ac6421f148f43f6f90832978c45a5749f6d154e.zip
Fix issue with config.guess patching when the overwritten config.guess did not have write permissions. (#3494)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/build_systems/autotools.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/spack/spack/build_systems/autotools.py b/lib/spack/spack/build_systems/autotools.py
index f0f57b1232..a11a84acd0 100644
--- a/lib/spack/spack/build_systems/autotools.py
+++ b/lib/spack/spack/build_systems/autotools.py
@@ -27,6 +27,8 @@ import inspect
import os
import os.path
import shutil
+from os import stat
+from stat import *
from subprocess import PIPE
from subprocess import check_call
@@ -131,16 +133,8 @@ class AutotoolsPackage(PackageBase):
path = os.path.join(automake_path, 'config.guess')
if os.path.exists(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
- 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" in s]
if automake_dir:
@@ -151,6 +145,8 @@ class AutotoolsPackage(PackageBase):
if config_guess is not None:
try:
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)
return True
except Exception: