aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-12-14 20:05:57 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-12-14 20:05:57 +0000
commitfa06315f7cb3f1ef601963ccbe1ea157e6c3ecfb (patch)
tree4cfcf5c4f11d7caa330c692d46fa0d57d63e74af
parent022f4dd439abfeffad3bf9d822306a47102874e6 (diff)
downloadpaludis-fa06315f7cb3f1ef601963ccbe1ea157e6c3ecfb.tar.gz
paludis-fa06315f7cb3f1ef601963ccbe1ea157e6c3ecfb.tar.xz
EAPI 3 is now prefix + mtimes
-rw-r--r--paludis/repositories/e/Makefile.am16
-rw-r--r--paludis/repositories/e/e_installed_repository.cc6
-rw-r--r--paludis/repositories/e/e_repository.cc17
-rw-r--r--paludis/repositories/e/e_repository_TEST_3.cc152
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_3_cleanup.sh9
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_3_setup.sh69
-rw-r--r--paludis/repositories/e/eapi.cc3
-rw-r--r--paludis/repositories/e/eapi.hh6
-rw-r--r--paludis/repositories/e/eapis/3.conf5
-rw-r--r--paludis/repositories/e/ebuild.cc19
-rw-r--r--paludis/repositories/e/ebuild.hh9
-rw-r--r--paludis/repositories/e/ebuild/0/builtin_init.bash4
-rw-r--r--paludis/repositories/e/ebuild_id.cc1
-rw-r--r--paludis/repositories/e/exndbam_repository.cc2
-rw-r--r--paludis/repositories/e/vdb_repository.cc2
15 files changed, 288 insertions, 32 deletions
diff --git a/paludis/repositories/e/Makefile.am b/paludis/repositories/e/Makefile.am
index f0bef2a..04bc912 100644
--- a/paludis/repositories/e/Makefile.am
+++ b/paludis/repositories/e/Makefile.am
@@ -205,6 +205,17 @@ e_repository_TEST_kdebuild_1_LDADD = \
e_repository_TEST_kdebuild_1_CXXFLAGS = $(AM_CXXFLAGS) -I$(top_srcdir) @PALUDIS_CXXFLAGS_NO_DEBUGGING@
+e_repository_TEST_3_SOURCES = e_repository_TEST_3.cc
+
+e_repository_TEST_3_LDADD = \
+ $(top_builddir)/paludis/util/libpaludisutil_@PALUDIS_PC_SLOT@.la \
+ $(top_builddir)/paludis/util/test_extras.o \
+ $(top_builddir)/paludis/libpaludis_@PALUDIS_PC_SLOT@.la \
+ $(top_builddir)/test/libtest.a \
+ $(DYNAMIC_LD_LIBS)
+
+e_repository_TEST_3_CXXFLAGS = $(AM_CXXFLAGS) -I$(top_srcdir) @PALUDIS_CXXFLAGS_NO_DEBUGGING@
+
e_repository_TEST_4_SOURCES = e_repository_TEST_4.cc
e_repository_TEST_4_LDADD = \
@@ -459,6 +470,9 @@ EXTRA_DIST = \
e_repository_TEST_2.cc \
e_repository_TEST_2_setup.sh \
e_repository_TEST_2_cleanup.sh \
+ e_repository_TEST_3.cc \
+ e_repository_TEST_3_setup.sh \
+ e_repository_TEST_3_cleanup.sh \
e_repository_TEST_4.cc \
e_repository_TEST_4_setup.sh \
e_repository_TEST_4_cleanup.sh \
@@ -525,6 +539,7 @@ check_SCRIPTS = \
e_repository_TEST_0_setup.sh e_repository_TEST_0_cleanup.sh \
e_repository_TEST_1_setup.sh e_repository_TEST_1_cleanup.sh \
e_repository_TEST_2_setup.sh e_repository_TEST_2_cleanup.sh \
+ e_repository_TEST_3_setup.sh e_repository_TEST_3_cleanup.sh \
e_repository_TEST_4_setup.sh e_repository_TEST_4_cleanup.sh \
e_repository_TEST_phases_setup.sh e_repository_TEST_phases_cleanup.sh \
e_repository_TEST_exlibs_setup.sh e_repository_TEST_exlibs_cleanup.sh \
@@ -593,6 +608,7 @@ TESTS = \
e_repository_TEST_0 \
e_repository_TEST_1 \
e_repository_TEST_2 \
+ e_repository_TEST_3 \
e_repository_TEST_4 \
e_repository_TEST_dependencies_rewriter \
e_repository_TEST_ever \
diff --git a/paludis/repositories/e/e_installed_repository.cc b/paludis/repositories/e/e_installed_repository.cc
index 1d00fdf..01a2974 100644
--- a/paludis/repositories/e/e_installed_repository.cc
+++ b/paludis/repositories/e/e_installed_repository.cc
@@ -243,14 +243,14 @@ EInstalledRepository::perform_config(
value_for<n::package_builddir>(_imp->params.builddir() / (stringify(id->name().category()) + "-" + stringify(id->name().package()) + "-" + stringify(id->version()) + "-config")),
value_for<n::package_id>(id),
value_for<n::portdir>(ver_dir),
+ value_for<n::root>(stringify(_imp->params.root())),
value_for<n::sandbox>(phase->option("sandbox")),
value_for<n::sydbox>(phase->option("sydbox")),
value_for<n::userpriv>(phase->option("userpriv"))
),
make_named_values<EbuildConfigCommandParams>(
- value_for<n::load_environment>(load_env.get()),
- value_for<n::root>(stringify(_imp->params.root()))
+ value_for<n::load_environment>(load_env.get())
));
config_cmd();
@@ -350,6 +350,7 @@ EInstalledRepository::perform_info(
value_for<n::package_builddir>(_imp->params.builddir() / (stringify(id->name().category()) + "-" + stringify(id->name().package()) + "-" + stringify(id->version()) + "-info")),
value_for<n::package_id>(id),
value_for<n::portdir>(ver_dir),
+ value_for<n::root>(stringify(_imp->params.root())),
value_for<n::sandbox>(phase->option("sandbox")),
value_for<n::sydbox>(phase->option("sydbox")),
value_for<n::userpriv>(phase->option("userpriv"))
@@ -360,7 +361,6 @@ EInstalledRepository::perform_info(
value_for<n::info_vars>(i ? i : make_shared_ptr(new const Set<std::string>)),
value_for<n::load_environment>(load_env.get()),
value_for<n::profiles>(make_shared_ptr(new FSEntrySequence)),
- value_for<n::root>(stringify(_imp->params.root())),
value_for<n::use>(""),
value_for<n::use_ebuild_file>(false),
value_for<n::use_expand>(""),
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index ac85d77..8965c72 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -2017,6 +2017,7 @@ ERepository::fetch(const std::tr1::shared_ptr<const ERepositoryID> & id,
value_for<n::portdir>(
(_imp->params.master_repositories() && ! _imp->params.master_repositories()->empty()) ?
(*_imp->params.master_repositories()->begin())->params().location() : _imp->params.location()),
+ value_for<n::root>("/"),
value_for<n::sandbox>(phase->option("sandbox")),
value_for<n::sydbox>(phase->option("sydbox")),
value_for<n::userpriv>(phase->option("userpriv") && userpriv_ok)
@@ -2029,7 +2030,6 @@ ERepository::fetch(const std::tr1::shared_ptr<const ERepositoryID> & id,
value_for<n::expand_vars>(expand_vars),
value_for<n::loadsaveenv_dir>(package_builddir / "temp"),
value_for<n::profiles>(_imp->params.profiles()),
- value_for<n::root>("/"),
value_for<n::slot>(id->slot_key() ? stringify(id->slot_key()->value()) : ""),
value_for<n::use>(use),
value_for<n::use_expand>(join(profile()->use_expand()->begin(), profile()->use_expand()->end(), " ")),
@@ -2064,6 +2064,7 @@ ERepository::fetch(const std::tr1::shared_ptr<const ERepositoryID> & id,
value_for<n::portdir>(
(_imp->params.master_repositories() && ! _imp->params.master_repositories()->empty()) ?
(*_imp->params.master_repositories()->begin())->params().location() : _imp->params.location()),
+ value_for<n::root>("/"),
value_for<n::sandbox>(phase->option("sandbox")),
value_for<n::sydbox>(phase->option("sydbox")),
value_for<n::userpriv>(phase->option("userpriv") && userpriv_ok)
@@ -2075,7 +2076,6 @@ ERepository::fetch(const std::tr1::shared_ptr<const ERepositoryID> & id,
value_for<n::aa>(all_archives),
value_for<n::expand_vars>(expand_vars),
value_for<n::profiles>(_imp->params.profiles()),
- value_for<n::root>("/"),
value_for<n::use>(use),
value_for<n::use_expand>(join(profile()->use_expand()->begin(), profile()->use_expand()->end(), " ")),
value_for<n::use_expand_hidden>(join(profile()->use_expand_hidden()->begin(), profile()->use_expand_hidden()->end(), " "))
@@ -2392,6 +2392,9 @@ ERepository::install(const std::tr1::shared_ptr<const ERepositoryID> & id,
value_for<n::portdir>(
(_imp->params.master_repositories() && ! _imp->params.master_repositories()->empty()) ?
(*_imp->params.master_repositories()->begin())->params().location() : _imp->params.location()),
+ value_for<n::root>(install_action.options.destination()->installed_root_key() ?
+ stringify(install_action.options.destination()->installed_root_key()->value()) :
+ "/"),
value_for<n::sandbox>(phase->option("sandbox")),
value_for<n::sydbox>(phase->option("sydbox")),
value_for<n::userpriv>(phase->option("userpriv") && userpriv_ok)
@@ -2407,9 +2410,6 @@ ERepository::install(const std::tr1::shared_ptr<const ERepositoryID> & id,
value_for<n::loadsaveenv_dir>(package_builddir / "temp"),
value_for<n::profiles>(_imp->params.profiles()),
value_for<n::replacing_ids>(install_action.options.replacing()),
- value_for<n::root>(install_action.options.destination()->installed_root_key() ?
- stringify(install_action.options.destination()->installed_root_key()->value()) :
- "/"),
value_for<n::slot>(id->slot_key() ? stringify(id->slot_key()->value()) : ""),
value_for<n::use>(use),
value_for<n::use_expand>(join(profile()->use_expand()->begin(), profile()->use_expand()->end(), " ")),
@@ -2505,6 +2505,7 @@ ERepository::info(const std::tr1::shared_ptr<const ERepositoryID> & id,
value_for<n::portdir>(
(_imp->params.master_repositories() && ! _imp->params.master_repositories()->empty()) ?
(*_imp->params.master_repositories()->begin())->params().location() : _imp->params.location()),
+ value_for<n::root>(stringify(_imp->params.environment()->root())),
value_for<n::sandbox>(phase->option("sandbox")),
value_for<n::sydbox>(phase->option("sydbox")),
value_for<n::userpriv>(phase->option("userpriv") && userpriv_ok)
@@ -2517,7 +2518,6 @@ ERepository::info(const std::tr1::shared_ptr<const ERepositoryID> & id,
info_vars_key()->value() : make_shared_ptr(new const Set<std::string>)),
value_for<n::load_environment>(static_cast<const FSEntry *>(0)),
value_for<n::profiles>(_imp->params.profiles()),
- value_for<n::root>(stringify(_imp->params.environment()->root())),
value_for<n::use>(use),
value_for<n::use_ebuild_file>(true),
value_for<n::use_expand>(join(profile()->use_expand()->begin(), profile()->use_expand()->end(), " ")),
@@ -2579,6 +2579,7 @@ ERepository::get_environment_variable(
value_for<n::portdir>(
(_imp->params.master_repositories() && ! _imp->params.master_repositories()->empty()) ?
(*_imp->params.master_repositories()->begin())->params().location() : _imp->params.location()),
+ value_for<n::root>("/"),
value_for<n::sandbox>(phases.begin_phases()->option("sandbox")),
value_for<n::sydbox>(phases.begin_phases()->option("sydbox")),
value_for<n::userpriv>(phases.begin_phases()->option("userpriv") && userpriv_ok)
@@ -2729,6 +2730,7 @@ ERepository::pretend(
value_for<n::portdir>(
(_imp->params.master_repositories() && ! _imp->params.master_repositories()->empty()) ?
(*_imp->params.master_repositories()->begin())->params().location() : _imp->params.location()),
+ value_for<n::root>(stringify(_imp->params.environment()->root())),
value_for<n::sandbox>(phase->option("sandbox")),
value_for<n::sydbox>(phase->option("sydbox")),
value_for<n::userpriv>(phase->option("userpriv") && userpriv_ok)
@@ -2738,7 +2740,6 @@ ERepository::pretend(
make_named_values<EbuildBadOptionsCommandParams>(
value_for<n::expand_vars>(expand_vars),
value_for<n::profiles>(_imp->params.profiles()),
- value_for<n::root>(stringify(_imp->params.environment()->root())),
value_for<n::unmet_requirements>(verifier.unmet_requirements()),
value_for<n::use>(use),
value_for<n::use_expand>(join(profile()->use_expand()->begin(), profile()->use_expand()->end(), " ")),
@@ -2783,6 +2784,7 @@ ERepository::pretend(
value_for<n::portdir>(
(_imp->params.master_repositories() && ! _imp->params.master_repositories()->empty()) ?
(*_imp->params.master_repositories()->begin())->params().location() : _imp->params.location()),
+ value_for<n::root>(stringify(_imp->params.environment()->root())),
value_for<n::sandbox>(phase->option("sandbox")),
value_for<n::sydbox>(phase->option("sydbox")),
value_for<n::userpriv>(phase->option("userpriv") && userpriv_ok)
@@ -2792,7 +2794,6 @@ ERepository::pretend(
make_named_values<EbuildPretendCommandParams>(
value_for<n::expand_vars>(expand_vars),
value_for<n::profiles>(_imp->params.profiles()),
- value_for<n::root>(stringify(_imp->params.environment()->root())),
value_for<n::use>(use),
value_for<n::use_expand>(join(profile()->use_expand()->begin(), profile()->use_expand()->end(), " ")),
value_for<n::use_expand_hidden>(join(profile()->use_expand_hidden()->begin(), profile()->use_expand_hidden()->end(), " "))
diff --git a/paludis/repositories/e/e_repository_TEST_3.cc b/paludis/repositories/e/e_repository_TEST_3.cc
new file mode 100644
index 0000000..fd35af1
--- /dev/null
+++ b/paludis/repositories/e/e_repository_TEST_3.cc
@@ -0,0 +1,152 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <paludis/repositories/e/e_repository.hh>
+#include <paludis/repositories/e/e_repository_exceptions.hh>
+#include <paludis/repositories/e/e_repository_id.hh>
+#include <paludis/repositories/e/vdb_repository.hh>
+#include <paludis/repositories/e/eapi.hh>
+#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
+#include <paludis/repositories/fake/fake_installed_repository.hh>
+#include <paludis/repositories/fake/fake_package_id.hh>
+#include <paludis/environments/test/test_environment.hh>
+#include <paludis/util/system.hh>
+#include <paludis/util/simple_visitor_cast.hh>
+#include <paludis/util/map.hh>
+#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/make_named_values.hh>
+#include <paludis/util/set.hh>
+#include <paludis/standard_output_manager.hh>
+#include <paludis/util/safe_ifstream.hh>
+#include <paludis/package_id.hh>
+#include <paludis/metadata_key.hh>
+#include <paludis/action.hh>
+#include <paludis/stringify_formatter.hh>
+#include <paludis/user_dep_spec.hh>
+#include <paludis/generator.hh>
+#include <paludis/filter.hh>
+#include <paludis/filtered_generator.hh>
+#include <paludis/selection.hh>
+#include <paludis/repository_factory.hh>
+#include <paludis/choice.hh>
+#include <test/test_framework.hh>
+#include <test/test_runner.hh>
+#include <tr1/functional>
+#include <set>
+#include <string>
+
+#include "config.h"
+
+using namespace test;
+using namespace paludis;
+
+namespace
+{
+ void cannot_uninstall(const std::tr1::shared_ptr<const PackageID> & id, const UninstallActionOptions &)
+ {
+ if (id)
+ throw InternalError(PALUDIS_HERE, "cannot uninstall");
+ }
+
+ std::tr1::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
+ {
+ return make_shared_ptr(new StandardOutputManager);
+ }
+
+ std::string from_keys(const std::tr1::shared_ptr<const Map<std::string, std::string> > & m,
+ const std::string & k)
+ {
+ Map<std::string, std::string>::ConstIterator mm(m->find(k));
+ if (m->end() == mm)
+ return "";
+ else
+ return mm->second;
+ }
+
+ WantPhase want_all_phases(const std::string &)
+ {
+ return wp_yes;
+ }
+}
+
+namespace test_cases
+{
+ struct ERepositoryInstallEAPI3Test : TestCase
+ {
+ ERepositoryInstallEAPI3Test() : TestCase("install_eapi_3") { }
+
+ unsigned max_run_time() const
+ {
+ return 3000;
+ }
+
+ bool repeatable() const
+ {
+ return false;
+ }
+
+ void run()
+ {
+ TestEnvironment env;
+ env.set_paludis_command("/bin/false");
+ std::tr1::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ keys->insert("format", "ebuild");
+ keys->insert("names_cache", "/var/empty");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_3_dir" / "repo"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_3_dir" / "repo/profiles/profile"));
+ keys->insert("layout", "traditional");
+ keys->insert("eapi_when_unknown", "0");
+ keys->insert("eapi_when_unspecified", "0");
+ keys->insert("profile_eapi", "0");
+ keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_3_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_3_dir" / "build"));
+ std::tr1::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
+ std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
+ env.package_database()->add_repository(1, repo);
+
+ std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(
+ make_named_values<FakeInstalledRepositoryParams>(
+ value_for<n::environment>(&env),
+ value_for<n::name>(RepositoryName("installed")),
+ value_for<n::suitable_destination>(true),
+ value_for<n::supports_uninstall>(true)
+ )));
+ env.package_database()->add_repository(2, installed_repo);
+
+ InstallAction action(make_named_values<InstallActionOptions>(
+ value_for<n::destination>(installed_repo),
+ value_for<n::make_output_manager>(&make_standard_output_manager),
+ value_for<n::perform_uninstall>(&cannot_uninstall),
+ value_for<n::replacing>(make_shared_ptr(new PackageIDSequence)),
+ value_for<n::want_phase>(&want_all_phases)
+ ));
+
+ {
+ TestMessageSuffix suffix("prefix", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/prefix-3",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "3");
+ id->perform_action(action);
+ }
+ }
+ } test_e_repository_install_eapi_3;
+}
+
diff --git a/paludis/repositories/e/e_repository_TEST_3_cleanup.sh b/paludis/repositories/e/e_repository_TEST_3_cleanup.sh
new file mode 100755
index 0000000..26e3e59
--- /dev/null
+++ b/paludis/repositories/e/e_repository_TEST_3_cleanup.sh
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+# vim: set ft=sh sw=4 sts=4 et :
+
+if [ -d e_repository_TEST_3_dir ] ; then
+ rm -fr e_repository_TEST_3_dir
+else
+ true
+fi
+
diff --git a/paludis/repositories/e/e_repository_TEST_3_setup.sh b/paludis/repositories/e/e_repository_TEST_3_setup.sh
new file mode 100755
index 0000000..41327ab
--- /dev/null
+++ b/paludis/repositories/e/e_repository_TEST_3_setup.sh
@@ -0,0 +1,69 @@
+#!/usr/bin/env bash
+# vim: set ft=sh sw=4 sts=4 et :
+
+mkdir e_repository_TEST_3_dir || exit 1
+cd e_repository_TEST_3_dir || exit 1
+
+mkdir -p root/etc
+
+mkdir -p vdb
+touch vdb/THISISTHEVDB
+
+mkdir -p build
+ln -s build symlinked_build
+
+mkdir -p distdir
+echo "already fetched" > distdir/already-fetched.txt || exit 1
+cat <<END > distdir/expatch-success-1.patch || exit 1
+--- a/bar
++++ b/bar
+@@ -1 +1,3 @@
+ foo
++bar
++baz
+END
+
+mkdir -p fetchable
+echo "one" > fetchable/fetchable-1.txt || exit 1
+echo "two" > fetchable/fetchable-2.txt || exit 1
+
+mkdir -p repo/{profiles/profile,metadata,eclass} || exit 1
+cd repo || exit 1
+echo "test-repo" >> profiles/repo_name || exit 1
+echo "cat" >> profiles/categories || exit 1
+cat <<END > profiles/profile/virtuals
+virtual/virtual-pretend-installed cat/pretend-installed
+virtual/virtual-doesnotexist cat/doesnotexist
+END
+cat <<END > profiles/profile/make.defaults
+ARCH="cheese"
+USERLAND="GNU"
+KERNEL="linux"
+LIBC="glibc"
+CHOST="i286-badger-linux-gnu"
+LINGUAS="enabled_en enabled_en_GB enabled_en_GB@UTF-8"
+USE_EXPAND="LINGUAS USERLAND"
+USE_EXPAND_UNPREFIXED="ARCH"
+USE_EXPAND_IMPLICIT="USERLAND ARCH"
+USE_EXPAND_VALUES_USERLAND="GNU"
+USE_EXPAND_VALUES_ARCH="cheese otherarch"
+IUSE_IMPLICIT="build"
+END
+mkdir -p "cat/prefix"
+cat <<'END' > cat/prefix/prefix-3.ebuild || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+pkg_setup() {
+ [[ "/" == ${EROOT} ]] || die eroot
+ [[ "${D}" == "${ED}" ]] || die ed
+ [[ "${EPREFIX}" == "" ]] || die eprefix
+}
+END
+cd ..
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index a33903c..e82ae74 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -80,6 +80,9 @@ namespace
value_for<n::env_d>(check_get(k, "env_d")),
value_for<n::env_distdir>(check_get(k, "env_distdir")),
value_for<n::env_ebuild_phase>(check_get(k, "env_ebuild_phase")),
+ value_for<n::env_ed>(check_get(k, "env_ed")),
+ value_for<n::env_eprefix>(check_get(k, "env_eprefix")),
+ value_for<n::env_eroot>(check_get(k, "env_eroot")),
value_for<n::env_filesdir>(check_get(k, "env_filesdir")),
value_for<n::env_iuse_implicit>(check_get(k, "env_iuse_implicit")),
value_for<n::env_jobs>(check_get(k, "env_jobs")),
diff --git a/paludis/repositories/e/eapi.hh b/paludis/repositories/e/eapi.hh
index d500132..dcb5e6d 100644
--- a/paludis/repositories/e/eapi.hh
+++ b/paludis/repositories/e/eapi.hh
@@ -88,6 +88,9 @@ namespace paludis
struct env_d;
struct env_distdir;
struct env_ebuild_phase;
+ struct env_ed;
+ struct env_eprefix;
+ struct env_eroot;
struct env_filesdir;
struct env_iuse_implicit;
struct env_jobs;
@@ -294,6 +297,9 @@ namespace paludis
NamedValue<n::env_d, std::string> env_d;
NamedValue<n::env_distdir, std::string> env_distdir;
NamedValue<n::env_ebuild_phase, std::string> env_ebuild_phase;
+ NamedValue<n::env_ed, std::string> env_ed;
+ NamedValue<n::env_eprefix, std::string> env_eprefix;
+ NamedValue<n::env_eroot, std::string> env_eroot;
NamedValue<n::env_filesdir, std::string> env_filesdir;
NamedValue<n::env_iuse_implicit, std::string> env_iuse_implicit;
NamedValue<n::env_jobs, std::string> env_jobs;
diff --git a/paludis/repositories/e/eapis/3.conf b/paludis/repositories/e/eapis/3.conf
index e643ef8..d6116d6 100644
--- a/paludis/repositories/e/eapis/3.conf
+++ b/paludis/repositories/e/eapis/3.conf
@@ -6,4 +6,9 @@ exported_name = 3
can_be_pbin = true
ebuild_module_suffixes = 3 2 1 0
+merger_options = ${merger_options} preserve_mtimes
+
+env_ed = ED
+env_eprefix = EPREFIX
+env_eroot = EROOT
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 041450a..fe191da 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -263,7 +263,8 @@ EbuildCommand::operator() ()
)
.with_setenv("SLOT", "")
.with_setenv("PALUDIS_PROFILE_DIR", "")
- .with_setenv("PALUDIS_PROFILE_DIRS", "");
+ .with_setenv("PALUDIS_PROFILE_DIRS", "")
+ .with_setenv("ROOT", params.root());
if (! params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_kv().empty())
cmd.with_setenv(params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_kv(), kernel_version());
@@ -308,6 +309,12 @@ EbuildCommand::operator() ()
.with_setenv(params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_jobs(),
get_jobs(params.package_id()));
+ cmd.with_setenv("PALUDIS_PREFIX_IMAGE_VAR", params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_ed());
+ if (! params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_eprefix().empty())
+ cmd.with_setenv(params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_eprefix(), "");
+ if (! params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_eroot().empty())
+ cmd.with_setenv(params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_eroot(), params.root());
+
cmd
.with_setenv("PALUDIS_TRACE", get_trace(params.package_id()) ? "yes" : "");
@@ -734,7 +741,6 @@ Command
EbuildNoFetchCommand::extend_command(const Command & cmd)
{
Command result(Command(cmd)
- .with_setenv("ROOT", fetch_params.root())
.with_setenv("PALUDIS_PROFILE_DIR", stringify(*fetch_params.profiles()->begin()))
.with_setenv("PALUDIS_PROFILE_DIRS", join(fetch_params.profiles()->begin(),
fetch_params.profiles()->end(), " "))
@@ -788,7 +794,6 @@ Command
EbuildInstallCommand::extend_command(const Command & cmd)
{
Command result(Command(cmd)
- .with_setenv("ROOT", install_params.root())
.with_setenv("PALUDIS_LOADSAVEENV_DIR", stringify(install_params.loadsaveenv_dir()))
.with_setenv("PALUDIS_CONFIG_PROTECT", install_params.config_protect())
.with_setenv("PALUDIS_CONFIG_PROTECT_MASK", install_params.config_protect_mask())
@@ -873,7 +878,6 @@ Command
EbuildUninstallCommand::extend_command(const Command & cmd)
{
Command result(Command(cmd)
- .with_setenv("ROOT", uninstall_params.root())
.with_setenv("PALUDIS_LOADSAVEENV_DIR", stringify(uninstall_params.loadsaveenv_dir()))
);
@@ -923,8 +927,7 @@ EbuildConfigCommand::failure()
Command
EbuildConfigCommand::extend_command(const Command & cmd)
{
- Command result(Command(cmd)
- .with_setenv("ROOT", config_params.root()));
+ Command result(cmd);
if (config_params.load_environment())
result
@@ -1056,7 +1059,6 @@ EbuildPretendCommand::extend_command(const Command & cmd)
stringify(params.package_id()->version()) + "> ")
.with_prefix_discard_blank_output()
.with_prefix_blank_lines()
- .with_setenv("ROOT", pretend_params.root())
.with_setenv("PALUDIS_PROFILE_DIR", stringify(*pretend_params.profiles()->begin()))
.with_setenv("PALUDIS_PROFILE_DIRS", join(pretend_params.profiles()->begin(),
pretend_params.profiles()->end(), " ")));
@@ -1119,7 +1121,6 @@ EbuildInfoCommand::extend_command(const Command & cmd)
.with_stderr_prefix(" ")
.with_prefix_discard_blank_output()
.with_prefix_blank_lines()
- .with_setenv("ROOT", info_params.root())
.with_setenv("PALUDIS_INFO_VARS", info_vars)
.with_setenv("PALUDIS_PROFILE_DIR",
info_params.profiles()->empty() ? std::string("") : stringify(*info_params.profiles()->begin()))
@@ -1246,7 +1247,6 @@ Command
EbuildBadOptionsCommand::extend_command(const Command & cmd)
{
Command result(Command(cmd)
- .with_setenv("ROOT", bad_options_params.root())
.with_setenv("PALUDIS_PROFILE_DIR", stringify(*bad_options_params.profiles()->begin()))
.with_setenv("PALUDIS_PROFILE_DIRS", join(bad_options_params.profiles()->begin(),
bad_options_params.profiles()->end(), " "))
@@ -1297,7 +1297,6 @@ Command
EbuildFetchExtraCommand::extend_command(const Command & cmd)
{
Command result(Command(cmd)
- .with_setenv("ROOT", fetch_extra_params.root())
.with_setenv("PALUDIS_LOADSAVEENV_DIR", stringify(fetch_extra_params.loadsaveenv_dir()))
.with_setenv("PALUDIS_PROFILE_DIR", stringify(*fetch_extra_params.profiles()->begin()))
.with_setenv("PALUDIS_PROFILE_DIRS", join(fetch_extra_params.profiles()->begin(),
diff --git a/paludis/repositories/e/ebuild.hh b/paludis/repositories/e/ebuild.hh
index a0f002e..56fba87 100644
--- a/paludis/repositories/e/ebuild.hh
+++ b/paludis/repositories/e/ebuild.hh
@@ -116,6 +116,7 @@ namespace paludis
NamedValue<n::package_builddir, FSEntry> package_builddir;
NamedValue<n::package_id, std::tr1::shared_ptr<const erepository::ERepositoryID> > package_id;
NamedValue<n::portdir, FSEntry> portdir;
+ NamedValue<n::root, std::string> root;
NamedValue<n::sandbox, bool> sandbox;
NamedValue<n::sydbox, bool> sydbox;
NamedValue<n::userpriv, bool> userpriv;
@@ -134,7 +135,6 @@ namespace paludis
NamedValue<n::aa, std::string> aa;
NamedValue<n::expand_vars, std::tr1::shared_ptr<const Map<std::string, std::string> > > expand_vars;
NamedValue<n::profiles, std::tr1::shared_ptr<const FSEntrySequence> > profiles;
- NamedValue<n::root, std::string> root;
NamedValue<n::use, std::string> use;
NamedValue<n::use_expand, std::string> use_expand;
NamedValue<n::use_expand_hidden, std::string> use_expand_hidden;
@@ -154,7 +154,6 @@ namespace paludis
NamedValue<n::expand_vars, std::tr1::shared_ptr<const Map<std::string, std::string> > > expand_vars;
NamedValue<n::loadsaveenv_dir, FSEntry> loadsaveenv_dir;
NamedValue<n::profiles, std::tr1::shared_ptr<const FSEntrySequence> > profiles;
- NamedValue<n::root, std::string> root;
NamedValue<n::slot, std::string> slot;
NamedValue<n::use, std::string> use;
NamedValue<n::use_expand, std::string> use_expand;
@@ -178,7 +177,6 @@ namespace paludis
NamedValue<n::loadsaveenv_dir, FSEntry> loadsaveenv_dir;
NamedValue<n::profiles, std::tr1::shared_ptr<const FSEntrySequence> > profiles;
NamedValue<n::replacing_ids, std::tr1::shared_ptr<const PackageIDSequence> > replacing_ids;
- NamedValue<n::root, std::string> root;
NamedValue<n::slot, std::string> slot;
NamedValue<n::use, std::string> use;
NamedValue<n::use_expand, std::string> use_expand;
@@ -196,7 +194,6 @@ namespace paludis
{
NamedValue<n::expand_vars, std::tr1::shared_ptr<const Map<std::string, std::string> > > expand_vars;
NamedValue<n::profiles, std::tr1::shared_ptr<const FSEntrySequence> > profiles;
- NamedValue<n::root, std::string> root;
NamedValue<n::use, std::string> use;
NamedValue<n::use_expand, std::string> use_expand;
NamedValue<n::use_expand_hidden, std::string> use_expand_hidden;
@@ -213,7 +210,6 @@ namespace paludis
{
NamedValue<n::expand_vars, std::tr1::shared_ptr<const Map<std::string, std::string> > > expand_vars;
NamedValue<n::profiles, std::tr1::shared_ptr<const FSEntrySequence> > profiles;
- NamedValue<n::root, std::string> root;
NamedValue<n::unmet_requirements, std::tr1::shared_ptr<const Sequence<std::string> > > unmet_requirements;
NamedValue<n::use, std::string> use;
NamedValue<n::use_expand, std::string> use_expand;
@@ -232,7 +228,6 @@ namespace paludis
NamedValue<n::load_environment, const FSEntry *> load_environment;
NamedValue<n::loadsaveenv_dir, FSEntry> loadsaveenv_dir;
NamedValue<n::replaced_by, std::tr1::shared_ptr<const PackageID> > replaced_by;
- NamedValue<n::root, std::string> root;
NamedValue<n::unmerge_only, bool> unmerge_only;
};
@@ -246,7 +241,6 @@ namespace paludis
struct EbuildConfigCommandParams
{
NamedValue<n::load_environment, const FSEntry *> load_environment;
- NamedValue<n::root, std::string> root;
};
/**
@@ -262,7 +256,6 @@ namespace paludis
NamedValue<n::info_vars, std::tr1::shared_ptr<const Set<std::string> > > info_vars;
NamedValue<n::load_environment, const FSEntry *> load_environment;
NamedValue<n::profiles, std::tr1::shared_ptr<const FSEntrySequence> > profiles;
- NamedValue<n::root, std::string> root;
NamedValue<n::use, std::string> use;
NamedValue<n::use_ebuild_file, bool> use_ebuild_file;
NamedValue<n::use_expand, std::string> use_expand;
diff --git a/paludis/repositories/e/ebuild/0/builtin_init.bash b/paludis/repositories/e/ebuild/0/builtin_init.bash
index 89ee889..5c9659f 100644
--- a/paludis/repositories/e/ebuild/0/builtin_init.bash
+++ b/paludis/repositories/e/ebuild/0/builtin_init.bash
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
-# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+# Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
#
# This file is part of the Paludis package manager. Paludis is free software;
# you can redistribute it and/or modify it under the terms of the GNU General
@@ -69,6 +69,8 @@ builtin_init()
mkdir -p "${D}" || die "Couldn't create \$D (\"${D}\")"
declare -r D="${D}"
+ [[ -n "${PALUDIS_PREFIX_IMAGE_VAR}" ]] && export $PALUDIS_PREFIX_IMAGE_VAR=${D}
+
IMAGE="${D}"
declare -r IMAGE="${IMAGE}"
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 2c466ec..5239eed 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -266,6 +266,7 @@ EbuildID::need_keys_added() const
value_for<n::portdir>(
(_imp->repository->params().master_repositories() && ! _imp->repository->params().master_repositories()->empty()) ?
(*_imp->repository->params().master_repositories()->begin())->params().location() : _imp->repository->params().location()),
+ value_for<n::root>("/"),
value_for<n::sandbox>(phases.begin_phases()->option("sandbox")),
value_for<n::sydbox>(phases.begin_phases()->option("sydbox")),
value_for<n::userpriv>(phases.begin_phases()->option("userpriv"))
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index 1a05308..e484a30 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -560,6 +560,7 @@ ExndbamRepository::perform_uninstall(
value_for<n::package_builddir>(package_builddir),
value_for<n::package_id>(id),
value_for<n::portdir>(_imp->params.location()),
+ value_for<n::root>(stringify(_imp->params.root())),
value_for<n::sandbox>(phase->option("sandbox")),
value_for<n::sydbox>(phase->option("sydbox")),
value_for<n::userpriv>(phase->option("userpriv"))
@@ -570,7 +571,6 @@ ExndbamRepository::perform_uninstall(
value_for<n::load_environment>(load_env.get()),
value_for<n::loadsaveenv_dir>(package_builddir / "temp"),
value_for<n::replaced_by>(a.options.if_for_install_id()),
- value_for<n::root>(stringify(_imp->params.root())),
value_for<n::unmerge_only>(false)
));
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index 31f7bc0..73dd625 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -490,6 +490,7 @@ VDBRepository::perform_uninstall(
value_for<n::package_builddir>(package_builddir),
value_for<n::package_id>(id),
value_for<n::portdir>(_imp->params.location()),
+ value_for<n::root>(stringify(_imp->params.root())),
value_for<n::sandbox>(phase->option("sandbox")),
value_for<n::sydbox>(phase->option("sydbox")),
value_for<n::userpriv>(phase->option("userpriv"))
@@ -499,7 +500,6 @@ VDBRepository::perform_uninstall(
value_for<n::load_environment>(load_env.get()),
value_for<n::loadsaveenv_dir>(package_builddir / "temp"),
value_for<n::replaced_by>(a.options.if_for_install_id()),
- value_for<n::root>(stringify(_imp->params.root())),
value_for<n::unmerge_only>(false)
));