* [gentoo-portage-dev] [PATCH] git sync: Respect PORTAGE_QUIET
@ 2015-09-04 10:20 Consus
2015-09-04 17:29 ` Brian Dolbec
0 siblings, 1 reply; 3+ messages in thread
From: Consus @ 2015-09-04 10:20 UTC (permalink / raw
To: gentoo-portage-dev
Execute `git clone --quiet' and `git pull --quiet' when appropriate.
---
pym/portage/sync/modules/git/git.py | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/pym/portage/sync/modules/git/git.py b/pym/portage/sync/modules/git/git.py
index 7a710ef..c14782c 100644
--- a/pym/portage/sync/modules/git/git.py
+++ b/pym/portage/sync/modules/git/git.py
@@ -1,4 +1,4 @@
-# Copyright 2005-2014 Gentoo Foundation
+# Copyright 2005-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import logging
@@ -43,15 +43,18 @@ class GitSync(NewBase):
'Created new directory %s' % self.repo.location)
except IOError:
return (1, False)
+
sync_uri = self.repo.sync_uri
if sync_uri.startswith("file://"):
sync_uri = sync_uri[6:]
- depth_arg = ''
- if self.repo.sync_depth is not None:
- depth_arg = '--depth %d ' % self.repo.sync_depth
- git_cmd = "%s clone %s%s ." % (self.bin_command, depth_arg,
- portage._shell_quote(sync_uri))
+ git_cmd_opts = ""
+ if self.settings.get("PORTAGE_QUIET") == "1":
+ git_cmd_opts += " --quiet"
+ if self.repo.sync_depth is not None:
+ git_cmd_opts += " --depth %d" % self.repo.sync_depth
+ git_cmd = "%s clone%s %s ." % (self.bin_command, git_cmd_opts,
+ portage._shell_quote(sync_uri))
writemsg_level(git_cmd + "\n")
exitcode = portage.process.spawn_bash("cd %s ; exec %s" % (
@@ -72,7 +75,10 @@ class GitSync(NewBase):
git directly.
'''
- git_cmd = "%s pull" % self.bin_command
+ git_cmd_opts = ""
+ if self.settings.get("PORTAGE_QUIET") == "1":
+ git_cmd_opts += " --quiet"
+ git_cmd = "%s pull%s" % (self.bin_command, git_cmd_opts)
writemsg_level(git_cmd + "\n")
exitcode = portage.process.spawn_bash("cd %s ; exec %s" % (
--
2.5.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [gentoo-portage-dev] [PATCH] git sync: Respect PORTAGE_QUIET
2015-09-04 10:20 [gentoo-portage-dev] [PATCH] git sync: Respect PORTAGE_QUIET Consus
@ 2015-09-04 17:29 ` Brian Dolbec
2015-09-04 18:50 ` Consus
0 siblings, 1 reply; 3+ messages in thread
From: Brian Dolbec @ 2015-09-04 17:29 UTC (permalink / raw
To: gentoo-portage-dev
On Fri, 4 Sep 2015 10:20:27 +0000
Consus <consus@gmx.com> wrote:
> Execute `git clone --quiet' and `git pull --quiet' when appropriate.
> ---
> pym/portage/sync/modules/git/git.py | 20 +++++++++++++-------
> 1 file changed, 13 insertions(+), 7 deletions(-)
>
> diff --git a/pym/portage/sync/modules/git/git.py
> b/pym/portage/sync/modules/git/git.py index 7a710ef..c14782c 100644
> --- a/pym/portage/sync/modules/git/git.py
> +++ b/pym/portage/sync/modules/git/git.py
> @@ -1,4 +1,4 @@
> -# Copyright 2005-2014 Gentoo Foundation
> +# Copyright 2005-2015 Gentoo Foundation
> # Distributed under the terms of the GNU General Public License v2
>
> import logging
> @@ -43,15 +43,18 @@ class GitSync(NewBase):
> 'Created new directory %s' %
> self.repo.location) except IOError:
> return (1, False)
> +
> sync_uri = self.repo.sync_uri
> if sync_uri.startswith("file://"):
> sync_uri = sync_uri[6:]
> - depth_arg = ''
> - if self.repo.sync_depth is not None:
> - depth_arg = '--depth %d ' %
> self.repo.sync_depth
> - git_cmd = "%s clone %s%s ." % (self.bin_command,
> depth_arg,
> - portage._shell_quote(sync_uri))
> + git_cmd_opts = ""
> + if self.settings.get("PORTAGE_QUIET") == "1":
> + git_cmd_opts += " --quiet"
> + if self.repo.sync_depth is not None:
> + git_cmd_opts += " --depth %d" %
> self.repo.sync_depth
> + git_cmd = "%s clone%s %s ." % (self.bin_command,
> git_cmd_opts,
> + portage._shell_quote(sync_uri))
> writemsg_level(git_cmd + "\n")
>
> exitcode = portage.process.spawn_bash("cd %s ; exec
> %s" % ( @@ -72,7 +75,10 @@ class GitSync(NewBase):
> git directly.
> '''
>
> - git_cmd = "%s pull" % self.bin_command
> + git_cmd_opts = ""
> + if self.settings.get("PORTAGE_QUIET") == "1":
> + git_cmd_opts += " --quiet"
> + git_cmd = "%s pull%s" % (self.bin_command,
> git_cmd_opts) writemsg_level(git_cmd + "\n")
>
> exitcode = portage.process.spawn_bash("cd %s ; exec
> %s" % (
merged and pushed to master
Thank you
--
Brian Dolbec <dolsen>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [gentoo-portage-dev] [PATCH] git sync: Respect PORTAGE_QUIET
2015-09-04 17:29 ` Brian Dolbec
@ 2015-09-04 18:50 ` Consus
0 siblings, 0 replies; 3+ messages in thread
From: Consus @ 2015-09-04 18:50 UTC (permalink / raw
To: gentoo-portage-dev
On 10:29 Fri 04 Sep , Brian Dolbec wrote:
> merged and pushed to master
>
> Thank you
My pleasure.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-09-04 18:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-04 10:20 [gentoo-portage-dev] [PATCH] git sync: Respect PORTAGE_QUIET Consus
2015-09-04 17:29 ` Brian Dolbec
2015-09-04 18:50 ` Consus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox