[Zope-Checkins] CVS: Zope/inst - make_resource.py:1.7.4.1
Chris McDonough
chrism@zope.com
Mon, 13 Jan 2003 19:07:36 -0500
Update of /cvs-repository/Zope/inst
In directory cvs.zope.org:/tmp/cvs-serv29711
Modified Files:
Tag: chrism-install-branch
make_resource.py
Log Message:
Exorcise "import do".
=== Zope/inst/make_resource.py 1.7 => 1.7.4.1 ===
--- Zope/inst/make_resource.py:1.7 Wed Aug 14 17:17:32 2002
+++ Zope/inst/make_resource.py Mon Jan 13 19:07:33 2003
@@ -15,8 +15,7 @@
You must be in the directory containing this script.
"""
-import os
-from do import *
+import sys, os, grp, pwd
def main(cwd=os.getcwd(), name='Zope', user='', group=''):
python=sys.executable
@@ -36,6 +35,15 @@
BOBO_REALM=%(name)s
BOBO_DEBUG_MODE=1
INSTANCE_HOME=%(cwd)s
-''' % vars())
+''' % locals())
- ch(name, user, group, 0755)
+ mode = 0755
+ uid = os.getuid()
+ gid = os.getgid()
+ if user:
+ uid = pwd.getpwnam(user)
+ if group:
+ mode = 0775
+ gid = grp.getgrname(group)
+ os.chown(name, uid, gid)
+ os.chmod(name, mode)