diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | TODO | 1 | ||||
-rw-r--r-- | src/GLIArchitectureTemplate.py | 13 | ||||
-rw-r--r-- | src/GLIGenDialog.py | 54 | ||||
-rw-r--r-- | src/GLIInstallProfile.py | 27 | ||||
-rwxr-xr-x | src/fe/dialog/gli-dialog.py | 5 |
6 files changed, 103 insertions, 5 deletions
@@ -1,10 +1,16 @@ # ChangeLog for Gentoo Linux Installer # Copyright 2005-2005 Gentoo Technologies, Inc. -# $Header: /var/cvsroot/gentoo/src/installer/ChangeLog,v 1.380 2005/09/17 03:45:35 agaffney Exp $ +# $Header: /var/cvsroot/gentoo/src/installer/ChangeLog,v 1.381 2005/09/17 21:15:59 codeman Exp $ *GLI-0.2 (4 Aug 2005) + 17 Sep 2005; Preston Cody <codeman@gentoo.org> + src/gli-dialog.py: added set_distcc to the list + GenDialog: added set_distcc. untested. + IP: added install_distcc flag. + AT: added install_distcc function based on the flag. runs after build_kernel + 16 Sep 2005; Andrew Gaffney <agaffney@gentoo.org> src/GLIUtility.py: add rot13ify() function @@ -20,7 +20,6 @@ Things still needing to be done for the BETA release: network mounts into the fstab gli-dialog: - fix install-packages unchecking/grp distcc support gtkFE: listed in fe/gtk/TODO diff --git a/src/GLIArchitectureTemplate.py b/src/GLIArchitectureTemplate.py index a334631..134da59 100644 --- a/src/GLIArchitectureTemplate.py +++ b/src/GLIArchitectureTemplate.py @@ -5,7 +5,7 @@ # of which can be found in the main directory of this project. Gentoo Linux Installer -$Id: GLIArchitectureTemplate.py,v 1.202 2005/09/05 07:57:06 agaffney Exp $ +$Id: GLIArchitectureTemplate.py,v 1.203 2005/09/17 21:15:59 codeman Exp $ The ArchitectureTemplate is largely meant to be an abstract class and an interface (yes, it is both at the same time!). The purpose of this is to create @@ -69,6 +69,7 @@ class ArchitectureTemplate: (self.set_timezone, "Setting timezone"), (self.emerge_kernel_sources, "Emerge kernel sources"), (self.build_kernel, "Building kernel"), + (self.install_distcc, "Install distcc"), (self.install_mta, "Installing MTA"), (self.install_logging_daemon, "Installing system logger"), (self.install_cron_daemon, "Installing Cron daemon"), @@ -815,6 +816,16 @@ class ArchitectureTemplate: self._logger.log("Custom kernel complete") ## + # Installs and starts up distccd if the user has it set, so that it will get used for the rest of the install + def install_distcc(self): + if self._install_profile.get_install_distcc(): + exitstatus = self._emerge("distcc") + if not GLIUtility.exitsuccess(exitstatus): + self._logger.log("ERROR! : Could not emerge distcc!") + else: + self._logger.log("distcc emerged.") + + ## # Installs mail MTA. Does not put into runlevel, as this is not simple with MTAs. def install_mta(self): # Get MTA info diff --git a/src/GLIGenDialog.py b/src/GLIGenDialog.py index c059c97..70d35ab 100644 --- a/src/GLIGenDialog.py +++ b/src/GLIGenDialog.py @@ -755,6 +755,60 @@ Please be patient while the screens load. It may take awhile."""), width=73, hei except: self._d.msgbox(_(u"ERROR! Could not set the make_conf correctly!")) + def set_distcc(self): + if self._d.yesno(_(u"Do you want to use distcc to compile your extra packages during the install and for future compilations as well?"), height=12, width=60) == self._DLG_YES: + #Add distcc to the services list. + if self._install_profile.get_services(): + services = self._install_profile.get_services() + if isinstance(services, str): + services = services.split(',') + else: + services = [] + if not "distccd" in services: + services.append("distccd") + try: + services = string.join(services, ',') + if services: + self._install_profile.set_services(None, services, None) + except: + self._d.msgbox(_(u"ERROR! Could not set the services list.")) + return + #Set the distcc flag to emerge earlier than other packages. + try: + self._install_profile.set_install_distcc(None, True, None) + except: + self._d.msgbox(_(u"ERROR! Could not set the install distcc flag!")) + return + + #Add distcc to the FEATURES in make.conf and add DISTCC_HOSTS too. + etc_files = self._install_profile.get_etc_files() + #load up the make.conf + if etc_files.has_key("make.conf"): + make_conf = etc_files['make.conf'] + else: + make_conf = {} + #Check for FEATURES and add if not already there. + if make_conf.has_key("FEATURES"): + if not "distcc" in make_conf['FEATURES']: + make_conf['FEATURES'] += " distcc" + else: + make_conf['FEATURES'] = "distcc" + #Now while still working in make.conf, figure out what HOSTS to set. + if make_conf.has_key("DISTCC_HOSTS"): + initval = make_conf['DISTCC_HOSTS'] + else: + initval = "localhost " + distcc_string = _(u"Enter the hosts to be used by distcc for compilation:\nExample: localhost 192.168.0.2 192.168.0.3:4000/10") + code, hosts = self._d.inputbox(distcc_string, width=75, init=initval) + if code != self._d.DLG_OK: + hosts = initval + make_conf['DISTCC_HOSTS'] = hosts + try: + etc_files['make.conf'] = make_conf + self._install_profile.set_etc_files(etc_files) + except: + self._d.msgbox(_(u"ERROR! Could not set the make_conf correctly!")) + def set_etc_portage(self): #This section will be for editing the /etc/portage/* files and other /etc/* files. This should be for advanced users only. etc_files = self._install_profile.get_etc_files() diff --git a/src/GLIInstallProfile.py b/src/GLIInstallProfile.py index 7fce347..d67e21b 100644 --- a/src/GLIInstallProfile.py +++ b/src/GLIInstallProfile.py @@ -5,7 +5,7 @@ # of which can be found in the main directory of this project. Gentoo Linux Installer -$Id: GLIInstallProfile.py,v 1.76 2005/09/03 06:57:08 codeman Exp $ +$Id: GLIInstallProfile.py,v 1.77 2005/09/17 21:15:59 codeman Exp $ The GLI module contains all classes used in the Gentoo Linux Installer (or GLI). The InstallProfile contains all information related to the new system to be @@ -90,6 +90,7 @@ class InstallProfile: self._etc_files = {} self._temp_etc_file = {} self._dynamic_stage3 = False + self._install_distcc = False self.xmldoc = "" # Parser handler calls. For each XML attribute and children of that attribute, a handler is needed. @@ -108,6 +109,7 @@ class InstallProfile: self._parser.addHandler('gli-profile/grp-install', self.set_grp_install) self._parser.addHandler('gli-profile/hostname', self.set_hostname) self._parser.addHandler('gli-profile/http-proxy', self.set_http_proxy) + self._parser.addHandler('gli-profile/install-distcc', self.set_install_distcc) self._parser.addHandler('gli-profile/install-packages', self.set_install_packages) self._parser.addHandler('gli-profile/install-pcmcia-cs', self.set_install_pcmcia_cs) self._parser.addHandler('gli-profile/install-rp-pppoe', self.set_install_rp_pppoe) @@ -157,6 +159,7 @@ class InstallProfile: 'grp-install': self.get_grp_install, 'hostname': self.get_hostname, 'http-proxy': self.get_http_proxy, + 'install-distcc': self.get_install_distcc, 'install-pcmcia-cs': self.get_install_pcmcia_cs, 'install-rp-pppoe': self.get_install_rp_pppoe, 'install-stage': self.get_install_stage, @@ -524,6 +527,28 @@ class InstallProfile: return self._http_proxy ############################################################################ + #### Install Distcc + + ## + # This tells the installer whether or not to install the distcc package + # @param xml_path Used internally by the XML parser. Should be None when calling directly + # @param install_distcc boolean + # @param xml_attr Parameter description + def set_install_distcc(self, xml_path, install_distcc, xml_attr): + if type(install_distcc) != bool: + if type(install_distcc) == str: + install_distcc = GLIUtility.strtobool(install_distcc) + else: + raise GLIException("InstallDistcc", 'fatal', 'set_install_distcc', "Input must be type 'bool'!") + + self._install_distcc = install_distcc + + ## + # Returns the boolean _install_distcc + def get_install_distcc(self): + return self._install_distcc + + ############################################################################ #### Install Packages ## diff --git a/src/fe/dialog/gli-dialog.py b/src/fe/dialog/gli-dialog.py index d781ae5..062ea92 100755 --- a/src/fe/dialog/gli-dialog.py +++ b/src/fe/dialog/gli-dialog.py @@ -42,6 +42,8 @@ class Setup_InstallProfile(GLIGenIP): self.set_install_stage() self.set_portage_tree() self.set_make_conf() + if advanced_mode: + self.set_distcc() self.set_kernel() self.set_boot_loader() self.set_timezone() @@ -68,6 +70,7 @@ class Setup_InstallProfile(GLIGenIP): { 'text': "Install Stage", 'fn': self.set_install_stage }, { 'text': "Portage Tree", 'fn': self.set_portage_tree }, { 'text': "make.conf", 'fn': self.set_make_conf }, + { 'text': "distcc", 'fn': self.set_distcc }, { 'text': "etc/portage/*", 'fn': self.set_etc_portage }, { 'text': "Kernel", 'fn': self.set_kernel }, { 'text': "Bootloader", 'fn': self.set_boot_loader }, @@ -77,7 +80,7 @@ class Setup_InstallProfile(GLIGenIP): { 'text': "Logging daemon", 'fn': self.set_logger }, { 'text': "Extra packages", 'fn': self.set_extra_packages }, { 'text': "Services", 'fn': self.set_services }, - { 'text': "Config Settings", 'fn': self.set_rc_conf }, + { 'text': "Configuration Settings", 'fn': self.set_rc_conf }, { 'text': "Root password", 'fn': self.set_root_password }, { 'text': "Additional Users", 'fn': self.set_additional_users }) self._menu_list = [] |