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

svn path=/main/branches/2.1.6/; revision=12473

pym/_emerge/__init__.py

index ddc33d423c4e320a88232bf35acfd3bfb9c0b519..bb9dac73f9d7e0dbd47df7b9b984fe2ae42eef94 100644 (file)
@@ -11772,6 +11772,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")