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