diff options
author | Zac Medico <zmedico@gentoo.org> | 2019-11-16 01:53:05 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2019-11-16 01:53:56 -0800 |
commit | c5f9cbdc45be302a04bda52612d12a891667103c (patch) | |
tree | e1c48f65de359012dcfb84228f6b56504d30d5f6 | |
parent | Binpkg: use aux_get for check_missing_metadata (diff) | |
download | portage-c5f9cbdc45be302a04bda52612d12a891667103c.tar.gz portage-c5f9cbdc45be302a04bda52612d12a891667103c.tar.bz2 portage-c5f9cbdc45be302a04bda52612d12a891667103c.zip |
ResolverPlayground: create installed ebuild + environment.bz2
Signed-off-by: Zac Medico <zmedico@gentoo.org>
-rw-r--r-- | lib/portage/tests/resolver/ResolverPlayground.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/portage/tests/resolver/ResolverPlayground.py b/lib/portage/tests/resolver/ResolverPlayground.py index 22d54e251..3d48c244f 100644 --- a/lib/portage/tests/resolver/ResolverPlayground.py +++ b/lib/portage/tests/resolver/ResolverPlayground.py @@ -1,6 +1,7 @@ # Copyright 2010-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +import bz2 from itertools import permutations import fnmatch import sys @@ -332,6 +333,17 @@ class ResolverPlayground(object): with open(os.path.join(vdb_pkg_dir, k), "w") as f: f.write("%s\n" % v) + ebuild_path = os.path.join(vdb_pkg_dir, a.cpv.split("/")[1] + ".ebuild") + with open(ebuild_path, "w") as f: + f.write('EAPI="%s"\n' % metadata.pop('EAPI', '0')) + for k, v in metadata.items(): + f.write('%s="%s"\n' % (k, v)) + + env_path = os.path.join(vdb_pkg_dir, 'environment.bz2') + with bz2.BZ2File(env_path, mode='w') as f: + with open(ebuild_path, 'rb') as inputfile: + f.write(inputfile.read()) + def _create_profile(self, ebuilds, installed, profile, repo_configs, user_config, sets): user_config_dir = os.path.join(self.eroot, USER_CONFIG_PATH) |