magics: Use correct python path (#13394)

python~pythoncmd does not provide a python symlink for python3, so make
sure we pick the right command.
This commit is contained in:
Michael Kuhn 2019-10-23 16:33:42 +02:00 committed by Adam J. Stewart
parent 466d07558d
commit 64694dfaf8

View file

@ -5,6 +5,7 @@
from spack import *
import glob
import os
class Magics(CMakePackage):
@ -105,7 +106,11 @@ def patch(self):
for plfile in glob.glob('*/*.pl'):
filter_file('#!/usr/bin/perl', '#!/usr/bin/env perl', plfile)
for pyfile in glob.glob('*/*.py'):
filter_file('#!/usr/bin/python', '#!/usr/bin/env python', pyfile)
filter_file('#!/usr/bin/python',
'#!/usr/bin/env {0}'.format(
os.path.basename(
self.spec['python'].command.path)),
pyfile)
def cmake_args(self):
args = [