aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-03-30 20:24:07 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-03-30 20:24:07 +0000
commit82186ea6ebe1ae247fc10ee3fa07df723c4a0f73 (patch)
tree63922c3fa904f8a51aee5eb598a5d40573e7edb0
parent0f7b8b09ff398c506456fd01aec463a2c08ecc69 (diff)
downloadpaludis-82186ea6ebe1ae247fc10ee3fa07df723c4a0f73.tar.gz
paludis-82186ea6ebe1ae247fc10ee3fa07df723c4a0f73.tar.xz
More PortageEnvironment work
-rw-r--r--paludis/environments/portage/Makefile.am4
-rw-r--r--paludis/environments/portage/bashrc4
-rw-r--r--paludis/environments/portage/portage_environment.cc24
-rw-r--r--paludis/environments/portage/portage_environment.hh6
4 files changed, 31 insertions, 7 deletions
diff --git a/paludis/environments/portage/Makefile.am b/paludis/environments/portage/Makefile.am
index 645288e..e05eb1d 100644
--- a/paludis/environments/portage/Makefile.am
+++ b/paludis/environments/portage/Makefile.am
@@ -22,6 +22,9 @@ libpaludisportageenvironment_la_LIBADD = \
libenvdir = $(libdir)/paludis/environments/
+libexecenvdir = $(libexecdir)/paludis/environments/portage/
+libexecenv_SCRIPTS = bashrc
+
libenv_LTLIBRARIES = libpaludisportageenvironment.la
paludis_environment_portage_includedir = $(includedir)/paludis/environments/portage
@@ -30,6 +33,7 @@ paludis_environment_portage_include_HEADERS = \
EXTRA_DIST = \
$(BUILT_SOURCES) \
+ $(libexecenv_SCRIPTS) \
portage_environment_TEST_setup.sh \
portage_environment_TEST.cc \
portage_environment_TEST_cleanup.sh
diff --git a/paludis/environments/portage/bashrc b/paludis/environments/portage/bashrc
new file mode 100644
index 0000000..8fc9d63
--- /dev/null
+++ b/paludis/environments/portage/bashrc
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+unset USE USE_EXPAND USE_EXPAND_HIDDEN ${USE_EXPAND}
+
diff --git a/paludis/environments/portage/portage_environment.cc b/paludis/environments/portage/portage_environment.cc
index deba902..992249d 100644
--- a/paludis/environments/portage/portage_environment.cc
+++ b/paludis/environments/portage/portage_environment.cc
@@ -321,11 +321,12 @@ void
PortageEnvironment::_add_portdir_repository(const FSEntry & portdir)
{
Context context("When creating PORTDIR repository:");
- _add_ebuild_repository(portdir, "");
+ _add_ebuild_repository(portdir, "", _imp->vars->get("SYNC"));
}
void
-PortageEnvironment::_add_ebuild_repository(const FSEntry & portdir, const std::string & master)
+PortageEnvironment::_add_ebuild_repository(const FSEntry & portdir, const std::string & master,
+ const std::string & sync)
{
std::tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
new AssociativeCollection<std::string, std::string>::Concrete);
@@ -337,8 +338,12 @@ PortageEnvironment::_add_ebuild_repository(const FSEntry & portdir, const std::s
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
keys->insert("master_repository", master);
-
- /* TODO: DISTDIR, BUILD_PREFIX, SYNC */
+ keys->insert("sync", sync);
+ keys->insert("distdir", stringify(_imp->vars->get("DISTDIR")));
+ std::string buildroot(_imp->vars->get("PORTAGE_TMPDIR"));
+ if (! buildroot.empty())
+ buildroot.append("/portage");
+ keys->insert("buildroot", buildroot);
package_database()->add_repository(2,
RepositoryMaker::get_instance()->find_maker("ebuild")(this, keys));
@@ -348,7 +353,7 @@ void
PortageEnvironment::_add_portdir_overlay_repository(const FSEntry & portdir)
{
Context context("When creating PORTDIR_OVERLAY repository '" + stringify(portdir) + "':");
- _add_ebuild_repository(portdir, "gentoo");
+ _add_ebuild_repository(portdir, "gentoo", "");
}
void
@@ -564,7 +569,6 @@ PortageEnvironment::perform_hook(const Hook & hook) const
return _imp->hooker->perform_hook(hook);
}
-
std::string
PortageEnvironment::hook_dirs() const
{
@@ -572,3 +576,11 @@ PortageEnvironment::hook_dirs() const
return join(_imp->hook_dirs.begin(), _imp->hook_dirs.end(), " ");
}
+std::string
+PortageEnvironment::bashrc_files() const
+{
+ return stringify(_imp->conf_dir / "make.globals") + " " +
+ stringify(_imp->conf_dir / "make.conf") + " " +
+ stringify(FSEntry(LIBEXECDIR) / "paludis" / "environments" / "portage" / "bashrc");
+}
+
diff --git a/paludis/environments/portage/portage_environment.hh b/paludis/environments/portage/portage_environment.hh
index 59955ac..d653aeb 100644
--- a/paludis/environments/portage/portage_environment.hh
+++ b/paludis/environments/portage/portage_environment.hh
@@ -41,7 +41,8 @@ namespace paludis
void _add_installed_virtuals_repository();
void _add_portdir_repository(const FSEntry &);
void _add_portdir_overlay_repository(const FSEntry &);
- void _add_ebuild_repository(const FSEntry &, const std::string &);
+ void _add_ebuild_repository(const FSEntry &, const std::string &,
+ const std::string &);
void _add_vdb_repository();
template<typename I_>
@@ -96,6 +97,9 @@ namespace paludis
virtual std::string hook_dirs() const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual std::string bashrc_files() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
};
}