diff options
-rw-r--r-- | pym/portage/tests/emerge/test_simple.py | 15 | ||||
-rw-r--r-- | pym/portage/tests/resolver/ResolverPlayground.py | 3 |
2 files changed, 18 insertions, 0 deletions
diff --git a/pym/portage/tests/emerge/test_simple.py b/pym/portage/tests/emerge/test_simple.py index f1a1df63c..99fc96cba 100644 --- a/pym/portage/tests/emerge/test_simple.py +++ b/pym/portage/tests/emerge/test_simple.py @@ -17,12 +17,24 @@ class SimpleEmergeTestCase(TestCase): def testSimple(self): + install_something = """ +S="${WORKDIR}" +src_install() { + einfo "installing something..." + # TODO: Add prefix support to shell code/helpers, so we + # can use things like dodir and doins here. + mkdir -p "${ED}"/usr/lib/${P} + echo "blah blah blah" > "${ED}"/usr/lib/${P}/regular-file +} +""" + ebuilds = { "dev-libs/A-1": { "EAPI" : "4", "IUSE" : "+flag", "KEYWORDS": "x86", "LICENSE": "GPL-2", + "MISC_CONTENT": install_something, "RDEPEND": "flag? ( dev-libs/B[flag] )", }, "dev-libs/B-1": { @@ -30,6 +42,7 @@ class SimpleEmergeTestCase(TestCase): "IUSE" : "+flag", "KEYWORDS": "x86", "LICENSE": "GPL-2", + "MISC_CONTENT": install_something, }, } @@ -122,6 +135,8 @@ class SimpleEmergeTestCase(TestCase): "INFOPATH" : "", "PATH" : path, "PORTAGE_GRPNAME" : os.environ["PORTAGE_GRPNAME"], + "PORTAGE_INST_GID" : str(portage.data.portage_gid), + "PORTAGE_INST_UID" : str(portage.data.portage_uid), "PORTAGE_TMPDIR" : portage_tmpdir, "PORTAGE_USERNAME" : os.environ["PORTAGE_USERNAME"], "PORTDIR" : portdir, diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py index f41126bb7..28567b3d7 100644 --- a/pym/portage/tests/resolver/ResolverPlayground.py +++ b/pym/portage/tests/resolver/ResolverPlayground.py @@ -120,6 +120,7 @@ class ResolverPlayground(object): rdepend = metadata.pop("RDEPEND", None) pdepend = metadata.pop("PDEPEND", None) required_use = metadata.pop("REQUIRED_USE", None) + misc_content = metadata.pop("MISC_CONTENT", None) if metadata: raise ValueError("metadata of ebuild '%s' contains unknown keys: %s" % (cpv, metadata.keys())) @@ -152,6 +153,8 @@ class ResolverPlayground(object): f.write('PDEPEND="' + str(pdepend) + '"\n') if required_use is not None: f.write('REQUIRED_USE="' + str(required_use) + '"\n') + if misc_content is not None: + f.write(misc_content) f.close() def _create_ebuild_manifests(self, ebuilds): |