What this patch is doing is disabling the shbang rewriting (converting '#!/usr/bin/env python' in the scripts to the python in the PYTHON variable) that occurs during the make install phase.
Index: b/utils/python-tools-setup.py
===================================================================
--- a/utils/python-tools-setup.py
+++ b/utils/python-tools-setup.py
@@ -41,14 +41,7 @@ class Install(_install, object): self.mkpath(prefix + os.path.dirname(scripts[0]))
for s in scripts:
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)
+ self.copy_file(os.path.basename(s), f)
What this patch is doing is disabling the shbang rewriting (converting '#!/usr/bin/env python' in the scripts to the python in the PYTHON variable) that occurs during the make install phase.
However, as of http:// bazaar. launchpad. net/~apparmor- dev/apparmor/ master/ revision/ 3555 , all of the python utilities are hardcoded to use python3, so the snippet in question is redundant. So really what should happen is a patch like the following:
Index: b/utils/ python- tools-setup. py ======= ======= ======= ======= ======= ======= ======= ======= ==== python- tools-setup. py python- tools-setup. py
self. mkpath( prefix + os.path. dirname( scripts[ 0])) path.basename( s)).readlines( ) 'PYTHON' ] "".join( lines)) file(os. path.basename( s), f) file(os. path.basename( s), f)
=======
--- a/utils/
+++ b/utils/
@@ -41,14 +41,7 @@ class Install(_install, object):
for s in scripts:
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.
- lines[0] = '#! /usr/bin/env %s\n' % os.environ[
- open(f, 'w').write(
- else:
- self.copy_
+ self.copy_
configs = ['easyprof/ easyprof. conf']
self. mkpath( prefix + "/etc/apparmor")
and dropping Adam's patch.
I'll submit the above to the list.
Thanks!