diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2015-07-07 13:37:44 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2015-07-07 13:37:44 -0400 |
commit | 30f4ddbe60d505bc2ff8e1b2d135e95a8049997f (patch) | |
tree | a46d5a02b86716a513b148632ccb055b90e938ca /scripts/cycle.1.py | |
parent | scripts/cycle.1.py: fix shebang. (diff) | |
download | grs-30f4ddbe60d505bc2ff8e1b2d135e95a8049997f.tar.gz grs-30f4ddbe60d505bc2ff8e1b2d135e95a8049997f.tar.bz2 grs-30f4ddbe60d505bc2ff8e1b2d135e95a8049997f.zip |
scripts/cycle.1.py: emerge list of pkgs for stage1.
Diffstat (limited to 'scripts/cycle.1.py')
-rw-r--r-- | scripts/cycle.1.py | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/scripts/cycle.1.py b/scripts/cycle.1.py index 5a1e548..2534c25 100644 --- a/scripts/cycle.1.py +++ b/scripts/cycle.1.py @@ -1,11 +1,42 @@ #!/usr/bin/python3.4 +import os +import re + from portage import settings from grs.Execute import Execute +def scan_profile_stack(pfile): + datoms = [] + for profile in portage.settings.profiles: + fpath = os.path.join(profile, pfile) + datoms.append(portage.grabfile_package(fpath)) + atoms = [] + for d in portage.stack_lists(datoms, incremental=1): + m = re.search('^\*?(.*)', d) + atoms.append(m.group(1)) + return atoms + + +def get_blist(): + plist = scan_profile_stack('packages') + blist = scan_profile_stack('packages.build') + for p in plist: + try: + i = blist.index(portage.dep_getkey(p)) + blist[i] = p + except ValueError: + pass + return ' '.join(blist) + + use_flags = '-* bindist build %s' % settings['BOOTSTRAP_USE'] subchroot = '/tmp/stage1root' cpu_flags = 'mmx sse sse2' emerge_env = { 'USE' : use_flags, 'ROOT' : subchroot, 'CPU_FLAGS_X86' : cpu_flags } + cmd = 'emerge -bkNu1q sys-apps/baselayout' -Execute(cmd, timeout=600, extra_env=emerge_env) +Execute(cmd, timeout=None, extra_env=emerge_env) + +cmd = 'emerge -bkNu1q %s' % get_blist() +Execute(cmd, timeout=None, extra_env=emerge_env) |