aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/GLIPortage.py')
-rw-r--r--src/GLIPortage.py23
1 files changed, 16 insertions, 7 deletions
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)