diff options
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | installclass.py | 3 | ||||
-rw-r--r-- | installclasses/fedora.py | 17 | ||||
-rw-r--r-- | iw/task_gui.py | 99 | ||||
-rw-r--r-- | ui/tasksel.glade | 219 | ||||
-rw-r--r-- | yuminstall.py | 12 |
6 files changed, 278 insertions, 85 deletions
@@ -1,3 +1,16 @@ +2006-08-23 Jeremy Katz <katzj@redhat.com> + + * iw/task_gui.py: Rework so that we can enable/disable optional + repos per install class as well as see what repos have been added + * ui/tasksel.glade: Change things up a little bit + + * installclasses/fedora.py: Tweak description, add Extras as an + additional repo + + * yuminstall.py (AnacondaYum.doConfigSetup): Allow for additional, + not enabled by default repos to be set up. + * installclass.py (repos): Add not-default repos + 2006-08-22 Peter Jones <pjones@redhat.com> * isys/auditd.[ch]: A simple audit daemon that throws away all messages diff --git a/installclass.py b/installclass.py index 5518ebfa5..3443f4644 100644 --- a/installclass.py +++ b/installclass.py @@ -46,6 +46,9 @@ class BaseInstallClass: # list of of (txt, grplist) tuples for task selection screen tasks = [] + + # dict of repoid: (baseurl, mirrorurl) tuples for additional repos + repos = {} # don't select this class by default default = 0 diff --git a/installclasses/fedora.py b/installclasses/fedora.py index 159ae1361..248c82a77 100644 --- a/installclasses/fedora.py +++ b/installclasses/fedora.py @@ -4,18 +4,17 @@ from constants import * import os import iutil -# custom installs are easy :-) +import rpmUtils.arch + class InstallClass(BaseInstallClass): # name has underscore used for mnemonics, strip if you dont need it - id = "custom" + id = "fedora" name = N_("_Fedora") - pixmap = "custom.png" - description = N_("Select this installation type to gain complete " - "control over the installation process, including " - "software package selection and partitioning.") + description = N_("The default installation of %s includes a set of " + "software applicable for general internet usage. " + "What additional tasks would you like your system " + "to include support for?") %(productName,) sortPriority = 10000 - showLoginChoice = 1 - showMinimal = 1 if productName.startswith("Red Hat Enterprise"): hidden = 1 @@ -23,6 +22,8 @@ class InstallClass(BaseInstallClass): (N_("Software Development"), ["development-libs", "development-tools", "gnome-software-development", "x-software-development"],), (N_("Web server"), ["web-server"])] + repos = { "Fedora Extras": (None, "http://download.fedora.redhat.com/pub/fedora/linux/extras/development/%s" %(rpmUtils.arch.getBaseArch() ,)) } + def setInstallData(self, anaconda): BaseInstallClass.setInstallData(self, anaconda) BaseInstallClass.setDefaultPartitioning(self, anaconda.id.partitions, diff --git a/iw/task_gui.py b/iw/task_gui.py index 156965ee3..8345fe4c9 100644 --- a/iw/task_gui.py +++ b/iw/task_gui.py @@ -31,15 +31,20 @@ class TaskWindow(InstallWindow): else: self.dispatch.skipStep("group-selection", skip = 1) - for (txt, grps) in self.tasks: - if not self.taskcbs.has_key(txt): - continue - cb = self.taskcbs[txt] - if cb.get_active(): + tasks = self.xml.get_widget("taskList").get_model() + for (cb, task, grps) in tasks: + if cb: map(self.backend.selectGroup, grps) else: map(self.backend.deselectGroup, grps) + repos = self.xml.get_widget("repoList").get_model() + for (cb, repotxt, repo) in repos: + if cb: + repo.enable() + else: + repo.disable() + def groupsInstalled(self, lst): # FIXME: yum specific rc = False @@ -109,6 +114,8 @@ class TaskWindow(InstallWindow): try: self.backend.doRepoSetup(self.anaconda, reponame, fatalerrors = False) + s = self.xml.get_widget("repoList").get_model() + s.append([repo.isEnabled(), reponame, repo]) log.info("added repository %s with with source URL %s" % (reponame, repourl)) except yum.Errors.RepoError, e: self.intf.messageWindow(_("Error"), @@ -119,10 +126,71 @@ class TaskWindow(InstallWindow): type="ok", custom_icon="error") self.backend.ayum.repos.delete(reponame) continue + + if not repo.groups_added: + self.intf.messageWindow(_("Warning"), + _("Unable to find a group file for %s. " + "This will make manual selection of packages " + "from the repository not work") %(reponame,), + type="warning") + + break dialog.destroy() return rc + + def _toggled(self, data, row, store): + i = store.get_iter(int(row)) + val = store.get_value(i, 0) + store.set_value(i, 0, not val) + + def _createTaskStore(self): + store = gtk.ListStore(gobject.TYPE_BOOLEAN, + gobject.TYPE_STRING, + gobject.TYPE_PYOBJECT) + tl = self.xml.get_widget("taskList") + tl.set_model(store) + + cbr = gtk.CellRendererToggle() + col = gtk.TreeViewColumn('', cbr, active = 0) + cbr.connect("toggled", self._toggled, store) + tl.append_column(col) + + col = gtk.TreeViewColumn('Text', gtk.CellRendererText(), text = 1) + col.set_clickable(False) + tl.append_column(col) + + for (txt, grps) in self.tasks: + if not self.groupsExist(grps): + continue + store.append([self.groupsInstalled(grps), txt, grps]) + + return len(store) + + def _createRepoStore(self): + store = gtk.ListStore(gobject.TYPE_BOOLEAN, + gobject.TYPE_STRING, + gobject.TYPE_PYOBJECT) + tl = self.xml.get_widget("repoList") + tl.set_model(store) + + cbr = gtk.CellRendererToggle() + col = gtk.TreeViewColumn('', cbr, active = 0) + cbr.connect("toggled", self._toggled, store) + tl.append_column(col) + + col = gtk.TreeViewColumn('Text', gtk.CellRendererText(), text = 1) + col.set_clickable(False) + tl.append_column(col) + + for (repoid, uri) in self.repos.items(): + rid = repoid.replace(" ", "") + if not self.backend.ayum.repos.repos.has_key(rid): + continue + repo = self.backend.ayum.repos.repos[rid] + store.append([repo.isEnabled(), repoid, repo]) + def getScreen (self, anaconda): self.intf = anaconda.intf @@ -131,7 +199,7 @@ class TaskWindow(InstallWindow): self.anaconda = anaconda self.tasks = anaconda.id.instClass.tasks - self.taskcbs = {} + self.repos = anaconda.id.instClass.repos (self.xml, vbox) = gui.getGladeWidget("tasksel.glade", "taskBox") @@ -145,22 +213,13 @@ class TaskWindow(InstallWindow): else: self.xml.get_widget("customRadio").set_active(False) - found = False - for (txt, grps) in self.tasks: - if not self.groupsExist(grps): - continue - found = True - cb = gtk.CheckButton(_(txt)) - self.xml.get_widget("cbVBox").pack_start(cb) - if self.groupsInstalled(grps): - cb.set_active(True) - self.taskcbs[txt] = cb - - if not found: - self.xml.get_widget("mainLabel").hide() + if self._createTaskStore() == 0: self.xml.get_widget("cbVBox").hide() + self.xml.get_widget("mainLabel").hide() + + self._createRepoStore() if not anaconda.id.instClass.allowExtraRepos: - self.xml.get_widget("addRepoButton").hide() + self.xml.get_widget("addRepoBox").hide() self.xml.get_widget("addRepoButton").connect("clicked", self._addRepo) diff --git a/ui/tasksel.glade b/ui/tasksel.glade index 87ab560ed..3bb113a49 100644 --- a/ui/tasksel.glade +++ b/ui/tasksel.glade @@ -26,7 +26,7 @@ <property name="border_width">12</property> <property name="visible">True</property> <property name="homogeneous">False</property> - <property name="spacing">12</property> + <property name="spacing">18</property> <child> <widget class="GtkLabel" id="mainLabel"> @@ -60,18 +60,44 @@ <property name="spacing">6</property> <child> - <placeholder/> + <widget class="GtkScrolledWindow" id="taskSW"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + + <child> + <widget class="GtkTreeView" id="taskList"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="headers_visible">False</property> + <property name="rules_hint">False</property> + <property name="reorderable">False</property> + <property name="enable_search">False</property> + <property name="fixed_height_mode">False</property> + <property name="hover_selection">False</property> + <property name="hover_expand">False</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> </child> </widget> <packing> <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> + <property name="expand">True</property> + <property name="fill">True</property> </packing> </child> <child> - <widget class="GtkVBox" id="vbox3"> + <widget class="GtkVBox" id="customizeBox"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">6</property> @@ -150,71 +176,151 @@ <property name="fill">True</property> </packing> </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="pack_type">GTK_PACK_END</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="addReboBox"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">6</property> + + <child> + <widget class="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Please select any additional repositories that you want to use for software installation.</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">True</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkScrolledWindow" id="repoSW"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + + <child> + <widget class="GtkTreeView" id="repoList"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="headers_visible">False</property> + <property name="rules_hint">False</property> + <property name="reorderable">False</property> + <property name="enable_search">False</property> + <property name="fixed_height_mode">False</property> + <property name="hover_selection">False</property> + <property name="hover_expand">False</property> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> <child> - <widget class="GtkButton" id="addRepoButton"> + <widget class="GtkHButtonBox" id="hbuttonbox1"> <property name="visible">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> + <property name="layout_style">GTK_BUTTONBOX_START</property> + <property name="spacing">0</property> <child> - <widget class="GtkAlignment" id="alignment1"> + <widget class="GtkButton" id="addRepoButton"> <property name="visible">True</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xscale">0</property> - <property name="yscale">0</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> <child> - <widget class="GtkHBox" id="hbox2"> + <widget class="GtkAlignment" id="alignment1"> <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">2</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> <child> - <widget class="GtkImage" id="image1"> + <widget class="GtkHBox" id="hbox2"> <property name="visible">True</property> - <property name="stock">gtk-add</property> - <property name="icon_size">4</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> + <property name="homogeneous">False</property> + <property name="spacing">2</property> - <child> - <widget class="GtkLabel" id="label3"> - <property name="visible">True</property> - <property name="label" translatable="yes" context="yes">_Add additional software repositories</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> + <child> + <widget class="GtkImage" id="image1"> + <property name="visible">True</property> + <property name="stock">gtk-add</property> + <property name="icon_size">4</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Add additional software repositories</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> </child> </widget> </child> @@ -232,7 +338,6 @@ <property name="padding">0</property> <property name="expand">False</property> <property name="fill">False</property> - <property name="pack_type">GTK_PACK_END</property> </packing> </child> </widget> diff --git a/yuminstall.py b/yuminstall.py index c07662c09..267f83fbd 100644 --- a/yuminstall.py +++ b/yuminstall.py @@ -182,6 +182,7 @@ class AnacondaYumRepo(YumRepository): self.setAttribute(k, v) self.gpgcheck = False #self.gpgkey = "%s/RPM-GPG-KEY-fedora" % (method, ) + if uri and not mirrorlist: self.baseurl = [ uri ] elif mirrorlist and not uri: @@ -365,6 +366,17 @@ class AnacondaYum(YumSorter): repo.enable() self.repos.add(repo) + # add some additional not enabled by default repos. + # FIXME: this is a hack and should probably be integrated + # with the above + for (name, (uri, mirror)) in self.anaconda.id.instClass.repos.items(): + rid = name.replace(" ", "") + repo = AnacondaYumRepo(uri = uri, mirrorlist = mirror, + repoid=rid, root = root) + repo.disable() + self.repos.add(repo) + + if self.anaconda.isKickstart: for ksrepo in self.anaconda.id.ksdata.repoList: repo = AnacondaYumRepo(uri=ksrepo.baseurl, |