fix use of brace_expand in removefrom

This commit is contained in:
Will Woods 2011-06-27 16:03:40 -04:00
parent 741fbc7b43
commit 3388c1c529

View File

@ -374,8 +374,10 @@ class TemplateRunner(object):
self.yum.closeRpmDB()
def removefrom(self, pkg, *globs):
globs = set(brace_expand(globs))
globs_re = re.compile("|".join([fnmatch.translate(g) for g in globs]))
globset = set()
for g in globs:
globset.update(brace_expand(g))
globs_re = re.compile("|".join([fnmatch.translate(g) for g in globset]))
remove = filter(globs_re.match, self._filelist(pkg))
logger.debug("removing %i files from %s", len(remove), pkg)
self.remove(*remove)