Gentoo Archives: gentoo-portage-dev

From: Consus <consus@×××.com>
To: gentoo-portage-dev@l.g.o
Subject: [gentoo-portage-dev] [PATCH] git sync: Respect PORTAGE_QUIET
Date: Fri, 04 Sep 2015 10:23:29
Message-Id: 20150904102027.GB11432@daphne
1 Execute `git clone --quiet' and `git pull --quiet' when appropriate.
2 ---
3 pym/portage/sync/modules/git/git.py | 20 +++++++++++++-------
4 1 file changed, 13 insertions(+), 7 deletions(-)
5
6 diff --git a/pym/portage/sync/modules/git/git.py b/pym/portage/sync/modules/git/git.py
7 index 7a710ef..c14782c 100644
8 --- a/pym/portage/sync/modules/git/git.py
9 +++ b/pym/portage/sync/modules/git/git.py
10 @@ -1,4 +1,4 @@
11 -# Copyright 2005-2014 Gentoo Foundation
12 +# Copyright 2005-2015 Gentoo Foundation
13 # Distributed under the terms of the GNU General Public License v2
14
15 import logging
16 @@ -43,15 +43,18 @@ class GitSync(NewBase):
17 'Created new directory %s' % self.repo.location)
18 except IOError:
19 return (1, False)
20 +
21 sync_uri = self.repo.sync_uri
22 if sync_uri.startswith("file://"):
23 sync_uri = sync_uri[6:]
24 - depth_arg = ''
25 - if self.repo.sync_depth is not None:
26 - depth_arg = '--depth %d ' % self.repo.sync_depth
27
28 - git_cmd = "%s clone %s%s ." % (self.bin_command, depth_arg,
29 - portage._shell_quote(sync_uri))
30 + git_cmd_opts = ""
31 + if self.settings.get("PORTAGE_QUIET") == "1":
32 + git_cmd_opts += " --quiet"
33 + if self.repo.sync_depth is not None:
34 + git_cmd_opts += " --depth %d" % self.repo.sync_depth
35 + git_cmd = "%s clone%s %s ." % (self.bin_command, git_cmd_opts,
36 + portage._shell_quote(sync_uri))
37 writemsg_level(git_cmd + "\n")
38
39 exitcode = portage.process.spawn_bash("cd %s ; exec %s" % (
40 @@ -72,7 +75,10 @@ class GitSync(NewBase):
41 git directly.
42 '''
43
44 - git_cmd = "%s pull" % self.bin_command
45 + git_cmd_opts = ""
46 + if self.settings.get("PORTAGE_QUIET") == "1":
47 + git_cmd_opts += " --quiet"
48 + git_cmd = "%s pull%s" % (self.bin_command, git_cmd_opts)
49 writemsg_level(git_cmd + "\n")
50
51 exitcode = portage.process.spawn_bash("cd %s ; exec %s" % (
52 --
53 2.5.0

Replies

Subject Author
Re: [gentoo-portage-dev] [PATCH] git sync: Respect PORTAGE_QUIET Brian Dolbec <dolsen@g.o>