mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-22 10:07:12 +00: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
@ -40,7 +40,15 @@ class Install(_install, object):
|
|||||||
scripts = ['/usr/bin/aa-easyprof']
|
scripts = ['/usr/bin/aa-easyprof']
|
||||||
self.mkpath(prefix + os.path.dirname(scripts[0]))
|
self.mkpath(prefix + os.path.dirname(scripts[0]))
|
||||||
for s in scripts:
|
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']
|
configs = ['easyprof/easyprof.conf']
|
||||||
self.mkpath(prefix + "/etc/apparmor")
|
self.mkpath(prefix + "/etc/apparmor")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user