# FIXME: use python
os.system("rm -f %s/* 2>/dev/null; rmdir %s 2>/dev/null" % (dir, dir))
-def collect_files(log):
+def collect_files(log, basedir = "/home"):
f = open(log, 'r')
- rx = re.compile(r"^Wrote: (/home.*\.rpm)$")
+ rx = re.compile(r"^Wrote: (%s.*\.rpm)$" % basedir)
+ proc = re.compile(r"^Processing (files):.*$")
files = []
- for l in f.xreadlines():
+ for l in reversed(list(f.xreadlines())):
+ if proc.match(l):
+ break
m = rx.search(l)
if m:
files.append(m.group(1))