Gentoo Archives: gentoo-commits

From: Wiktor W Brodlo <wiktor@××××××.net>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/anaconda:master commit in: gentoo/
Date: Tue, 05 Jul 2011 15:38:56
Message-Id: c8bcb76be0986f5f3122a8dfbf0851908041cbc9.wiktor@gentoo
1 commit: c8bcb76be0986f5f3122a8dfbf0851908041cbc9
2 Author: wiktor w brodlo <wiktor <AT> brodlo <DOT> net>
3 AuthorDate: Tue Jul 5 15:38:30 2011 +0000
4 Commit: Wiktor W Brodlo <wiktor <AT> brodlo <DOT> net>
5 CommitDate: Tue Jul 5 15:38:30 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/anaconda.git;a=commit;h=c8bcb76b
7
8 gentoo/utils.py: a nice trick to unmask packages temporarily
9
10 ---
11 gentoo/utils.py | 50 ++++++++++----------------------------------------
12 1 files changed, 10 insertions(+), 40 deletions(-)
13
14 diff --git a/gentoo/utils.py b/gentoo/utils.py
15 index 1969d42..b10ebcf 100644
16 --- a/gentoo/utils.py
17 +++ b/gentoo/utils.py
18 @@ -268,42 +268,12 @@ class GentooInstall:
19 # del self._settings[sys_settings_plg_id]['misc']['configprotectskip'][:]
20
21 def install_package(self, atom, match = None, silent = False, fetch = False):
22 -
23 - #if silent and os.getenv('GENTOO_DEBUG'):
24 - # silent = False
25 -
26 - #chroot = self._root
27 - #root = etpSys['rootdir']
28 - # Doesn't matter, Portage chroots in the terminal if needed
29 - #if chroot != root:
30 - # self._change_entropy_chroot(chroot)
31 -
32 - #if match is None:
33 - # match = self._entropy.atom_match(atom)
34 - #oldstdout = sys.stdout
35 -
36 - #if silent:
37 - # sys.stdout = STDERR_LOG
38 - # etpUi['mute'] = True
39 -
40 - #try:
41 - # rc = 0
42 - # if match[0] != -1:
43 - # Package = self._entropy.Package()
44 - # action = "install"
45 - # if fetch:
46 - # action = "fetch"
47 - # Package.prepare(match, action)
48 - # rc = Package.run()
49 - # Package.kill()
50 - #finally:
51 - # if silent:
52 - # sys.stdout = oldstdout
53 - # etpUi['mute'] = False
54 - # if chroot != root:
55 - # self._change_entropy_chroot(root)
56 -
57 return self._portage.install(atom)
58 +
59 + def install_masked_package(self, atom):
60 + os.environ["ACCEPT_KEYWORDS"] = "~amd64 ~x86"
61 + return self._portage.install(atom)
62 + del os.environ["ACCEPT_KEYWORDS"]
63
64 # TODO: We don't remove anything from stage3
65 def remove_package(self, atom, match = None, silent = False):
66 @@ -1070,15 +1040,15 @@ class GentooInstall:
67 def install_setup_tools(self):
68 self._progress.set_fraction(0.0)
69 self._progress.set_text(_("Installing configuration helpers"))
70 - self.install_package("-1 system-config-date")
71 + self.install_masked_package("-1 system-config-date")
72 self._progress.set_fraction(0.2)
73 - self.install_package("-1 system-config-keyboard")
74 + self.install_masked_package("-1 system-config-keyboard")
75 self._progress.set_fraction(0.4)
76 - self.install_package("-1 system-config-users")
77 + self.install_masked_package("-1 system-config-users")
78 self._progress.set_fraction(0.6)
79 - self.install_package("-1 keyboard-configuration-helpers")
80 + self.install_masked_package("-1 keyboard-configuration-helpers")
81 self._progress.set_fraction(0.8)
82 - self.install_package("-1 language-configuration-helpers")
83 + self.install_masked_package("-1 language-configuration-helpers")
84 self._progress.set_fraction(1.0)
85
86 def set_profile(self):