Gentoo Archives: gentoo-commits

From: Wiktor W Brodlo <wiktor@××××××.net>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/anaconda:master commit in: iw/
Date: Mon, 04 Jul 2011 14:18:09
Message-Id: 8c490ea65b7ec64d6f5055263e696aa39651227e.wiktor@gentoo
1 commit: 8c490ea65b7ec64d6f5055263e696aa39651227e
2 Author: wiktor w brodlo <wiktor <AT> brodlo <DOT> net>
3 AuthorDate: Mon Jul 4 14:17:40 2011 +0000
4 Commit: Wiktor W Brodlo <wiktor <AT> brodlo <DOT> net>
5 CommitDate: Mon Jul 4 14:17:40 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/anaconda.git;a=commit;h=8c490ea6
7
8 iw/use_gui.py: Check flags enabled by the profile
9
10 ---
11 iw/use_gui.py | 18 +++++++++++++++++-
12 1 files changed, 17 insertions(+), 1 deletions(-)
13
14 diff --git a/iw/use_gui.py b/iw/use_gui.py
15 index d903c42..d121cc4 100644
16 --- a/iw/use_gui.py
17 +++ b/iw/use_gui.py
18 @@ -28,6 +28,7 @@ import sys
19 import gui
20 import subprocess
21 import re
22 +import shutil
23
24 from iw_gui import *
25
26 @@ -45,6 +46,14 @@ class UseWindow(InstallWindow):
27
28 (self.xml, self.align) = gui.getGladeWidget("use.glade", "use_align")
29
30 + # Temporarily move the make.conf file and query emerge to find out the flags selected by the profile
31 + shutil.move("/etc/make.conf", "/etc/make.conf.anaconda-backup")
32 + emerge = subprocess.check_output(["emerge", "--info"])
33 + shutil.move("/etc/make.conf.anaconda-backup", "/etc/make.conf")
34 + m = re.search('USE="(.*?)"', emerge)
35 + use_enabled = m.group(1)
36 + use_enabled = use_enabled.split
37 +
38 usef = open("/usr/portage/profiles/use.desc")
39 lines = usef.read().split("\n")
40
41 @@ -67,10 +76,17 @@ class UseWindow(InstallWindow):
42 rows = table.get_property("n-rows")
43 table.resize(rows+1, cols)
44
45 + cb = gtk.CheckButton(label=flag)
46 + if flag in use_enabled:
47 + cb.active = True
48 +
49 l = gtk.Label(use[flag])
50 l.set_alignment(0,0)
51 - table.attach(gtk.CheckButton(label=flag), 0, 1, rows, rows+1, gtk.FILL)
52 +
53 + table.attach(cb, 0, 1, rows, rows+1, gtk.FILL)
54 table.attach(l, 1, 2, rows, rows+1)
55 +
56 +
57
58 return self.align