[Skencil-commits] r523 - skencil/branches/skencil-0.6

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sun Feb 12 01:19:46 CET 2006


Author: bh
Date: 2006-02-12 01:19:46 +0100 (Sun, 12 Feb 2006)
New Revision: 523

Modified:
   skencil/branches/skencil-0.6/ChangeLog
   skencil/branches/skencil-0.6/setup.py
Log:
* setup.py (install_file): Patch the first line of scripts so that
it refers to the python interpreter used for installation.  This
is usually what one wants and make it packaging easier.


Modified: skencil/branches/skencil-0.6/ChangeLog
===================================================================
--- skencil/branches/skencil-0.6/ChangeLog	2006-02-11 23:55:50 UTC (rev 522)
+++ skencil/branches/skencil-0.6/ChangeLog	2006-02-12 00:19:46 UTC (rev 523)
@@ -1,5 +1,11 @@
 2006-02-12  Bernhard Herzog  <bh at intevation.de>
 
+	* setup.py (install_file): Patch the first line of scripts so that
+	it refers to the python interpreter used for installation.  This
+	is usually what one wants and make it packaging easier.
+
+2006-02-12  Bernhard Herzog  <bh at intevation.de>
+
 	Make it easier for packagers to customize where Skencil installs
 	files.
 

Modified: skencil/branches/skencil-0.6/setup.py
===================================================================
--- skencil/branches/skencil-0.6/setup.py	2006-02-11 23:55:50 UTC (rev 522)
+++ skencil/branches/skencil-0.6/setup.py	2006-02-12 00:19:46 UTC (rev 523)
@@ -547,6 +547,17 @@
                 except:
                     pass
                 shutil.copy(srcfile, destfile)
+                if "executable" in flags:
+                    # fix the interpreter line to always point to the
+                    # current python executable.
+                    f = open(destfile)
+                    lines = f.readlines()
+                    f.close()
+                    if lines[0][:2] == "#!":
+                        lines[0] = "#! %s\n" % sys.executable
+                    f = open(destfile, "w")
+                    f.writelines(lines)
+                    f.close()
         
 def bytecompile(dir, realdir):
     compileall.compile_dir(os.path.join(os.getcwd(), dir),



More information about the Skencil-commits mailing list