Code review comment for lp://qastaging/~intrigeri/apparmor/utils-keep-shebang

Revision history for this message
Steve Beattie (sbeattie) wrote :

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
===================================================================
--- 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)

         configs = ['easyprof/easyprof.conf']
         self.mkpath(prefix + "/etc/apparmor")

and dropping Adam's patch.

I'll submit the above to the list.

Thanks!

review: Disapprove

« Back to merge proposal