X-Git-Url: https://git.tld-linux.org/?p=tld-builder.git;a=blobdiff_plain;f=TLD_Builder%2Futil.py;fp=PLD_Builder%2Futil.py;h=b623115d7f2e407e3fe30d69e66a97bfe4a7b32f;hp=316a8f19f1461a377da5a5054dc23abdf7f8e312;hb=b999f53d4bf5d44586ecf028876e8bc20b5fd2ce;hpb=37463eaa22f48f5fecbb90e69ef67a69e0bf9788 diff --git a/PLD_Builder/util.py b/TLD_Builder/util.py similarity index 86% rename from PLD_Builder/util.py rename to TLD_Builder/util.py index 316a8f1..b623115 100644 --- a/PLD_Builder/util.py +++ b/TLD_Builder/util.py @@ -49,11 +49,14 @@ def clean_tmp(dir): # 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))