aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-08-27 17:54:13 +0000
committerZac Medico <zmedico@gentoo.org>2007-08-27 17:54:13 +0000
commitd59466926e57f1226fe654deb109812a1cd19389 (patch)
tree8544fbb2fe2c1cd8b32bfd073a13b84a5260a8d4 /pym/portage/cvstree.py
parentchange directory to / in case $PWD doesnt exist (diff)
downloadportage-d59466926e57f1226fe654deb109812a1cd19389.tar.gz
portage-d59466926e57f1226fe654deb109812a1cd19389.tar.bz2
portage-d59466926e57f1226fe654deb109812a1cd19389.zip
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
Diffstat (limited to 'pym/portage/cvstree.py')
-rw-r--r--pym/portage/cvstree.py19
1 files changed, 18 insertions, 1 deletions
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