r2150 - in zope2.12/trunk/debian (3 files)

pumazi-guest at users.alioth.debian.org pumazi-guest at users.alioth.debian.org
Fri Dec 10 16:09:45 UTC 2010


    Date: Friday, December 10, 2010 @ 16:09:41
  Author: pumazi-guest
Revision: 2150

Fixing the custom python interpreter to set the sys.executable as itself. We need t set the executable in order for scripts like mkzeoinstance to generate configuration that loads zope2.12's private environment.

Modified:
  zope2.12/trunk/debian/changelog
  zope2.12/trunk/debian/python_interpreter_template.in
  zope2.12/trunk/debian/rules

Modified: zope2.12/trunk/debian/changelog
===================================================================
--- zope2.12/trunk/debian/changelog	2010-12-09 18:42:52 UTC (rev 2149)
+++ zope2.12/trunk/debian/changelog	2010-12-10 16:09:41 UTC (rev 2150)
@@ -17,8 +17,12 @@
     a build-resources.patch. These have been simplified to address only the
     needs of this package. These resources could potentially be factored out
     in the future.
+  * Fixed the custom python interpreter to set the sys.executable as itself.
+    We set the executable so scripts like mkzeoinstance generate
+    configuration that points at an executable that can load zope2.12's
+    private environment.
 
- -- Michael Mulich (pumazi) <michael.mulich at gmail.com>  Thu, 09 Dec 2010 13:33:30 -0500
+ -- Michael Mulich (pumazi) <michael.mulich at gmail.com>  Thu, 09 Dec 2010 23:50:43 -0500
 
 zope2.12 (2.12.10-1) unstable; urgency=low
 

Modified: zope2.12/trunk/debian/python_interpreter_template.in
===================================================================
--- zope2.12/trunk/debian/python_interpreter_template.in	2010-12-09 18:42:52 UTC (rev 2149)
+++ zope2.12/trunk/debian/python_interpreter_template.in	2010-12-10 16:09:41 UTC (rev 2150)
@@ -1,8 +1,10 @@
-#!/usr/bin/env python
+#!/usr/bin/python2.6
+import os
 import sys
 import site
 
 site.addsitedir('/usr/lib/zope at ZVER@/lib/python')
+sys.executable = os.path.abspath(__file__)
 
 _interactive = True
 if len(sys.argv) > 1:
@@ -27,4 +29,4 @@
 
 if _interactive:
     del _interactive
-    __import__("code").interact(banner="", local=globals())
\ No newline at end of file
+    __import__("code").interact(banner="", local=globals())

Modified: zope2.12/trunk/debian/rules
===================================================================
--- zope2.12/trunk/debian/rules	2010-12-09 18:42:52 UTC (rev 2149)
+++ zope2.12/trunk/debian/rules	2010-12-10 16:09:41 UTC (rev 2150)
@@ -65,7 +65,20 @@
 
 override_dh_auto_install:
 	make install PYTHON=python DESTDIR=$(DEBIAN)/$(ZOPE)
-	sed -i '/^#!.*$$/a\import site; site.addsitedir("/usr/lib/$(ZOPE)/lib/python")' $$(find $(DEBIAN)/$(ZOPE)/usr/lib/$(ZOPE)/bin -type f ! -type l)
+
+#	sed -i '/^#!.*$$/a\import site; site.addsitedir("/usr/lib/$(ZOPE)/lib/python")' $$(find $(DEBIAN)/$(ZOPE)/usr/lib/$(ZOPE)/bin -type f ! -type l)
+	for i in `find $(DEBIAN)/$(ZOPE) -type f`; do \
+		if sed '1s,#!.*python[^ ]*\(.*\),#!/usr/lib/zope$(ZVER)/bin/python\1,' $$i > $$i~ ; then \
+			if cmp --quiet $$i $$i~ ; then \
+				rm -f $$i~ ; \
+			else \
+				mv -f $$i~ $$i; \
+				chmod 755 $$i; \
+				echo "Fixed interpreter: $$i"; \
+			fi; else rm -f $$i~ ; \
+		fi; \
+	done
+
 	cp $(DEBIAN)/python_interpreter_template $(DEBIAN)/$(ZOPE)/usr/lib/$(ZOPE)/bin/python
 ifeq ($(distribution),Ubuntu)
 	mv $(DEBIAN)/$(ZOPE)-sandbox/usr/share/doc/$(ZOPE)-sandbox/README.Debian \




More information about the pkg-zope-developers mailing list