From 5a9f07e1ba7727457a115ea98e7101853a87b2b8 Mon Sep 17 00:00:00 2001 From: Andrew Gaffney Date: Thu, 28 Feb 2008 03:18:58 +0000 Subject: Switch to running vdb_to_fake_binrepo.py instead of reading systempkgs.txt remove all references to systempkgs.txt git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/gli/trunk@1886 f8877401-5920-0410-a79b-8e2d7e04ca0d --- src/GLIArchitectureTemplate.py | 8 ++------ src/GLIPortage.py | 23 ++++++++++++++++------- src/fe/dialog/gli-dialog.py | 3 +-- 3 files changed, 19 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/GLIArchitectureTemplate.py b/src/GLIArchitectureTemplate.py index 5154d43..00e1b6b 100644 --- a/src/GLIArchitectureTemplate.py +++ b/src/GLIArchitectureTemplate.py @@ -395,14 +395,10 @@ class ArchitectureTemplate: os.makedirs(self._chroot_dir) if self._install_profile.get_install_stage() == 3 and self._install_profile.get_dynamic_stage3(): # stage3 generation code here - if not GLIUtility.is_file("/usr/livecd/systempkgs.txt"): - raise GLIException("CreateStage3Error", "fatal", "unpack_stage_tarball", "Required file /usr/livecd/systempkgs.txt does not exist") try: - syspkgs = open("/usr/livecd/systempkgs.txt", "r") - systempkgs = [line for line in syspkgs.readlines() if line.strip()] - syspkgs.close() + systempkgs = self._portage.get_system_packages() except: - raise GLIException("CreateStage3Error", "fatal", "unpack_stage_tarball", "Could not open /usr/livecd/systempkgs.txt") + raise GLIException("CreateStage3Error", "fatal", "unpack_stage_tarball", "Could not generate list of system packages") # Pre-create /lib (and possibly /lib32 and /lib64) for libdir in ("/lib", "/usr/lib"): diff --git a/src/GLIPortage.py b/src/GLIPortage.py index 29b8fd4..d66a513 100644 --- a/src/GLIPortage.py +++ b/src/GLIPortage.py @@ -310,6 +310,20 @@ class GLIPortage(object): for package in packages: self.add_pkg_to_world(package) + def create_binpkg_repo_from_vdb(self): + if not os.path.exists("/tmp/fake_binpkg"): + try: + os.mkdir("/tmp/fake_binpkg") + except: + raise GLIException("VDBToBinpkgError", "fatal", "create_binpkg_repo_from_vdb", "Could not not create /tmp/fake_binpkg!") + status = GLIUtility.spawn("PKGDIR=/tmp/fake_binpkg ../../vdb_to_fake_binrepo.py", logfile=self._compile_logfile, append_log=True) + if not GLIUtility.exitsuccess(status): + raise GLIException("VDBToBinpkgError", "fatal", "create_binpkg_repo_from_vdb", "Failure while running vdb_to_fake_binrepo.py") + + def get_system_packages(self): + self.create_binpkg_repo_from_vdb() + systempkgs = GLIUtility.spawn(r"PKGDIR=/tmp/fake_binpkg emerge -eqKp system | grep -e '^\[binary' | sed -e 's:^\[binary .\+\] ::' -e 's: .\+$::'", return_output=True)[1].strip().split("\n") + return systempkgs def usage(progname): print """ @@ -357,15 +371,10 @@ if __name__ == "__main__": gliportage = GLIPortage(chroot_dir, True, None, False, None, None) if mode == "stage3": - if not GLIUtility.is_file("/usr/livecd/systempkgs.txt"): - print "Required file /usr/livecd/systempkgs.txt does not exist!" - sys.exit(1) try: - syspkgs = open("/usr/livecd/systempkgs.txt", "r") - systempkgs = syspkgs.readlines() - syspkgs.close() + systempkgs = gliportage.get_system_packages() except: - print "Could not open /usr/livecd/systempkgs.txt!" + print "Could not open generate list of system packages!" sys.exit(1) # Pre-create /lib (and possible /lib32 and /lib64) diff --git a/src/fe/dialog/gli-dialog.py b/src/fe/dialog/gli-dialog.py index 473974c..dc8bd93 100755 --- a/src/fe/dialog/gli-dialog.py +++ b/src/fe/dialog/gli-dialog.py @@ -676,8 +676,7 @@ Press OK to continue""") self._install_profile.set_install_stage(None, install_stage, None) except: self._d.msgbox(_(u"ERROR! Could not set install stage!")) - has_systempkgs = GLIUtility.is_file("/usr/livecd/systempkgs.txt") - if install_stage == "3" and has_systempkgs: + if install_stage == "3": #Change the Yes/No buttons to new labels for this question. self._d.add_persistent_args(["--yes-label", _(u"Create from CD")]) self._d.add_persistent_args(["--no-label", _(u"Specify URI")]) -- cgit v1.2.3-65-gdbad