From 0369a069ade1602879c16dd33dc592bed3f17c0f Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Wed, 29 Jul 2015 17:02:54 -0500 Subject: Support filtering by group on forall and list subcmd Enable operating against groups of repositories. As it stands, it isn't compatible with `-r/--regex`. `repo forall -g groupname -c pwd` will run `pwd` for all projects in groupname. `repo forall -g thisgroup,-butnotthisone -c pwd` will run `pwd` for all projects in `thisgroup` but not `butnotthisone`. `repo list -g groupname -n` will list all the names of repos in `groupname`. Change-Id: Ia75c50ce52541d1c8cea2874b20a4db2e0e54960 --- command.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'command.py') diff --git a/command.py b/command.py index 207ef46b..38cacd3b 100644 --- a/command.py +++ b/command.py @@ -126,7 +126,7 @@ class Command(object): pass return project - def GetProjects(self, args, missing_ok=False, submodules_ok=False): + def GetProjects(self, args, groups='', missing_ok=False, submodules_ok=False): """A list of projects that match the arguments. """ all_projects_list = self.manifest.projects @@ -134,7 +134,8 @@ class Command(object): mp = self.manifest.manifestProject - groups = mp.config.GetString('manifest.groups') + if not groups: + groups = mp.config.GetString('manifest.groups') if not groups: groups = 'default,platform-' + platform.system().lower() groups = [x for x in re.split(r'[,\s]+', groups) if x] -- cgit v1.2.3-54-g00ecf