1 |
Set updatecache_flg to False if the git revision is unchanged. |
2 |
|
3 |
X-Gentoo-Bug: 564988 |
4 |
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=564988 |
5 |
--- |
6 |
pym/portage/sync/modules/git/git.py | 11 ++++++++++- |
7 |
1 file changed, 10 insertions(+), 1 deletion(-) |
8 |
|
9 |
diff --git a/pym/portage/sync/modules/git/git.py b/pym/portage/sync/modules/git/git.py |
10 |
index c14782c..179c0de 100644 |
11 |
--- a/pym/portage/sync/modules/git/git.py |
12 |
+++ b/pym/portage/sync/modules/git/git.py |
13 |
@@ -2,6 +2,7 @@ |
14 |
# Distributed under the terms of the GNU General Public License v2 |
15 |
|
16 |
import logging |
17 |
+import subprocess |
18 |
|
19 |
import portage |
20 |
from portage import os |
21 |
@@ -81,6 +82,10 @@ class GitSync(NewBase): |
22 |
git_cmd = "%s pull%s" % (self.bin_command, git_cmd_opts) |
23 |
writemsg_level(git_cmd + "\n") |
24 |
|
25 |
+ rev_cmd = [self.bin_command, "rev-list", "--max-count=1", "HEAD"] |
26 |
+ previous_rev = subprocess.check_output(rev_cmd, |
27 |
+ cwd=portage._unicode_encode(self.repo.location)) |
28 |
+ |
29 |
exitcode = portage.process.spawn_bash("cd %s ; exec %s" % ( |
30 |
portage._shell_quote(self.repo.location), git_cmd), |
31 |
**portage._native_kwargs(self.spawn_kwargs)) |
32 |
@@ -89,4 +94,8 @@ class GitSync(NewBase): |
33 |
self.logger(self.xterm_titles, msg) |
34 |
writemsg_level(msg + "\n", level=logging.ERROR, noiselevel=-1) |
35 |
return (exitcode, False) |
36 |
- return (os.EX_OK, True) |
37 |
+ |
38 |
+ current_rev = subprocess.check_output(rev_cmd, |
39 |
+ cwd=portage._unicode_encode(self.repo.location)) |
40 |
+ |
41 |
+ return (os.EX_OK, current_rev != previous_rev) |
42 |
-- |
43 |
2.4.9 |