]>
Commit | Line | Data |
---|---|---|
deda9a51 MM |
1 | import re |
2 | import string | |
3 | ||
4 | import chroot | |
5 | ||
6 | def install_br(r, b): | |
7 | cmd = "cd rpm/SPECS; TMPDIR=$HOME/%s rpmbuild --nobuild %s %s 2>&1" \ | |
8 | % (b.b_id, b.bconds_string(), b.spec) | |
9 | f = chroot.popen(cmd) | |
10 | rx = re.compile("^\s*([^\s]+) .* is needed by") | |
11 | needed = {} | |
12 | for l in f.xreadlines(): | |
13 | m = rx.search(l) | |
14 | if m: needed[m.group(1)] = 1 | |
15 | f.close() | |
16 | if len(needed) == 0: | |
17 | return | |
18 | br = string.join(needed.keys()) | |
19 | b.log_line("installing BR: %s" % br) | |
20 | res = chroot.run("poldek --up && poldek --unique-pkg-names -v --install %s" % br, | |
21 | user = "root", | |
22 | logfile = b.logfile) | |
23 | if res != 0: | |
24 | b.log_line("error: BR installation failed") | |
25 | return res |