# Helper functions
def find_files(topdir, prefix='', suffix='.rpm'):
"""Find files in the tree."""
- for item in os.listdir(topdir):
- path = os.path.join(topdir, item)
- if os.path.isdir(path):
- for fpath in find(path):
- yield fpath
- elif item.startswith(prefix) and item.endswith(suffix):
- yield path
+ for root, dirs, files in os.walk(topdir):
+ for item in files:
+ if item.startswith(prefix) and item.endswith(suffix):
+ yield os.path.join(root, item)
def collect(in_dir):
"""Collect files, binary archs and destinations."""
"""Add image configurations."""
for name, content in images:
self.images.append((name, content))
-