build: Add missing new line to replaced python shebang line. (Fix bug #9909)
authorMichael Adam <obnox@samba.org>
Tue, 28 May 2013 10:19:34 +0000 (12:19 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 29 May 2013 11:21:51 +0000 (13:21 +0200)
When configuring with a non-standard python specified in
the PYTHON environment variable, the shebang lines in various
python tools like samba-tool and samba_dnsupdate get replaced.

This replace line for the shebang was missing a newline
which joined the shebang line with the following line,
rendereing those scripts with a nonempty second line unusuable,
for example samba_dnsupdate.

This patch fixes this bug which is bug #9909 on bugzilla.

Pair-Programmed-With: Karolin Seeger <kseeger@samba.org>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Karolin Seeger <kseeger@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed May 29 13:21:51 CEST 2013 on sn-devel-104

buildtools/wafsamba/wafsamba.py

index 0d407e6a0a6b6c6bc3641bb5e7f65f1bcd2fff75..aaa09392f1eb23930f04ece1b70ab4153c25e53a 100644 (file)
@@ -704,9 +704,9 @@ sys.path.insert(1, "%s")""" % (task.env["PYTHONARCHDIR"], task.env["PYTHONDIR"])
     shebang = None
 
     if task.env["PYTHON"][0] == "/":
-        replacement_shebang = "#!%s" % task.env["PYTHON"]
+        replacement_shebang = "#!%s\n" % task.env["PYTHON"]
     else:
-        replacement_shebang = "#!/usr/bin/env %s" % task.env["PYTHON"]
+        replacement_shebang = "#!/usr/bin/env %s\n" % task.env["PYTHON"]
 
     installed_location=task.outputs[0].bldpath(task.env)
     source_file = open(task.inputs[0].srcpath(task.env))