From e7da3d81d1010675d222c35852a9feace63b399d Mon Sep 17 00:00:00 2001 From: Jamie Strandboge Date: Sun, 1 Jul 2012 09:12:29 -0500 Subject: [PATCH] use PYTHON in utils/python-tools-setup.py if it is defined Acked-By: Jamie Strandboge Acked-by: John Johansen --- utils/python-tools-setup.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/utils/python-tools-setup.py b/utils/python-tools-setup.py index 8d905de07..1e56f9e1c 100644 --- a/utils/python-tools-setup.py +++ b/utils/python-tools-setup.py @@ -40,7 +40,15 @@ class Install(_install, object): scripts = ['/usr/bin/aa-easyprof'] self.mkpath(prefix + os.path.dirname(scripts[0])) for s in scripts: - self.copy_file(os.path.basename(s), prefix + s) + f = prefix + s + # If we have a defined python version, use it instead of the system + # default + if 'PYTHON' in os.environ: + lines = open(os.path.basename(s)).readlines() + lines[0] = '#! /usr/bin/env %s\n' % os.environ['PYTHON'] + open(f, 'w').write("".join(lines)) + else: + self.copy_file(os.path.basename(s), f) configs = ['easyprof/easyprof.conf'] self.mkpath(prefix + "/etc/apparmor")