Test portageq and etc-update for bug #462412.
authorZac Medico <zmedico@gentoo.org>
Thu, 21 Mar 2013 00:38:28 +0000 (17:38 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 21 Mar 2013 00:38:28 +0000 (17:38 -0700)
bin/etc-update
pym/portage/tests/emerge/test_simple.py

index 347ba1a924fcd44452e8dc1b0678baad7236c01f..1a99231b7cd968f50382089db465b15d43009afb 100755 (executable)
@@ -620,7 +620,7 @@ while [[ -n $1 ]] ; do
 done
 ${SET_X} && set -x
 
-type portageq >/dev/null || die "missing portageq"
+type -P portageq >/dev/null || die "missing portageq"
 portage_vars=(
        CONFIG_PROTECT{,_MASK}
        PORTAGE_CONFIGROOT
@@ -630,7 +630,7 @@ portage_vars=(
        USERLAND
        NOCOLOR
 )
-eval $(portageq envvar -v ${portage_vars[@]})
+eval $(${PORTAGE_PYTHON:+"${PORTAGE_PYTHON}"} "$(type -P portageq)" envvar -v ${portage_vars[@]})
 export PORTAGE_TMPDIR
 SCAN_PATHS=${*:-${CONFIG_PROTECT}}
 
index 5c0d821e09b94e279be913c77e50eb50141451dc..fea8b73b6e927603e28bb9909fc8ed79291138a1 100644 (file)
@@ -7,7 +7,8 @@ import sys
 import portage
 from portage import os
 from portage import _unicode_decode
-from portage.const import PORTAGE_BIN_PATH, PORTAGE_PYM_PATH, USER_CONFIG_PATH
+from portage.const import (BASH_BINARY,
+       PORTAGE_BIN_PATH, PORTAGE_PYM_PATH, USER_CONFIG_PATH)
 from portage.process import find_binary
 from portage.tests import TestCase
 from portage.tests.resolver.ResolverPlayground import ResolverPlayground
@@ -175,6 +176,8 @@ pkg_preinst() {
                        os.path.join(PORTAGE_BIN_PATH, "emaint"))
                env_update_cmd = (portage_python, "-Wd",
                        os.path.join(PORTAGE_BIN_PATH, "env-update"))
+               etc_update_cmd = (BASH_BINARY,
+                       os.path.join(PORTAGE_BIN_PATH, "etc-update"))
                fixpackages_cmd = (portage_python, "-Wd",
                        os.path.join(PORTAGE_BIN_PATH, "fixpackages"))
                portageq_cmd = (portage_python, "-Wd",
@@ -198,6 +201,9 @@ pkg_preinst() {
 
                test_commands = (
                        env_update_cmd,
+                       portageq_cmd + ("envvar", "-v", "CONFIG_PROTECT", "EROOT",
+                               "PORTAGE_CONFIGROOT", "PORTAGE_TMPDIR", "USERLAND"),
+                       etc_update_cmd,
                        emerge_cmd + ("--version",),
                        emerge_cmd + ("--info",),
                        emerge_cmd + ("--info", "--verbose"),