summaryrefslogtreecommitdiffstats
path: root/pym/cvstree.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-09-06 17:41:01 +0000
committerZac Medico <zmedico@gentoo.org>2007-09-06 17:41:01 +0000
commit0a4c6057b7ed234c24c9b8082ceadc2e60f7bd92 (patch)
tree36979dc1f18d6e60f76093f6fcfc10b332d41086 /pym/cvstree.py
parentab2bff3134b94f4c7b8971012d7e7f58a87a675e (diff)
downloadportage-0a4c6057b7ed234c24c9b8082ceadc2e60f7bd92.tar.gz
portage-0a4c6057b7ed234c24c9b8082ceadc2e60f7bd92.tar.bz2
portage-0a4c6057b7ed234c24c9b8082ceadc2e60f7bd92.zip
Bug #190406 - Filter the myheaders list so that it doesn't include binary
blobs added to cvs with the -kb option. (trunk r7705) svn path=/main/branches/2.1.2/; revision=7736
Diffstat (limited to 'pym/cvstree.py')
-rw-r--r--pym/cvstree.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/pym/cvstree.py b/pym/cvstree.py
index ca94d3512..f74ecd4ac 100644
--- a/pym/cvstree.py
+++ b/pym/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