From 1af0c40b1300651ca03a7509f49f152c1e595736 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 1 Nov 2011 19:17:19 -0700 Subject: Add EPREFIX and ED support in all ebuild helpers. This allows our prefix tests to use helpers like insinto, doins, and dosym. --- pym/portage/tests/emerge/test_simple.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'pym') diff --git a/pym/portage/tests/emerge/test_simple.py b/pym/portage/tests/emerge/test_simple.py index 7ed679d62..d108959ca 100644 --- a/pym/portage/tests/emerge/test_simple.py +++ b/pym/portage/tests/emerge/test_simple.py @@ -36,11 +36,10 @@ pkg_pretend() { 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} || die - echo "blah blah blah" > "${ED}"/usr/lib/${P}/regular-file || die - ln -s regular-file "${ED}"/usr/lib/${P}/symlink || die + insinto /usr/lib/${P} + echo "blah blah blah" > "${T}"/regular-file + doins "${T}"/regular-file + dosym regular-file /usr/lib/${P}/symlink || die # Test code for bug #381629, using a copyright symbol encoded with latin-1. # We use $(printf "\\xa9") rather than $'\\xa9', since printf apparently @@ -48,10 +47,11 @@ src_install() { # some conditions. TODO: Find out why it transforms to \\xef\\xbf\\xbd when # running tests for Python 3.2 (even though it's bash that is ultimately # responsible for performing the transformation). - local latin_1_dir=${ED}/usr/lib/${P}/latin-1-$(printf "\\xa9")-directory - mkdir "${latin_1_dir}" - echo "blah blah blah" > ${latin_1_dir}/latin-1-$(printf "\\xa9")-regular-file || die - ln -s latin-1-$(printf "\\xa9")-regular-file ${latin_1_dir}/latin-1-$(printf "\\xa9")-symlink || die + local latin_1_dir=/usr/lib/${P}/latin-1-$(printf "\\xa9")-directory + insinto "${latin_1_dir}" + echo "blah blah blah" > "${T}"/latin-1-$(printf "\\xa9")-regular-file || die + doins "${T}"/latin-1-$(printf "\\xa9")-regular-file + dosym latin-1-$(printf "\\xa9")-regular-file ${latin_1_dir}/latin-1-$(printf "\\xa9")-symlink || die } pkg_config() { @@ -80,6 +80,11 @@ pkg_info() { "LICENSE": "GPL-2", "MISC_CONTENT": install_something, }, + "virtual/foo-0": { + "EAPI" : "4", + "KEYWORDS": "x86", + "LICENSE": "GPL-2", + }, } installed = { @@ -201,6 +206,7 @@ pkg_info() { emerge_cmd + ("--metadata",), emerge_cmd + ("--metadata",), rm_cmd + ("-rf", cachedir), + emerge_cmd + ("--oneshot", "virtual/foo"), emerge_cmd + ("--pretend", "dev-libs/A"), ebuild_cmd + (test_ebuild, "manifest", "clean", "package", "merge"), emerge_cmd + ("--pretend", "--tree", "--complete-graph", "dev-libs/A"), -- cgit v1.2.3-1-g7c22