From d57756ce1748d959555e82d341b59513e506b08d Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 6 Mar 2012 16:56:21 +0000 Subject: Test for and include dirnames in chunks the same as filenames --- morphlib/bins.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/morphlib/bins.py b/morphlib/bins.py index 0d704e49..b6201756 100644 --- a/morphlib/bins.py +++ b/morphlib/bins.py @@ -64,12 +64,10 @@ def create_chunk(rootdir, f, regexps, ex, dump_memory_profile=None): compiled = [re.compile(x) for x in regexps] include = set() for dirname, subdirs, basenames in os.walk(rootdir): - if matches(dirname): - include.add(dirname) subdirpaths = [os.path.join(dirname, x) for x in subdirs] subdirsymlinks = [x for x in subdirpaths if os.path.islink(x)] filenames = [os.path.join(dirname, x) for x in basenames] - for filename in subdirsymlinks + filenames: + for filename in [dirname] + subdirsymlinks + filenames: if matches(mkrel(filename)): for name in names_to_root(filename): if name not in include: -- cgit v1.2.1