mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
use PYTHON in utils/python-tools-setup.py if it is defined
Acked-By: Jamie Strandboge <jamie@canonical.com> Acked-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
parent
3d4a98bed9
commit
e7da3d81d1
1 changed files with 9 additions and 1 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Reference in a new issue