diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/GLIArchitectureTemplate.py | 8 | ||||
-rw-r--r-- | src/GLIPortage.py | 23 | ||||
-rwxr-xr-x | src/fe/dialog/gli-dialog.py | 3 |
4 files changed, 25 insertions, 15 deletions
@@ -2,6 +2,12 @@ # Copyright 2005-2008 Gentoo Foundation; Distributed under the GPL v2 # $Id: $ + 28 Feb 2008; Andrew Gaffney <agaffney@gentoo.org> + src/GLIArchitectureTemplate.py, src/GLIPortage.py, + src/fe/dialog/gli-dialog.py: + Switch to running vdb_to_fake_binrepo.py instead of reading systempkgs.txt + remove all references to systempkgs.txt + 28 Feb 2008; Andrew Gaffney <agaffney@gentoo.org> -src/runtimedeps.py, +src/vdb_to_fake_binrepo.py: Add vdb_to_fake_binrepo.py script from the always awesome zmedico 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")]) |