From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 6FFA058973 for ; Mon, 25 Jan 2016 01:35:23 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D847E21C020; Mon, 25 Jan 2016 01:35:21 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id DC84C21C007 for ; Mon, 25 Jan 2016 01:35:20 +0000 (UTC) Received: from professor-x (S010634bdfa9ecf80.vc.shawcable.net [96.49.31.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dolsen) by smtp.gentoo.org (Postfix) with ESMTPSA id 1D696340942 for ; Mon, 25 Jan 2016 01:35:20 +0000 (UTC) Date: Sun, 24 Jan 2016 17:34:27 -0800 From: Brian Dolbec To: gentoo-portage-dev@lists.gentoo.org Subject: [gentoo-portage-dev] [PATCH] Add sync-git-clone-extra-opts and sync-git-pull-extra-opts Message-ID: <20160124173427.3b3c61b0.dolsen@gentoo.org> Organization: Gentoo Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-Archives-Salt: e8744aec-4638-4270-9382-cd00051b97ac X-Archives-Hash: efdc09bf671824622bc9984217655163 =46rom f3ae0003f8cb0c5f4fc8728254ee05bda38d7304 Mon Sep 17 00:00:00 2001 From: Ross Konsolebox Date: Sun, 24 Jan 2016 16:27:36 +0800 Subject: [PATCH] Add sync-git-clone-extra-opts and sync-git-pull-extra-opts --- man/portage.5 | 6 ++++++ pym/portage/sync/modules/git/__init__.py | 5 ++++- pym/portage/sync/modules/git/git.py | 4 ++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/man/portage.5 b/man/portage.5 index c9e70a0..7c2a8f7 100644 --- a/man/portage.5 +++ b/man/portage.5 @@ -968,6 +968,12 @@ Specifies CVS repository. Specifies clone depth to use for DVCS repositories. Defaults to 1 (only the newest commit). If set to 0, the depth is unlimited. .TP +.B sync\-git\-clone\-extra\-opts +Extra options to give to git when cloning repository (git clone). +.TP +.B sync\-git\-pull\-extra\-opts +Extra options to give to git when updating repository (git pull). +.TP .B sync\-hooks\-only\-on\-change If set to true, then sync of a given repository will not trigger postsync hooks unless hooks would have executed for a master repository or the diff --git a/pym/portage/sync/modules/git/__init__.py b/pym/portage/sync/mo= dules/git/__init__.py index da46b7f..357eb82 100644 --- a/pym/portage/sync/modules/git/__init__.py +++ b/pym/portage/sync/modules/git/__init__.py @@ -50,7 +50,10 @@ def check_depth(self): 'exists and is a valid Git repository', }, 'validate_config': CheckGitConfig, - 'module_specific_options': (), + 'module_specific_options': ( + 'sync-git-clone-extra-opts', + 'sync-git-pull-extra-opts', + ), } } } diff --git a/pym/portage/sync/modules/git/git.py b/pym/portage/sync/modules= /git/git.py index 179c0de..e6724f6 100644 --- a/pym/portage/sync/modules/git/git.py +++ b/pym/portage/sync/modules/git/git.py @@ -54,6 +54,8 @@ def new(self, **kwargs): git_cmd_opts +=3D " --quiet" if self.repo.sync_depth is not None: git_cmd_opts +=3D " --depth %d" % self.repo.sync_depth + if self.repo.module_specific_options.get('sync-git-clone-extra-opts'): + git_cmd_opts +=3D " %s" % self.repo.module_specific_options['sync-git-c= lone-extra-opts'] git_cmd =3D "%s clone%s %s ." % (self.bin_command, git_cmd_opts, portage._shell_quote(sync_uri)) writemsg_level(git_cmd + "\n") @@ -79,6 +81,8 @@ def update(self): git_cmd_opts =3D "" if self.settings.get("PORTAGE_QUIET") =3D=3D "1": git_cmd_opts +=3D " --quiet" + if self.repo.module_specific_options.get('sync-git-pull-extra-opts'): + git_cmd_opts +=3D " %s" % self.repo.module_specific_options['sync-git-p= ull-extra-opts'] git_cmd =3D "%s pull%s" % (self.bin_command, git_cmd_opts) writemsg_level(git_cmd + "\n") =20 --=20 Brian Dolbec