aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-12-03 22:15:50 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-12-03 22:15:50 +0000
commit296b3ad3a3663a841a4575527b93e170f06e04eb (patch)
treeaf810d0e113204b7a0d9f4c23e519c3c8d44528e
parent0807dedf5e633eb31d42b978eb34151009806e35 (diff)
downloadpaludis-296b3ad3a3663a841a4575527b93e170f06e04eb.tar.gz
paludis-296b3ad3a3663a841a4575527b93e170f06e04eb.tar.xz
Make tests work as root. Really this time.
-rw-r--r--paludis/repositories/e/Makefile.am1
-rw-r--r--paludis/repositories/e/ebuild.cc4
-rw-r--r--src/clients/paludis/Makefile.am1
3 files changed, 5 insertions, 1 deletions
diff --git a/paludis/repositories/e/Makefile.am b/paludis/repositories/e/Makefile.am
index 98d2330..c4479cc 100644
--- a/paludis/repositories/e/Makefile.am
+++ b/paludis/repositories/e/Makefile.am
@@ -432,6 +432,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_NO_CHOWN="yes" \
PALUDIS_TESTS_KEEP_STDERR="yes" \
PALDUIS_TMPDIR="`pwd`" \
+ PALUDIS_BYPASS_USERPRIV_CHECKS="yes" \
LD_LIBRARY_PATH="`echo $$LD_LIBRARY_PATH: | sed -e 's,^:,,'`` \
$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories/e/`:` \
$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories/e/.libs/`" \
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 89366d2..588c37f 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -109,7 +109,9 @@ EbuildCommand::operator() ()
if (params.package_id()->eapi()->supported()->userpriv_cannot_use_root())
{
if (0 == params.environment()->reduced_uid() || 0 == params.environment()->reduced_gid())
- throw ActionError("Need to be able to use non-0 user and group for userpriv for '" + stringify(*params.package_id()) + "'");
+ if (getenv_with_default("PALUDIS_BYPASS_USERPRIV_CHECKS", "").empty())
+ throw ActionError("Need to be able to use non-0 user and group for userpriv for '" +
+ stringify(*params.package_id()) + "'");
}
cmd.with_uid_gid(params.environment()->reduced_uid(), params.environment()->reduced_gid());
}
diff --git a/src/clients/paludis/Makefile.am b/src/clients/paludis/Makefile.am
index b97ed36..852ecb9 100644
--- a/src/clients/paludis/Makefile.am
+++ b/src/clients/paludis/Makefile.am
@@ -70,6 +70,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_NO_CHOWN="yupyup" \
PALUDIS_REDUCED_USERNAME="`id -un`" \
PALUDIS_OUTPUTWRAPPER_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/util/`" \
+ PALUDIS_BYPASS_USERPRIV_CHECKS="yes" \
TEST_OUTPUT_WRAPPER="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/util/outputwrapper`" \
SYSCONFDIR="$(sysconfdir)" \
bash $(top_srcdir)/test/run_test.sh bash