aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-03-30 13:37:12 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-03-30 13:37:12 +0000
commit7598080934971c9bc19be262e8d530ebdc220d86 (patch)
treec9ac58a67b0278f286b45779387409c72bc70168
parent822cf28e1d5494e0d3bca0368a3f92c351bb931d (diff)
downloadpaludis-7598080934971c9bc19be262e8d530ebdc220d86.tar.gz
paludis-7598080934971c9bc19be262e8d530ebdc220d86.tar.xz
Code cleanup
-rw-r--r--paludis/environments/portage/portage_environment.cc20
-rw-r--r--paludis/environments/portage/portage_environment.hh1
2 files changed, 11 insertions, 10 deletions
diff --git a/paludis/environments/portage/portage_environment.cc b/paludis/environments/portage/portage_environment.cc
index 34b1187..077bd66 100644
--- a/paludis/environments/portage/portage_environment.cc
+++ b/paludis/environments/portage/portage_environment.cc
@@ -317,7 +317,12 @@ void
PortageEnvironment::_add_portdir_repository(const FSEntry & portdir)
{
Context context("When creating PORTDIR repository:");
+ _add_ebuild_repository(portdir, "");
+}
+void
+PortageEnvironment::_add_ebuild_repository(const FSEntry & portdir, const std::string & master)
+{
std::tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
new AssociativeCollection<std::string, std::string>::Concrete);
keys->insert("root", stringify(root()));
@@ -327,6 +332,10 @@ PortageEnvironment::_add_portdir_repository(const FSEntry & portdir)
stringify(_imp->conf_dir / "portage" / "profile") : ""));
keys->insert("format", "ebuild");
keys->insert("names_cache", "/var/empty");
+ keys->insert("master_repository", master);
+
+ /* TODO: DISTDIR, BUILD_PREFIX, SYNC */
+
package_database()->add_repository(2,
RepositoryMaker::get_instance()->find_maker("ebuild")(this, keys));
}
@@ -335,16 +344,7 @@ void
PortageEnvironment::_add_portdir_overlay_repository(const FSEntry & portdir)
{
Context context("When creating PORTDIR_OVERLAY repository '" + stringify(portdir) + "':");
-
- std::tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
- new AssociativeCollection<std::string, std::string>::Concrete);
- keys->insert("root", stringify(root()));
- keys->insert("location", stringify(portdir));
- keys->insert("format", "ebuild");
- keys->insert("names_cache", "/var/empty");
- keys->insert("master_repository", "gentoo");
- package_database()->add_repository(2,
- RepositoryMaker::get_instance()->find_maker("ebuild")(this, keys));
+ _add_ebuild_repository(portdir, "gentoo");
}
void
diff --git a/paludis/environments/portage/portage_environment.hh b/paludis/environments/portage/portage_environment.hh
index 56a38c0..59955ac 100644
--- a/paludis/environments/portage/portage_environment.hh
+++ b/paludis/environments/portage/portage_environment.hh
@@ -41,6 +41,7 @@ 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_vdb_repository();
template<typename I_>