From d59466926e57f1226fe654deb109812a1cd19389 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 27 Aug 2007 17:54:13 +0000 Subject: Bug #190406 - Filter the myheaders list so that it doesn't include binary blobs added to cvs with the -kb option. svn path=/main/trunk/; revision=7705 --- pym/portage/cvstree.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'pym/portage/cvstree.py') diff --git a/pym/portage/cvstree.py b/pym/portage/cvstree.py index ca94d3512..f74ecd4ac 100644 --- a/pym/portage/cvstree.py +++ b/pym/portage/cvstree.py @@ -72,7 +72,24 @@ def findnew(entries,recursive=0,basedir=""): for mydir in entries["dirs"]: mylist+=findnew(entries["dirs"][mydir],recursive,basedir+mydir) return mylist - + +def findoption(entries, pattern, recursive=0, basedir=""): + """(entries, pattern, recursive=0, basedir="") + Iterate over paths of cvs entries for which the pattern.search() method + finds a match. Returns a list of paths, optionally prepended with a + basedir.""" + if not basedir.endswith("/"): + basedir += "/" + for myfile, mydata in entries["files"].iteritems(): + if "cvs" in mydata["status"]: + if pattern.search(mydata["flags"]): + yield basedir+myfile + if recursive: + for mydir, mydata in entries["dirs"].iteritems(): + for x in findoption(mydata, pattern, + recursive, basedir+mydir): + yield x + def findchanged(entries,recursive=0,basedir=""): """(entries,recursive=0,basedir="") Recurses the entries tree to find all elements that exist in the cvs tree -- cgit v1.2.3-1-g7c22