|
Lines 189-195
Link Here
|
| 189 |
install_profile.set_grp_install(None, True, None) |
189 |
install_profile.set_grp_install(None, True, None) |
| 190 |
install_profile.set_install_stage(None, install_stage, None) |
190 |
install_profile.set_install_stage(None, install_stage, None) |
| 191 |
tarball_options = ("Use Local", "Specify URI") |
191 |
tarball_options = ("Use Local", "Specify URI") |
| 192 |
code, tarball_option = d.menu("Select a local stage " + install_stage + " tarball or manually specify a URI?", choices=dmenu_list_to_choices(tarball_options)) |
192 |
code, tarball_option = d.menu("Select a local stage " + install_stage + " tarball or manually specify a URI:", choices=dmenu_list_to_choices(tarball_options)) |
| 193 |
if code == DLG_OK: |
193 |
if code == DLG_OK: |
| 194 |
tarball_option = tarball_options[int(tarball_option)-1] |
194 |
tarball_option = tarball_options[int(tarball_option)-1] |
| 195 |
if tarball_option == "Use Local": |
195 |
if tarball_option == "Use Local": |
|
Lines 199-232
Link Here
|
| 199 |
local_tarballs.sort() |
199 |
local_tarballs.sort() |
| 200 |
code, stage_tarball = d.menu("Select a local tarball:", choices=dmenu_list_to_choices(local_tarballs)) |
200 |
code, stage_tarball = d.menu("Select a local tarball:", choices=dmenu_list_to_choices(local_tarballs)) |
| 201 |
if code != DLG_OK: return |
201 |
if code != DLG_OK: return |
|
|
202 |
stage_tarball = local_tarballs[int(stage_tarball)-1] |
| 202 |
else: |
203 |
else: |
| 203 |
d.msgbox("There don't seem to be any local tarballs available. Hit OK to manually specify a URI.") |
204 |
d.msgbox("There don't seem to be any local tarballs available. Hit OK to manually specify a URI.") |
| 204 |
tarball_option = "Specify URI" |
205 |
tarball_option = "Specify URI" |
| 205 |
if tarball_option != "Use Local": |
206 |
if tarball_option != "Use Local": |
| 206 |
code, stage_tarball = d.inputbox("Specify the stage tarball URI or local file:", init=install_profile.get_stage_tarball_uri()) |
207 |
code, stage_tarball = d.inputbox("Specify the stage tarball URI or local file:", init=install_profile.get_stage_tarball_uri()) |
| 207 |
|
|
|
| 208 |
try: |
208 |
try: |
| 209 |
if code == DLG_OK: install_profile.set_stage_tarball_uri(None, stage_tarball, None) |
209 |
if code == DLG_OK: |
|
|
210 |
if stage_tarball: install_profile.set_stage_tarball_uri(None, stage_tarball, None) |
| 211 |
else: d.msgbox("No URI was specified!") |
| 210 |
except: |
212 |
except: |
| 211 |
d.msgbox("The specified URI is invalid") |
213 |
d.msgbox("Specified URI is invalid!") |
|
|
214 |
#if d.yesno("The specified URI is invalid. Use it anyway?") == DLG_YES: install_profile.set_stage_tarball_uri(None, stage_tarball, None) |
| 212 |
|
215 |
|
| 213 |
def set_portage_tree(): |
216 |
def set_portage_tree(): |
| 214 |
# This section will ask whether to sync the tree, whether to use a snapshot, etc. |
217 |
# This section will ask whether to sync the tree, whether to use a snapshot, etc. |
| 215 |
menulist = ["Normal 'emerge sync'", "Webrsync (rsync is firewalled)", "None (snapshot or NFS mount)"] |
218 |
menulist = ["Normal 'emerge sync'", "Webrsync (rsync is firewalled)", "None (local snapshot or NFS mount)"] |
| 216 |
code, portage_tree_sync = d.menu("How do you want to sync the portage tree?", choices=dmenu_list_to_choices(menulist)) |
219 |
code, portage_tree_sync = d.menu("How do you want to sync the portage tree?", choices=dmenu_list_to_choices(menulist)) |
| 217 |
if code != DLG_OK: return |
220 |
if code != DLG_OK: return |
| 218 |
portage_tree_sync = menulist[int(portage_tree_sync)-1] |
221 |
portage_tree_sync = menulist[int(portage_tree_sync)-1] |
| 219 |
#FIX ME when python 2.4 comes out. |
222 |
#FIX ME when python 2.4 comes out. |
| 220 |
if portage_tree_sync == "Normal 'emerge sync'": install_profile.set_portage_tree_sync_type(None, "sync", None) |
223 |
if portage_tree_sync == "Normal 'emerge sync'": install_profile.set_portage_tree_sync_type(None, "sync", None) |
| 221 |
if portage_tree_sync == "Webrsync (rsync is firewalled)": install_profile.set_portage_tree_sync_type(None, "webrsync", None) |
224 |
if portage_tree_sync == "Webrsync (rsync is firewalled)": install_profile.set_portage_tree_sync_type(None, "webrsync", None) |
| 222 |
if portage_tree_sync == "None (snapshot or NFS mount)": install_profile.set_portage_tree_sync_type(None, "custom", None) |
225 |
if portage_tree_sync == "None (local snapshot or NFS mount)": |
| 223 |
if portage_tree_sync == "None (snapshot or NFS mount)": |
226 |
install_profile.set_portage_tree_sync_type(None, "custom", None) |
| 224 |
if d.yesno("Do you want to use a portage tree snapshot?") == DLG_YES: |
227 |
snapshot_options = ("Use Local", "Specify URI") |
|
|
228 |
code, snapshot_option = d.menu("Select a local portage snapshot or manually specify a location:", choices=dmenu_list_to_choices(snapshot_options)) |
| 229 |
snapshot_option = snapshot_options[int(snapshot_option)-1] |
| 230 |
if snapshot_option == "Use Local": |
| 231 |
snapshot_dir = "/mnt/cdrom/snapshots" |
| 232 |
if os.path.isdir(snapshot_dir) and os.listdir(stages_dir): |
| 233 |
local_snapshots = glob.glob(snapshot_dir + "/portage*.bz2") |
| 234 |
if len(local_snapshots) == 1: |
| 235 |
snapshot = local_snapshots[0] |
| 236 |
else: |
| 237 |
local_snapshots.sort() |
| 238 |
code, snapshot = d.menu("Select a local portage snapshot:", choices=dmenu_list_to_choices(local_snapshots)) |
| 239 |
if code != DLG_OK: return |
| 240 |
snapshot = local_snapshots[int(snapshot)-1] |
| 241 |
else: |
| 242 |
d.msgbox("There don't seem to be any local portage snapshots available. Hit OK to manually specify a URI.") |
| 243 |
snapshot_option = "Specify URI" |
| 244 |
if snapshot_option != "Use Local": |
| 225 |
code, snapshot = d.inputbox("Enter portage tree snapshot URI", init=install_profile.get_portage_tree_snapshot_uri()) |
245 |
code, snapshot = d.inputbox("Enter portage tree snapshot URI", init=install_profile.get_portage_tree_snapshot_uri()) |
| 226 |
try: |
246 |
try: |
| 227 |
if code == DLG_OK: install_profile.set_portage_tree_snapshot_uri(None, snapshot, None) |
247 |
if code == DLG_OK: |
| 228 |
except: |
248 |
if snapshot: install_profile.set_portage_tree_snapshot_uri(None, snapshot, None) |
| 229 |
d.msgbox("The specified URI is invalid") |
249 |
else: d.msgbox("No URI was specified!") |
|
|
250 |
except: |
| 251 |
d.msgbox("Specified URI is invalid!") |
| 252 |
#if d.yesno("The specified URI is invalid. Use it anyway?") == DLG_YES: install_profile.set_stage_tarball_uri(None, stage_tarball, None) |
| 230 |
|
253 |
|
| 231 |
def set_make_conf(): |
254 |
def set_make_conf(): |
| 232 |
# This section will be for setting things like CFLAGS, ACCEPT_KEYWORDS, and USE |
255 |
# This section will be for setting things like CFLAGS, ACCEPT_KEYWORDS, and USE |