aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-03-26 00:28:22 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-03-26 00:28:22 +0000
commit34a45941559172d374ed757cdc37364a98c21eca (patch)
tree6820d38b9640f68b792c246d71dc3649f4fae009
parent2d870534d110c4c633bda49379b86de63cf1095b (diff)
downloadpaludis-34a45941559172d374ed757cdc37364a98c21eca.tar.gz
paludis-34a45941559172d374ed757cdc37364a98c21eca.tar.xz
Don't use userpriv for pkg_setup. Fixes: ticket:165
-rw-r--r--paludis/repositories/gentoo/ebuild.cc11
-rw-r--r--paludis/repositories/gentoo/ebuild.se2
-rw-r--r--paludis/repositories/gentoo/ebuild_entries.cc10
3 files changed, 20 insertions, 3 deletions
diff --git a/paludis/repositories/gentoo/ebuild.cc b/paludis/repositories/gentoo/ebuild.cc
index 9634dc1..28aa79a 100644
--- a/paludis/repositories/gentoo/ebuild.cc
+++ b/paludis/repositories/gentoo/ebuild.cc
@@ -311,8 +311,14 @@ EbuildInstallCommand::commands() const
{
switch (install_params.phase)
{
+ case ebuild_ip_init:
+ return "init saveenv";
+
+ case ebuild_ip_setup:
+ return "loadenv setup saveenv";
+
case ebuild_ip_build:
- return "init setup unpack compile test saveenv";
+ return "loadenv unpack compile test saveenv";
case ebuild_ip_install:
return "loadenv install saveenv";
@@ -387,7 +393,8 @@ EbuildInstallCommand::extend_command(const Command & cmd)
j(install_params.expand_vars->end()) ; i != j ; ++i)
result.with_setenv(i->first, i->second);
- if (ebuild_ip_build == install_params.phase && install_params.userpriv)
+ if ((ebuild_ip_build == install_params.phase || ebuild_ip_init == install_params.phase)
+ && install_params.userpriv)
result.with_uid_gid(params.environment->reduced_uid(), params.environment->reduced_gid());
return result;
diff --git a/paludis/repositories/gentoo/ebuild.se b/paludis/repositories/gentoo/ebuild.se
index 5aa0536..987b02c 100644
--- a/paludis/repositories/gentoo/ebuild.se
+++ b/paludis/repositories/gentoo/ebuild.se
@@ -5,6 +5,8 @@ make_enum_EbuildInstallCommandPhase()
{
prefix ebuild_ip
+ key ebuild_ip_init "Initialise the package."
+ key ebuild_ip_setup "Set up the package."
key ebuild_ip_build "Build the package."
key ebuild_ip_install "Install the package to D."
key ebuild_ip_preinstall "Preinstall to a live system."
diff --git a/paludis/repositories/gentoo/ebuild_entries.cc b/paludis/repositories/gentoo/ebuild_entries.cc
index 95f663e..61dd702 100644
--- a/paludis/repositories/gentoo/ebuild_entries.cc
+++ b/paludis/repositories/gentoo/ebuild_entries.cc
@@ -543,7 +543,7 @@ EbuildEntries::install(const QualifiedPackageName & q, const VersionSpec & v,
EbuildInstallCommandParams install_params(
EbuildInstallCommandParams::create()
- .phase(ebuild_ip_build)
+ .phase(ebuild_ip_init)
.use(use)
.a(archives)
.aa(all_archives)
@@ -560,6 +560,14 @@ EbuildEntries::install(const QualifiedPackageName & q, const VersionSpec & v,
.userpriv(userpriv_ok)
.slot(SlotName(metadata->slot)));
+ EbuildInstallCommand init_cmd(command_params, install_params);
+ init_cmd();
+
+ install_params.phase = ebuild_ip_setup;
+ EbuildInstallCommand setup_cmd(command_params, install_params);
+ setup_cmd();
+
+ install_params.phase = ebuild_ip_build;
EbuildInstallCommand build_cmd(command_params, install_params);
build_cmd();