]> scripts.mit.edu Git - wizard.git/commitdiff
Fix some bugs that Xavid found.
authorEdward Z. Yang <ezyang@mit.edu>
Fri, 25 Dec 2009 23:56:05 +0000 (18:56 -0500)
committerEdward Z. Yang <ezyang@mit.edu>
Sat, 26 Dec 2009 00:17:52 +0000 (19:17 -0500)
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
TODO
wizard/command/upgrade.py
wizard/shell.py

diff --git a/TODO b/TODO
index e6a2d26e98b3c84731b9b130134ea4e89fe1a3d5..5762dee498fab20f7f24a78d8cec90e0cdba2109 100644 (file)
--- a/TODO
+++ b/TODO
@@ -3,8 +3,12 @@ The Git Autoinstaller
 TODO NOW:
 
 - Write the code to make Wordpress figure out its URL from the database
+
 - Remerges aren't reflected in the parent files, so `git diff` output is
   spurious.  Not sure how to fix this w/o tree hackery.
+- Missing ancestor means that certain files cannot be merged, for the curious files;
+  this is indicated by 1,3 but missing 2.  There might be some cleverness to be
+  done here by finding a "fake" ancestor to use.
 
 - wizard install wordpress should ask for password.  One problem with this is that
   Wordpress will still send mail with the wrong username and password, so Wordpress
@@ -12,9 +16,6 @@ TODO NOW:
   email to a null address and then fix it manually.
 - Parse output HTML for class="error" and give those errors back to the user (done),
   then boot them back into configure so they can enter in something different
-- Missing ancestor means that certain files cannot be merged, for the curious files;
-  this is indicated by 1,3 but missing 2.  There might be some cleverness to be
-  done here by finding a "fake" ancestor to use.
 
 - Replace gaierror with a more descriptive name (this is a DNS error)
 
index 1b7ee15163fae033ef7c64d4a0b2d1626d3b952c..8530857c894fb36912d3f35b0460dd93155c50da 100644 (file)
@@ -273,6 +273,11 @@ def perform_merge(sh, repo, d, wc, version, use_shm, kib_avail, non_interactive)
         else:
             user_shell = os.getenv("SHELL")
             if not user_shell: user_shell = "/bin/bash"
+            # XXX: scripts specific hack, since mbash doesn't respect the current working directory
+            # When the revolution comes (i.e. $ATHENA_HOMEDIR/Scripts is your Scripts home
+            # directory) this isn't strictly necessary, but we'll probably need to support
+            # web_scripts directories ad infinitum.
+            if user_shell == "/usr/local/bin/mbash": user_shell = "/bin/bash"
             while 1:
                 print
                 print "ERROR: The merge failed with %d conflicts in these files:" % conflicts
@@ -281,7 +286,8 @@ def perform_merge(sh, repo, d, wc, version, use_shm, kib_avail, non_interactive)
                     print "  * %s" % file
                 print
                 print "Please resolve these conflicts (edit and then `git add`), and"
-                print "then type 'exit'."
+                print "then type 'exit'.  You will now be dropped into a shell whose working"
+                print "directory is %s" % curdir
                 sh.call(user_shell, "-i", interactive=True)
                 if sh.eval("git", "ls-files", "--unmerged").strip():
                     print
index f0fe8c6587c8612cc03d333191353e60b7412f2d..687071205a14fe12a63557dc722a0b20f3195e24 100644 (file)
@@ -131,6 +131,12 @@ class Shell(object):
         if self._async(proc, args, **kwargs):
             return proc
         stdout, stderr = proc.communicate(kwargs["input"])
+        # can occur if we were doing interactive communication; i.e.
+        # we didn't pass in PIPE.
+        if stdout is None:
+            stdout = ""
+        if stderr is None:
+            stderr = ""
         if not kwargs["interactive"]:
             if kwargs["strip"]:
                 self._log(None, stderr)