[Zope3-checkins] SVN: Zope3/trunk/ make mkzopeinstance work from a Subversion checkout as well as an installation

Fred L. Drake, Jr. fdrake at gmail.com
Wed Sep 8 13:10:25 EDT 2004


Log message for revision 27478:
  make mkzopeinstance work from a Subversion checkout as well as an installation


Changed:
  U   Zope3/trunk/bin/mkzopeinstance
  U   Zope3/trunk/src/zope/app/server/mkzopeinstance.py


-=-
Modified: Zope3/trunk/bin/mkzopeinstance
===================================================================
--- Zope3/trunk/bin/mkzopeinstance	2004-09-08 15:14:26 UTC (rev 27477)
+++ Zope3/trunk/bin/mkzopeinstance	2004-09-08 17:10:24 UTC (rev 27478)
@@ -23,6 +23,8 @@
 here = os.path.dirname(os.path.realpath(__file__))
 swhome = os.path.dirname(here)
 
+from_checkout = os.path.isdir(os.path.join(swhome, ".svn"))
+
 for parts in [("src",), ("lib", "python"), ("Lib", "site-packages")]:
     d = os.path.join(swhome, *(parts + ("zope", "app", "appsetup")))
     if os.path.isdir(d):
@@ -37,4 +39,4 @@
 from zope.app.server.mkzopeinstance import main
 
 
-sys.exit(main())
+sys.exit(main(from_checkout=from_checkout))

Modified: Zope3/trunk/src/zope/app/server/mkzopeinstance.py
===================================================================
--- Zope3/trunk/src/zope/app/server/mkzopeinstance.py	2004-09-08 15:14:26 UTC (rev 27477)
+++ Zope3/trunk/src/zope/app/server/mkzopeinstance.py	2004-09-08 17:10:24 UTC (rev 27478)
@@ -32,7 +32,7 @@
 from zope.app.applicationcontrol import zopeversion
 
 
-def main(argv=None):
+def main(argv=None, from_checkout=False):
     """Top-level script function to create a new Zope instance."""
     if argv is None:
         argv = sys.argv
@@ -43,6 +43,7 @@
             return 2
         else:
             return 0
+    options.from_checkout = from_checkout
     app = Application(options)
     try:
         return app.process()
@@ -105,6 +106,19 @@
 
         # now create the instance!
         self.copy_skeleton()
+        if options.from_checkout:
+            # need to copy ZCML differently since it's not in the skeleton:
+            import __main__
+            swhome = os.path.dirname(
+                os.path.dirname(os.path.realpath(__main__.__file__)))
+            shutil.copy2(os.path.join(swhome, "securitypolicy.zcml"),
+                         os.path.join(options.destination, "etc"))
+            piname = "package-includes"
+            pisrc = os.path.join(swhome, piname)
+            pidst = os.path.join(options.destination, "etc", piname)
+            for fn in os.listdir(pisrc):
+                if fn.endswith(".zcml"):
+                    shutil.copy2(os.path.join(pisrc, fn), pidst)
         return 0
 
     def get_skeltarget(self):



More information about the Zope3-Checkins mailing list