]> git.pld-linux.org Git - projects/pld-builder.new.git/blame - PLD_Builder/install_br.py
- fix regexp
[projects/pld-builder.new.git] / PLD_Builder / install_br.py
CommitLineData
deda9a51
MM
1import re
2import string
3
4import chroot
5
6def 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)
6b33872c 10 rx = re.compile(r"^\s*([^\s]+) .* is needed by")
deda9a51 11 needed = {}
c901112f 12 b.log_line("checking BR")
deda9a51 13 for l in f.xreadlines():
c901112f 14 b.log_line("rpm: %s" % l)
deda9a51
MM
15 m = rx.search(l)
16 if m: needed[m.group(1)] = 1
17 f.close()
18 if len(needed) == 0:
c901112f 19 b.log_line("no BR needed")
deda9a51
MM
20 return
21 br = string.join(needed.keys())
22 b.log_line("installing BR: %s" % br)
23 res = chroot.run("poldek --up && poldek --unique-pkg-names -v --install %s" % br,
24 user = "root",
25 logfile = b.logfile)
26 if res != 0:
27 b.log_line("error: BR installation failed")
28 return res
This page took 0.06436 seconds and 4 git commands to generate.