1 |
commit: 559bda2a9472f03be99235be80fe262e41b03663 |
2 |
Author: wiktor w brodlo <wiktor <AT> brodlo <DOT> net> |
3 |
AuthorDate: Tue Jul 5 13:54:57 2011 +0000 |
4 |
Commit: Wiktor W Brodlo <wiktor <AT> brodlo <DOT> net> |
5 |
CommitDate: Tue Jul 5 13:54:57 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/anaconda.git;a=commit;h=559bda2a |
7 |
|
8 |
Fix profile selection |
9 |
|
10 |
--- |
11 |
gentoo/__init__.py | 18 +++++++----------- |
12 |
gentoo/livecd.py | 8 ++++---- |
13 |
gentoo/utils.py | 5 ++--- |
14 |
3 files changed, 13 insertions(+), 18 deletions(-) |
15 |
|
16 |
diff --git a/gentoo/__init__.py b/gentoo/__init__.py |
17 |
index 594214c..e01844b 100644 |
18 |
--- a/gentoo/__init__.py |
19 |
+++ b/gentoo/__init__.py |
20 |
@@ -24,42 +24,38 @@ import sys |
21 |
|
22 |
class Portage: |
23 |
|
24 |
- def __init__(self, terminal): |
25 |
+ def __init__(self, terminal, root): |
26 |
print "Portage init!" |
27 |
self.term = terminal |
28 |
+ self.root = root |
29 |
|
30 |
# Syncs the Portage tree and updates Portage if an update is available |
31 |
def sync(self): |
32 |
- print "chroot "+os.environ["ANACONDA_PRODUCTPATH"]+" emerge --sync" |
33 |
- self.term.run_command("chroot "+os.environ["ANACONDA_PRODUCTPATH"]+" emerge --sync") |
34 |
+ self.term.run_command("chroot "+self.root+" emerge --sync") |
35 |
if self.term.get_child_exit_status() != 0: |
36 |
return False |
37 |
- print "chroot "+os.environ["ANACONDA_PRODUCTPATH"]+" emerge --update portage" |
38 |
- self.term.run_command("chroot "+os.environ["ANACONDA_PRODUCTPATH"]+" emerge --update portage") |
39 |
+ self.term.run_command("chroot "+self.root+" emerge --update portage") |
40 |
if self.term.get_child_exit_status() == 0: |
41 |
return True |
42 |
return False |
43 |
|
44 |
# Installs a package atom |
45 |
def install(self, atom): |
46 |
- print "chroot "+os.environ["ANACONDA_PRODUCTPATH"]+" emerge "+atom |
47 |
- self.term.run_command("chroot "+os.environ["ANACONDA_PRODUCTPATH"]+" emerge "+atom) |
48 |
+ self.term.run_command("chroot "+self.root+" emerge "+atom) |
49 |
if self.term.get_child_exit_status() == 0: |
50 |
return True |
51 |
return False |
52 |
|
53 |
# Updates world |
54 |
def update_world(self): |
55 |
- print "chroot "+os.environ["ANACONDA_PRODUCTPATH"]+" emerge --deep --newuse --update world" |
56 |
- self.term.run_command("chroot "+os.environ["ANACONDA_PRODUCTPATH"]+" emerge --deep --newuse --update world") |
57 |
+ self.term.run_command("chroot "+self.root+" emerge --deep --newuse --update world") |
58 |
if self.term.get_child_exit_status() == 0: |
59 |
return True |
60 |
return False |
61 |
|
62 |
# Removes a package atom |
63 |
def remove(self, atom): |
64 |
- print "chroot "+os.environ["ANACONDA_PRODUCTPATH"]+" emerge -C "+atom |
65 |
- self.term.run_command("chroot "+os.environ["ANACONDA_PRODUCTPATH"]+" emerge -C "+atom) |
66 |
+ self.term.run_command("chroot "+self.root+" emerge -C "+atom) |
67 |
if self.term.get_child_exit_status() == 0: |
68 |
return True |
69 |
return False |
70 |
|
71 |
diff --git a/gentoo/livecd.py b/gentoo/livecd.py |
72 |
index 40c8005..c9e7402 100644 |
73 |
--- a/gentoo/livecd.py |
74 |
+++ b/gentoo/livecd.py |
75 |
@@ -57,8 +57,8 @@ class LiveCDCopyBackend(backend.AnacondaBackend): |
76 |
self._root = anaconda.rootPath |
77 |
|
78 |
self.osimg = anaconda.methodstr[8:] |
79 |
- # On Gentoo we're using a stage3 as an installation source |
80 |
- # FIXME: Replace this with checking for stage3 |
81 |
+ # On Gentoo we're using a stage3 as an installation source |
82 |
+ # FIXME: Replace this with checking for stage3 |
83 |
#if not os.path.ismount(self.osimg): |
84 |
# anaconda.intf.messageWindow(_("Unable to find image"), |
85 |
# _("The given location [%s] isn't a valid %s " |
86 |
@@ -112,11 +112,11 @@ class LiveCDCopyBackend(backend.AnacondaBackend): |
87 |
self._progress.set_label(_("Installing Gentoo onto hard drive.")) |
88 |
self._progress.set_fraction(0.0) |
89 |
|
90 |
- self._gentoo_install.copy_portage() |
91 |
# Actually install |
92 |
self._gentoo_install.live_install() |
93 |
|
94 |
# Now copy the portage tree |
95 |
+ self._gentoo_install.copy_portage() |
96 |
self._gentoo_install.set_profile() |
97 |
self._gentoo_install.install_setup_tools() |
98 |
|
99 |
@@ -137,7 +137,7 @@ class LiveCDCopyBackend(backend.AnacondaBackend): |
100 |
self._gentoo_install.setup_audio() |
101 |
self._gentoo_install.setup_xorg() |
102 |
self._gentoo_install.remove_proprietary_drivers() |
103 |
- # TODO: This needs to be tried and fixed properly on Gentoo once installing X works |
104 |
+ # TODO: This needs to be tried and fixed properly on Gentoo once installing X works |
105 |
try: |
106 |
self._gentoo_install.setup_nvidia_legacy() |
107 |
except Exception as e: |
108 |
|
109 |
diff --git a/gentoo/utils.py b/gentoo/utils.py |
110 |
index 904563a..56ee310 100644 |
111 |
--- a/gentoo/utils.py |
112 |
+++ b/gentoo/utils.py |
113 |
@@ -173,7 +173,7 @@ class GentooInstall: |
114 |
self._prod_root = productPath |
115 |
self._intf = anaconda.intf |
116 |
self._progress = GentooProgress(anaconda) |
117 |
- self._portage = Portage(anaconda._intf.instProgress.terminal) |
118 |
+ self._portage = Portage(anaconda._intf.instProgress.terminal, self._root) |
119 |
# I'm wondering what's it actually for. ~w. |
120 |
#self._settings = SystemSettings() |
121 |
with open("/proc/cmdline", "r") as cmd_f: |
122 |
@@ -216,7 +216,6 @@ class GentooInstall: |
123 |
pid = os.fork() |
124 |
if pid == 0: |
125 |
|
126 |
- print "chrooting to "+self._root |
127 |
os.chroot(self._root) |
128 |
os.chdir("/") |
129 |
do_shell = False |
130 |
@@ -1074,7 +1073,7 @@ class GentooInstall: |
131 |
self._progress.set_fraction(0.8) |
132 |
self.install_package("-1 language-configuration-helpers") |
133 |
self._progress.set_fraction(1.0) |
134 |
- |
135 |
+ |
136 |
def set_profile(self): |
137 |
self._progress.set_fraction(0.0) |
138 |
self._progress.set_text(_("Setting profile %s" % self._anaconda.profile)) |