[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/server/mkzopeinstance.py Merged from 3.2 branch:

Jim Fulton jim at zope.com
Sat Dec 24 12:00:28 EST 2005


Log message for revision 41037:
  Merged from 3.2 branch:
  
  ------------------------------------------------------------------------
    r41012 | jim | 2005-12-23 18:06:58 -0500 (Fri, 23 Dec 2005) | 2 lines
  
  Added hack to try to work around distutils strippping execute bits.
  

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

-=-
Modified: Zope3/trunk/src/zope/app/server/mkzopeinstance.py
===================================================================
--- Zope3/trunk/src/zope/app/server/mkzopeinstance.py	2005-12-24 16:59:34 UTC (rev 41036)
+++ Zope3/trunk/src/zope/app/server/mkzopeinstance.py	2005-12-24 17:00:27 UTC (rev 41037)
@@ -258,15 +258,28 @@
             # perform replacements
             for var, string in self.replacements:
                 text = text.replace(var, string)
-            f = open(dst, "w")
+
+            # If the file exists, keep the old file.  This is a
+            # hopefully temporary hack to get around distutils
+            # stripping the permissions on the server skeletin files.
+            # We reuse the original default files, which have the
+            # right permissions.
+            old = os.path.exists(dst)
+            if old:
+                f = open(dst, "r+")
+                f.truncate(0)
+            else:
+                f = open(dst, "w")
+
             f.write(text)
             f.close()
-            shutil.copymode(src, dst)
-            shutil.copystat(src, dst)
+
+            if not old:
+                shutil.copymode(src, dst)
+                shutil.copystat(src, dst)
         else:
             shutil.copy2(src, dst)
 
-
 SKELTARGET_MESSAGE = """\
 Please choose a directory in which you'd like to install Zope
 'instance home' files such as database files, configuration files,



More information about the Zope3-Checkins mailing list