ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject incubator-ponymail git commit: Complete the fix started in 30bfeb7
Date Thu, 10 Nov 2016 20:11:09 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/master 30bfeb7df -> 17e5e94c7


Complete the fix started in 30bfeb7

Oops...

Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/17e5e94c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/17e5e94c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/17e5e94c

Branch: refs/heads/master
Commit: 17e5e94c7390ff3813d96542fca16f47171f8791
Parents: 30bfeb7
Author: Sebb <sebb@apache.org>
Authored: Thu Nov 10 20:10:52 2016 +0000
Committer: Sebb <sebb@apache.org>
Committed: Thu Nov 10 20:10:52 2016 +0000

----------------------------------------------------------------------
 tools/setup.py | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/17e5e94c/tools/setup.py
----------------------------------------------------------------------
diff --git a/tools/setup.py b/tools/setup.py
index a7f2722..082a331 100755
--- a/tools/setup.py
+++ b/tools/setup.py
@@ -56,7 +56,7 @@ parser.add_argument('--defaults', dest='defaults', action='store_true',
                    help='Use default settings')
 
 parser.add_argument('--clobber', dest='clobber', action='store_true',
-                   help='Allow overwrite of config.lua (default: create config.lua.tmp if
config.lua exists)')
+                   help='Allow overwrite of ponymail.cfg & ../site/api/lib/config.lua
(default: create *.tmp if either exists)')
 parser.add_argument('--dbhost', dest='dbhost', type=str, nargs=1,
                    help='ES backend hostname')
 parser.add_argument('--dbport', dest='dbport', type=str, nargs=1,
@@ -413,14 +413,14 @@ if not args.noi:
         print("Index creation failed: %s" % e)
         sys.exit(1)
 
-config_file = 'ponymail.cfg'
-if not args.clobber and os.path.exists(config_file):
-    print("%s exists and clobber is not set" % config_file)
-    config_file = 'ponymail.cfg.tmp'
+ponymail_cfg = 'ponymail.cfg'
+if not args.clobber and os.path.exists(ponymail_cfg):
+    print("%s exists and clobber is not set" % ponymail_cfg)
+    ponymail_cfg = 'ponymail.cfg.tmp'
 
-print("Writing importer config (%s)" % config_file)
+print("Writing importer config (%s)" % ponymail_cfg)
 
-with open(config_file, "w") as f:
+with open(ponymail_cfg, "w") as f:
     f.write("""
 ###############################################################
 # Pony Mail Configuration file                                             
@@ -450,9 +450,14 @@ ssl:                    false
 ###############################################################
             """ % (hostname, dbname, port))
     f.close()
-    
-print("mod_lua configuration (config.lua)")
-with open("../site/api/lib/config.lua", "w") as f:
+
+config_path = "../site/api/lib"
+config_file = "config.lua"
+if not args.clobber and os.path.exists(os.path.join(config_path,config_file)):
+    print("%s exists and clobber is not set" % config_file)
+    config_file = "config.lua.tmp"
+print("mod_lua configuration (%s)" % config_file)
+with open(os.path.join(config_path,config_file), "w") as f:
     f.write("""
 local config = {
     es_url = "http://%s:%u/%s/",


Mime
View raw message