1 |
commit: 1327daa7c32ee093b58b52bfa66c3ffdcaf1e1c6 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Mar 17 21:23:52 2018 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Mar 21 18:25:54 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=1327daa7 |
7 |
|
8 |
GitSync: abort early for missing git command (bug 650754) |
9 |
|
10 |
Bug: https://bugs.gentoo.org/650754 |
11 |
|
12 |
pym/portage/sync/modules/git/git.py | 8 +++++++- |
13 |
1 file changed, 7 insertions(+), 1 deletion(-) |
14 |
|
15 |
diff --git a/pym/portage/sync/modules/git/git.py b/pym/portage/sync/modules/git/git.py |
16 |
index cec760d00..160137a6d 100644 |
17 |
--- a/pym/portage/sync/modules/git/git.py |
18 |
+++ b/pym/portage/sync/modules/git/git.py |
19 |
@@ -44,6 +44,8 @@ class GitSync(NewBase): |
20 |
'''Do the initial clone of the repository''' |
21 |
if kwargs: |
22 |
self._kwargs(kwargs) |
23 |
+ if not self.has_bin: |
24 |
+ return (1, False) |
25 |
try: |
26 |
if not os.path.exists(self.repo.location): |
27 |
os.makedirs(self.repo.location) |
28 |
@@ -104,7 +106,8 @@ class GitSync(NewBase): |
29 |
that he/she wants updated. We'll let the user manage branches with |
30 |
git directly. |
31 |
''' |
32 |
- |
33 |
+ if not self.has_bin: |
34 |
+ return (1, False) |
35 |
git_cmd_opts = "" |
36 |
if self.repo.module_specific_options.get('sync-git-env'): |
37 |
shlexed_env = shlex_split(self.repo.module_specific_options['sync-git-env']) |
38 |
@@ -218,6 +221,9 @@ class GitSync(NewBase): |
39 |
'''Get information about the head commit''' |
40 |
if kwargs: |
41 |
self._kwargs(kwargs) |
42 |
+ if self.bin_command is None: |
43 |
+ # return quietly so that we don't pollute emerge --info output |
44 |
+ return (1, False) |
45 |
rev_cmd = [self.bin_command, "rev-list", "--max-count=1", "HEAD"] |
46 |
try: |
47 |
ret = (os.EX_OK, |