]> scripts.mit.edu Git - wizard.git/commitdiff
Fix broken installs if directory exists.
authorEdward Z. Yang <ezyang@mit.edu>
Mon, 28 Dec 2009 00:05:11 +0000 (19:05 -0500)
committerEdward Z. Yang <ezyang@mit.edu>
Mon, 28 Dec 2009 00:05:11 +0000 (19:05 -0500)
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
tests/mediawiki-install-test.sh
tests/wordpress-install-test.sh
wizard/command/install.py

index ed09a6143bfe98d448904575723e61c555e8e923..f82d947bdb0bb880e75b825cc4d5a9fdf8ad7200 100755 (executable)
@@ -4,4 +4,5 @@ cd `dirname $0`
 DEFAULT_HEAD=1
 TESTNAME="mediawiki_install"
 source ./setup
+mkdir "$TESTDIR"
 source ./mediawiki-install
index 250e7ba3a124ff5961934c20184415463318b70d..47450356bddbadd17b2e79adf097039cb79c6899 100755 (executable)
@@ -5,4 +5,5 @@ DEFAULT_HEAD=1
 TESTNAME="wordpress_install"
 source ./setup
 
+mkdir "$TESTDIR"
 source ./wordpress-install
index 4ae9058a3880953f3568fb41c57a7c9158fb90f5..6ac1383e202677f89438632d293dbaa3e6a8c568 100644 (file)
@@ -1,6 +1,7 @@
 import os
 import sys
 import distutils
+import logging
 
 import wizard
 from wizard import app, command, git, prompt, shell, util
@@ -40,9 +41,11 @@ Autoinstalls the application %s in the directory DIR.""" % (appname, appname))
     else:
         ihandler.ask(options)
 
-    input.infobox("Copying files (this may take a while)...")
-    if not os.path.exists(dir):
+    if not os.path.exists(dir) or not os.listdir(dir):
+        input.infobox("Copying files (this may take a while)...")
         shell.call("git", "clone", "-q", "--shared", application.repository(old_options.srv_path), dir)
+    else:
+        logging.info("Skipped clone")
     with util.ChangeDirectory(dir):
         if not old_options.retry and version and version != "head-scripts": # for ease in testing
             shell.call("git", "reset", "-q", "--hard", appstr)