1 # vi: encoding=utf-8 ts=8 sts=4 sw=4 et
10 return str(uuid_random())
13 f = os.popen("uuidgen 2>&1")
17 raise Exception("uuid: fatal, cannot generate uuid: %s" % u)
20 # uuid module available in python >= 2.5
22 from uuid import uuid4 as uuid_random
29 return re.match(r"(.+)-[^-]+-[^-]+", nvr).group(1)
34 def sendfile(src, dst):
43 def append_to(log, msg):
50 os.system("rm -f %s/* 2>/dev/null; rmdir %s 2>/dev/null" % (dir, dir))
52 def collect_files(log, basedir = "/home"):
54 rx = re.compile(r"^Wrote: (%s.*\.rpm)$" % basedir)
55 proc = re.compile(r"^Processing files:.*$")
57 for l in reversed(list(f)):
62 files.append(m.group(1))
66 def find_last_section(log):
68 rx1 = re.compile(r"^Executing\(%(\w+)\).*$")
69 rx2 = re.compile(r"^Processing (files):.*$")
76 last_section = m.group(1)