diff options
author | Sebastian Luther <SebastianLuther@gmx.de> | 2010-08-12 13:55:55 +0200 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-08-12 05:34:19 -0700 |
commit | d89629ec27d01b601994fed512a76d6961a66a8e (patch) | |
tree | b8a508e8fa44ae720309ece76f4a2380c7523362 /pym/portage | |
parent | 0fdc6157b824b727fbcffb6c1ea28ba8b79ec9e4 (diff) | |
download | portage-d89629ec27d01b601994fed512a76d6961a66a8e.tar.gz portage-d89629ec27d01b601994fed512a76d6961a66a8e.tar.bz2 portage-d89629ec27d01b601994fed512a76d6961a66a8e.zip |
Tests: ResolverPlayground: create world file
Diffstat (limited to 'pym/portage')
-rw-r--r-- | pym/portage/tests/resolver/ResolverPlayground.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py index 947c5c7ca..d085b40d3 100644 --- a/pym/portage/tests/resolver/ResolverPlayground.py +++ b/pym/portage/tests/resolver/ResolverPlayground.py @@ -27,7 +27,7 @@ class ResolverPlayground(object): it's work. """ - def __init__(self, ebuilds={}, installed={}, profile={}): + def __init__(self, ebuilds={}, installed={}, profile={}, world=[]): """ ebuilds: cpv -> metadata mapping simulating avaiable ebuilds. installed: cpv -> metadata mapping simulating installed packages. @@ -43,6 +43,7 @@ class ResolverPlayground(object): self._create_ebuilds(ebuilds) self._create_installed(installed) self._create_profile(ebuilds, installed, profile) + self._create_world(world) self.settings, self.trees = self._load_config() @@ -183,6 +184,18 @@ class ResolverPlayground(object): os.makedirs(os.path.join(self.root, "etc")) os.symlink(sub_profile_dir, os.path.join(self.root, "etc", "make.profile")) + def _create_world(self, world): + #Create /var/lib/portage/world + var_lib_portage = os.path.join(self.root, "var", "lib", "portage") + os.makedirs(var_lib_portage) + + world_file = os.path.join(var_lib_portage, "world") + + f = open(world_file, "w") + for atom in world: + f.write("%s\n" % atom) + f.close() + def _load_config(self): env = { "ACCEPT_KEYWORDS": "x86", |