]> TLD Linux GIT Repositories - tld-builder.git/blobdiff - TLD_Builder/util.py
- PLD merge, fully (re)TLDized
[tld-builder.git] / TLD_Builder / util.py
similarity index 86%
rename from PLD_Builder/util.py
rename to TLD_Builder/util.py
index 316a8f19f1461a377da5a5054dc23abdf7f8e312..b623115d7f2e407e3fe30d69e66a97bfe4a7b32f 100644 (file)
@@ -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))