Inside action_sync(), check for the git binary when necessary and bail out
authorZac Medico <zmedico@gentoo.org>
Sat, 10 Jan 2009 19:26:30 +0000 (19:26 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 10 Jan 2009 19:26:30 +0000 (19:26 -0000)
with a helpful message if it doesn't exist. Thanks to Caleb Cushing
<xenoterracide@gmail.com> for the initial patch.

svn path=/main/trunk/; revision=12417

pym/_emerge/__init__.py

index 5059ee77b84e922653c7ec0e6737de4908dc98e9..5185298c5a7e438188d321562132c304031bad99 100644 (file)
@@ -11948,6 +11948,13 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
                # going to trust the user and assume that the user is in the branch
                # that he/she wants updated. We'll let the user manage branches with
                # git directly.
+               if portage.process.find_binary("git") is None:
+                       msg = ["Command not found: git",
+                       "Type \"emerge dev-util/git\" to enable git support."]
+                       for l in msg:
+                               writemsg_level("!!! %s\n" % l,
+                                       level=logging.ERROR, noiselevel=-1)
+                       return 1
                msg = ">>> Starting git pull in %s..." % myportdir
                emergelog(xterm_titles, msg )
                writemsg_level(msg + "\n")