From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QfBRS-0007fm-TV for garchives@archives.gentoo.org; Fri, 08 Jul 2011 13:50:03 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B6CAE21C022; Fri, 8 Jul 2011 13:49:55 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 75BFE21C022 for ; Fri, 8 Jul 2011 13:49:55 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id AAF052AC0E1 for ; Fri, 8 Jul 2011 13:49:54 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 0F6B18003D for ; Fri, 8 Jul 2011 13:49:54 +0000 (UTC) From: "Wiktor W Brodlo" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Wiktor W Brodlo" Message-ID: Subject: [gentoo-commits] proj/anaconda:master commit in: /, iw/, gentoo/ X-VCS-Repository: proj/anaconda X-VCS-Files: anaconda gentoo/livecd.py gentoo/utils.py iw/use_gui.py X-VCS-Directories: / iw/ gentoo/ X-VCS-Committer: wiktor X-VCS-Committer-Name: Wiktor W Brodlo X-VCS-Revision: e79eb78ccd31c5423e7712a9c1835fdc5b88440f Date: Fri, 8 Jul 2011 13:49:54 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: f6e0721231144cd927a96e430bb46690 commit: e79eb78ccd31c5423e7712a9c1835fdc5b88440f Author: wiktor w brodlo brodlo net> AuthorDate: Fri Jul 8 13:49:24 2011 +0000 Commit: Wiktor W Brodlo brodlo net> CommitDate: Fri Jul 8 13:49:24 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/anaconda.git;= a=3Dcommit;h=3De79eb78c Write /etc/make.conf --- anaconda | 1 + gentoo/livecd.py | 1 + gentoo/utils.py | 184 ++++++++++--------------------------------------= ------ iw/use_gui.py | 17 +++++ 4 files changed, 52 insertions(+), 151 deletions(-) diff --git a/anaconda b/anaconda index 6c8fb37..329d92c 100755 --- a/anaconda +++ b/anaconda @@ -510,6 +510,7 @@ class Anaconda(object): self.upgrade =3D flags.cmdline.has_key("preupgrade") self.upgradeRoot =3D None self.upgradeSwapInfo =3D None + self.use_flags =3D [] self._users =3D None =20 # *sigh* we still need to be able to write this out diff --git a/gentoo/livecd.py b/gentoo/livecd.py index 7a3acff..148967b 100644 --- a/gentoo/livecd.py +++ b/gentoo/livecd.py @@ -118,6 +118,7 @@ class LiveCDCopyBackend(backend.AnacondaBackend): # Now copy the portage tree self._gentoo_install.copy_portage() self._gentoo_install.set_profile() + self._gentoo_install.write_makeconf() self._gentoo_install.install_setup_tools() =20 self._gentoo_install.setup_users() diff --git a/gentoo/utils.py b/gentoo/utils.py index b2b4403..2c8e171 100644 --- a/gentoo/utils.py +++ b/gentoo/utils.py @@ -1012,6 +1012,39 @@ class GentooInstall: self.spawn_chroot("eselect profile set "+self._anaconda.profile) self._progress.set_fraction(1.0) =20 + def write_makeconf(self): + text =3D self.makeconf_factory(self._anaconda, os.environ["ANACO= NDA_PRODUCTARCH"]) + makeconf =3D open(self._root+"/etc/make.conf", "w") + makeconf.write(text) + =20 + def makeconf_factory(self, settings, arch): + cflags =3D ("-march=3D%s -O%s", settings.makeconf_march, setting= s.makeconf_opt) + if settings.makeconf_pipe: + cflags +=3D " -pipe" + cflags =3D ("CFLAGS=3D\"%s\"", cflags) + =20 + cxxflags =3D "CXXFLAGS=3D\"${CFLAGS}\"" + =20 + if arch =3D=3D "amd64" + arch =3D "x86_64" + chost =3D ("CHOST=3D\"%s-pc-linux-gnu\"", arch) + =20 + if settings.makeconf_jobs =3D=3D 0: + makeopts =3D "-j" + else: + makeopts =3D ("-j%i", settings.makeconf_jobs) + if settings.makeconf_load > 0: + makeopts +=3D (" -l%i", settings.makeconf_jobs) + if settings.makeconf_silent: + makeopts +=3D " -s" + makeopts =3D ("MAKEOPTS=3D\"%s\"", makeopts) + =20 + gentoo_mirrors =3D ("GENTOO_MIRRORS=3D\"%s\"", " ".join(settings= .mirrors)) + sync =3D ("SYNC=3D\"%s\"", " ".join(settings.mirrors_sync)) + use =3D ("USE=3D\"%s\"", " ".join(settings.use_flags)) + =20 + return "\n".join([cflags, cxxflags, chost, makeopts, gentoo_mirr= ors, sync, use]) + =20 def _get_langpacks(self): return None =20 @@ -1021,154 +1054,3 @@ class GentooInstall: def_lang_2 =3D def_lang.split("_")[0] langs =3D [def_lang, def_lang_2] return set(langs) - - #def _get_removable_localized_packages(self): - # langpacks =3D self._get_langpacks() - # get cur lang - # langs =3D self.__get_langs() - - # new_langpacks =3D set() - # for langpack in langpacks: - # found =3D False - # for lang in langs: - # if langpack.endswith("-%s" % (lang,)): - # found =3D True - # break - # if not found: - # new_langpacks.add(langpack) - # langpacks =3D new_langpacks - - # client_repo =3D self._entropy.installed_repository() - # for langpack in langpacks: - # matches, m_rc =3D client_repo.atomMatch(langpack, multiMatc= h =3D True) - # if m_rc !=3D 0: - # continue - # for pkg_id in matches: - # valid =3D self._entropy.validate_package_removal(pkg_id= ) - # if not valid: - # continue - # yield pkg_id - - #def _get_installable_language_packs(self): - # """ - # Return a list of packages not available on the CD/DVD that - # could be downloaded and installed. - # """ - # langpacks =3D self._get_langpacks() - # # get cur lang - # langs =3D self.__get_langs() - - # new_langpacks =3D set() - # for langpack in langpacks: - # found =3D False - # for lang in langs: - # if langpack.endswith("-%s" % (lang,)): - # found =3D True - # break - # if found: - # new_langpacks.add(langpack) - # langpacks =3D new_langpacks - - # filter out unwanted packages - # see gentoo.const - - # client_repo =3D self._entropy.installed_repository() - - # KDE - # matches, m_rc =3D client_repo.atomMatch("kde-base/kdebase-start= kde") - # if m_rc !=3D 0: - # remove kde* packages - # langpacks =3D [x for x in langpacks if x.find("kde") =3D=3D= -1] - - # Openoffice - # matches, m_rc =3D client_repo.atomMatch("openoffice") - # if m_rc !=3D 0: - # remove openoffice* packages - # langpacks =3D [x for x in langpacks if x.find("openoffice")= =3D=3D -1] - - # aspell - # matches, m_rc =3D client_repo.atomMatch("aspell") - # if m_rc !=3D 0: - # remove aspell* packages - # langpacks =3D [x for x in langpacks if x.find("aspell") =3D= =3D -1] - - # man-pages - # matches, m_rc =3D client_repo.atomMatch("man-pages") - # if m_rc !=3D 0: - # remove man-pages* packages - # langpacks =3D [x for x in langpacks if x.find("man-pages") = =3D=3D -1] - - # packs =3D [] - # for langpack in langpacks: - # matches, m_rc =3D client_repo.atomMatch(langpack) - # if m_rc !=3D 0: - # packs.append(langpack) - # return packs - - #def _setup_packages_to_remove(self): - - # remove anaconda if installed - # client_repo =3D self._entropy.installed_repository() - # pkgs_rm =3D ["app-admin/anaconda", "app-misc/anaconda-runtime", - # "app-misc/anaconda-runtime-gui", "libselinux", "sys-process= /audit"] - # for pkg_name in pkgs_rm: - # pkg_id, pkg_rc =3D client_repo.atomMatch(pkg_name) - # if pkg_id !=3D -1: - # self._package_identifiers_to_remove.add(pkg_id) - - # localized_pkgs =3D self._get_removable_localized_packages() - # if localized_pkgs: - # question_text =3D _("This medium contains many extra langua= ges, " - # "would you like to keep them installed?") - # buttons =3D [_("Yes"), _("No")] - # answer =3D self._intf.messageWindow(_("Language packs insta= llation"), - # question_text, custom_icon=3D"question", type=3D"custom= ", - # custom_buttons =3D buttons) - # if answer =3D=3D 1: - # self._package_identifiers_to_remove.update(localized_pk= gs) - - # if self._package_identifiers_to_remove: - - # current_counter =3D 0 - # total_counter =3D len(self._package_identifiers_to_remove) - # self._progress.set_fraction(current_counter) - # self._progress.set_text(_("Generating list of files to copy= ")) - - # for pkg in self._package_identifiers_to_remove: - # current_counter +=3D 1 - # self._progress.set_fraction( - # float(current_counter)/total_counter) - # # get its files - # mycontent =3D self._live_repo.retrieveContent(pkg, - # extended =3D True) - # mydirs =3D [x[0] for x in mycontent if x[1] =3D=3D "dir= "] - # for x in mydirs: - # if x.find("/usr/lib64") !=3D -1: - # x =3D x.replace("/usr/lib64","/usr/lib") - # elif x.find("/lib64") !=3D -1: - # x =3D x.replace("/lib64","/lib") - # self._add_file_to_ignore(x, "dir") - # mycontent =3D [x[0] for x in mycontent if x[1] =3D=3D "= obj"] - # for x in mycontent: - # if x.find("/usr/lib64") !=3D -1: - # x =3D x.replace("/usr/lib64","/usr/lib") - # elif x.find("/lib64") !=3D -1: - # x =3D x.replace("/lib64","/lib") - # self._add_file_to_ignore(x, "obj") - # del mycontent - - # self._progress.set_fraction(1) - - # if hasattr(self._files_db, "commit"): - # self._files_db.commit() - # else: - # self._files_db.commitChanges() - # if hasattr(self._files_db, "setIndexing"): - # self._files_db.setIndexing(True) - # else: - # self._files_db.indexing =3D True - # self._files_db.createAllIndexes() - - #def _add_file_to_ignore(self, f_path, ctype): - # self._files_db._cursor().execute( - # 'INSERT into content VALUES (?,?,?)' , ( None, f_path, ctyp= e, )) diff --git a/iw/use_gui.py b/iw/use_gui.py index 8fcb199..b3bf64b 100644 --- a/iw/use_gui.py +++ b/iw/use_gui.py @@ -37,7 +37,22 @@ import gettext _ =3D lambda x: gettext.ldgettext("anaconda", x) =20 class UseWindow(InstallWindow): +=09 + buttons =3D [] + use_profile =3D [] +=09 def getNext(self): + use =3D [] + for button in self.buttons: + if button.get_property("active"): + use.append(button.get_property("label")) + =09 + for flag in use: + if flag not in use_profile: # flag enabled by user, disabled by profi= le + self.anaconda.use_flags.append(flag) + for flag in use_profile: + if flag not in use: # flag is disabled by user, enabled by profile + self.anaconda.use_flags.append("-"+flag) return None =20 def getScreen(self, anaconda): @@ -85,6 +100,8 @@ class UseWindow(InstallWindow): =09 table.attach(cb, 0, 1, rows, rows+1, gtk.FILL) table.attach(l, 1, 2, rows, rows+1) + =09 + self.buttons.append(cb) =09 self.use_profile =3D use_enabled =20