Add Python chmod +x equivalent in fpm package (#30342)

This commit is contained in:
Wileam Y. Phan 2022-04-27 20:16:19 -04:00 committed by GitHub
parent 53e0e7aabe
commit ebd930ace9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,9 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import stat
from spack import *
@ -52,7 +55,12 @@ def install(self, spec, prefix):
This functionality is provided by the ``install.sh`` script.
"""
script = Executable("./install.sh")
# Perform `chmod +x ./install.sh`
script_path = './install.sh'
st = os.stat(script_path)
os.chmod(script_path, st.st_mode | stat.S_IXUSR)
script = Executable(script_path)
script(*self.install_args())
def install_args(self):