Update of /cvsroot/cvs-syncmail/syncmail
In directory sc8-pr-cvs1:/tmp/cvs-serv717
Modified Files:
Tag: new-config-branch
syncmail
Log Message:
- clean up code to look for files in the CVSROOT directory
- look for config files named on the command line in the CVSROOT
directory
- remove XXX comment that is addressed by these changes
Index: syncmail
===================================================================
RCS file: /cvsroot/cvs-syncmail/syncmail/syncmail,v
retrieving revision 1.36.2.15
retrieving revision 1.36.2.16
diff -u -d -r1.36.2.15 -r1.36.2.16
--- syncmail 11 Jul 2003 18:39:03 -0000 1.36.2.15
+++ syncmail 11 Jul 2003 18:47:35 -0000 1.36.2.16
@@ -618,24 +618,23 @@
else:
self.repodir = os.curdir
-def load_configuration(args, branch=None):
- cmdline, args = load_cmdline(args)
+def get_admin_file(name):
if os.environ.has_key("CVSROOT"):
- defconfig = os.path.join(os.environ["CVSROOT"],
- "CVSROOT", "syncmail.conf")
+ p = os.path.join(os.environ["CVSROOT"], "CVSROOT", name)
+ return os.path.abspath(p)
else:
- defconfig = os.path.join("CVSROOT", "syncmail.conf")
+ return os.path.join("CVSROOT", name)
+
+def load_configuration(args, branch=None):
+ cmdline, args = load_cmdline(args)
+ defconfig = get_admin_file("syncmail.conf")
if cmdline.has_key('config-file'):
- cfgfile = cmdline['config-file']
+ cfgfile = get_admin_file(cmdline['config-file'])
del cmdline['config-file']
elif os.path.isfile(defconfig):
cfgfile = defconfig
else:
cfgfile = None
- # XXX cfgfile is specified relative to the CVSROOT directory; we
- # need to transform the path appropriately, since that won't be
- # the current directory when we try to read it. In fact, a wrong
- # config file may exist at the alternate location.
db = ConfigurationDatabase(cfgfile, cmdline, args)
return db.get_config(branch)
|