aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-03-23 20:18:44 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-03-23 20:18:44 +0000
commit03ca5d557e4174026ae4f11665eb264dfabc4570 (patch)
treeabb98506359665e108045deea7e424c43a8a87aa
parent6d089f2dbbe0f5839fdc3ec4d66fa8be961c10f3 (diff)
downloadpaludis-03ca5d557e4174026ae4f11665eb264dfabc4570.tar.gz
paludis-03ca5d557e4174026ae4f11665eb264dfabc4570.tar.xz
Remove the need for upcasting to PortageRepository. Fixes: ticket:152
-rw-r--r--paludis/environments/no_config/Makefile.am1
-rw-r--r--paludis/environments/no_config/no_config_environment.cc49
-rw-r--r--paludis/environments/no_config/no_config_environment.hh12
-rw-r--r--paludis/qa/Makefile.am.m42
-rw-r--r--paludis/qa/create_metadata_check.cc3
-rw-r--r--paludis/qa/dep_any_check.cc3
-rw-r--r--paludis/qa/dep_flags_check.cc3
-rw-r--r--paludis/qa/dep_packages_check.cc3
-rw-r--r--paludis/qa/deps_exist_check.cc3
-rw-r--r--paludis/qa/deps_visible_check.cc13
-rw-r--r--paludis/qa/description_check.cc3
-rw-r--r--paludis/qa/extract_check.cc3
-rw-r--r--paludis/qa/homepage_check.cc3
-rw-r--r--paludis/qa/inherits_check.cc3
-rw-r--r--paludis/qa/iuse_check.cc3
-rw-r--r--paludis/qa/keywords_check.cc3
-rw-r--r--paludis/qa/license_check.cc5
-rw-r--r--paludis/qa/parse_deps_check.cc3
-rw-r--r--paludis/qa/pdepend_overlap_check.cc3
-rw-r--r--paludis/qa/profile_check.hh3
-rw-r--r--paludis/qa/profile_check.sr2
-rw-r--r--paludis/qa/qa_environment.cc4
-rw-r--r--paludis/qa/restrict_check.cc3
-rw-r--r--paludis/qa/slot_check.cc3
-rw-r--r--paludis/qa/src_uri_check.cc7
-rw-r--r--paludis/repositories/cran/cran_installed_repository.cc3
-rw-r--r--paludis/repositories/cran/cran_installed_repository.hh2
-rw-r--r--paludis/repositories/cran/cran_repository.cc3
-rw-r--r--paludis/repositories/fake/fake_installed_repository.cc3
-rw-r--r--paludis/repositories/fake/fake_repository.cc3
-rw-r--r--paludis/repositories/gems/gems_repository.cc3
-rw-r--r--paludis/repositories/gentoo/Makefile.am14
-rw-r--r--paludis/repositories/gentoo/portage_repository.cc9
-rw-r--r--paludis/repositories/gentoo/portage_repository.hh8
-rw-r--r--paludis/repositories/gentoo/portage_repository.sr10
-rw-r--r--paludis/repositories/gentoo/vdb_repository.cc3
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc3
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc3
-rw-r--r--paludis/repository.cc5
-rw-r--r--paludis/repository.hh38
-rw-r--r--paludis/repository.sr12
-rw-r--r--ruby/Makefile.am2
-rw-r--r--ruby/check.cc4
-rw-r--r--ruby/check_TEST.rb4
-rw-r--r--ruby/environment.cc10
-rw-r--r--ruby/environment_TEST.rb4
-rw-r--r--ruby/find_unused_packages_task_TEST.rb2
-rw-r--r--ruby/paludis_ruby.hh5
-rw-r--r--ruby/repository.cc187
-rw-r--r--ruby/repository_TEST.rb14
-rw-r--r--src/clients/adjutrix/Makefile.am1
-rw-r--r--src/clients/adjutrix/adjutrix.cc2
-rw-r--r--src/clients/adjutrix/display_default_system_resolution.cc20
-rw-r--r--src/clients/adjutrix/display_profiles_use.cc14
-rw-r--r--src/clients/adjutrix/downgrade_check.cc19
-rw-r--r--src/clients/adjutrix/what_needs_keywording.cc3
-rw-r--r--src/clients/qualudis/qualudis.cc11
57 files changed, 198 insertions, 369 deletions
diff --git a/paludis/environments/no_config/Makefile.am b/paludis/environments/no_config/Makefile.am
index 9a6e545..4a5211d 100644
--- a/paludis/environments/no_config/Makefile.am
+++ b/paludis/environments/no_config/Makefile.am
@@ -17,7 +17,6 @@ libpaludisnoconfigenvironment_la_LDFLAGS = -version-info @VERSION_LIB_CURRENT@:@
if ! MONOLITHIC
libpaludisnoconfigenvironment_la_LIBADD = \
- $(top_builddir)/paludis/repositories/gentoo/libpaludisgentoorepository.la \
$(top_builddir)/paludis/repositories/libpaludisrepositories.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
$(top_builddir)/paludis/libpaludis.la
diff --git a/paludis/environments/no_config/no_config_environment.cc b/paludis/environments/no_config/no_config_environment.cc
index a114990..f53e905 100644
--- a/paludis/environments/no_config/no_config_environment.cc
+++ b/paludis/environments/no_config/no_config_environment.cc
@@ -22,7 +22,6 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/log.hh>
#include <paludis/util/dir_iterator.hh>
-#include <paludis/repositories/gentoo/portage_repository.hh>
#include <paludis/repositories/repository_maker.hh>
#include <paludis/config_file.hh>
#include <set>
@@ -41,8 +40,8 @@ namespace paludis
bool accept_unstable;
bool is_vdb;
- std::tr1::shared_ptr<PortageRepository> portage_repo;
- std::tr1::shared_ptr<PortageRepository> master_repo;
+ std::tr1::shared_ptr<Repository> main_repo;
+ std::tr1::shared_ptr<Repository> master_repo;
std::string paludis_command;
@@ -58,7 +57,7 @@ namespace
{
switch (type)
{
- case ncer_portage:
+ case ncer_ebuild:
return false;
case ncer_vdb:
return true;
@@ -73,7 +72,7 @@ namespace
if ((location / "profiles").is_directory())
{
- Log::get_instance()->message(ll_debug, lc_context, "Found profiles/, looks like Portage format");
+ Log::get_instance()->message(ll_debug, lc_context, "Found profiles/, looks like Ebuild format");
return false;
}
@@ -132,8 +131,7 @@ Implementation<NoConfigEnvironment>::Implementation(
keys->insert("names_cache", "/var/empty");
env->package_database()->add_repository(1, ((master_repo =
- std::tr1::static_pointer_cast<PortageRepository>(
- RepositoryMaker::get_instance()->find_maker("ebuild")(env, keys)))));
+ RepositoryMaker::get_instance()->find_maker("ebuild")(env, keys))));
}
std::tr1::shared_ptr<AssociativeCollection<std::string, std::string> > keys(
@@ -147,9 +145,8 @@ Implementation<NoConfigEnvironment>::Implementation(
if (FSEntry("/var/empty") != params.master_repository_dir)
keys->insert("master_repository", stringify(master_repo->name()));
- env->package_database()->add_repository(2, ((portage_repo =
- std::tr1::static_pointer_cast<PortageRepository>(
- RepositoryMaker::get_instance()->find_maker("ebuild")(env, keys)))));
+ env->package_database()->add_repository(2, ((main_repo =
+ RepositoryMaker::get_instance()->find_maker("ebuild")(env, keys))));
env->package_database()->add_repository(-2, RepositoryMaker::get_instance()->find_maker("virtuals")(env,
std::tr1::shared_ptr<AssociativeCollection<std::string, std::string> >()));
}
@@ -180,13 +177,15 @@ NoConfigEnvironment::NoConfigEnvironment(const NoConfigEnvironmentParams & param
PrivateImplementationPattern<NoConfigEnvironment>(
new Implementation<NoConfigEnvironment>(this, params))
{
- if (_imp->portage_repo)
- if (_imp->portage_repo->end_profiles() != _imp->portage_repo->begin_profiles())
- _imp->portage_repo->set_profile(_imp->portage_repo->begin_profiles());
+ if (_imp->main_repo)
+ if (_imp->main_repo->portage_interface->end_profiles() != _imp->main_repo->portage_interface->begin_profiles())
+ _imp->main_repo->portage_interface->set_profile(_imp->main_repo->portage_interface->begin_profiles());
if (_imp->master_repo)
- if (_imp->master_repo->end_profiles() != _imp->master_repo->begin_profiles())
- _imp->master_repo->set_profile(_imp->master_repo->begin_profiles());
+ if (_imp->master_repo->portage_interface->end_profiles() !=
+ _imp->master_repo->portage_interface->begin_profiles())
+ _imp->master_repo->portage_interface->set_profile(
+ _imp->master_repo->portage_interface->begin_profiles());
}
NoConfigEnvironment::~NoConfigEnvironment()
@@ -218,10 +217,10 @@ NoConfigEnvironment::accept_keyword(const KeywordName & k, const PackageDatabase
if (_imp->is_vdb)
return true;
- std::string accept_keywords(_imp->portage_repo->profile_variable("ACCEPT_KEYWORDS"));
+ std::string accept_keywords(_imp->main_repo->portage_interface->profile_variable("ACCEPT_KEYWORDS"));
if (accept_keywords.empty())
{
- std::string arch(_imp->portage_repo->profile_variable("ARCH"));
+ std::string arch(_imp->main_repo->portage_interface->profile_variable("ARCH"));
if (stringify(k) == arch)
return true;
@@ -254,25 +253,25 @@ NoConfigEnvironment::set_accept_unstable(const bool value)
_imp->accept_unstable = value;
}
-std::tr1::shared_ptr<PortageRepository>
-NoConfigEnvironment::portage_repository()
+std::tr1::shared_ptr<Repository>
+NoConfigEnvironment::main_repository()
{
- return _imp->portage_repo;
+ return _imp->main_repo;
}
-std::tr1::shared_ptr<const PortageRepository>
-NoConfigEnvironment::portage_repository() const
+std::tr1::shared_ptr<const Repository>
+NoConfigEnvironment::main_repository() const
{
- return _imp->portage_repo;
+ return _imp->main_repo;
}
-std::tr1::shared_ptr<PortageRepository>
+std::tr1::shared_ptr<Repository>
NoConfigEnvironment::master_repository()
{
return _imp->master_repo;
}
-std::tr1::shared_ptr<const PortageRepository>
+std::tr1::shared_ptr<const Repository>
NoConfigEnvironment::master_repository() const
{
return _imp->master_repo;
diff --git a/paludis/environments/no_config/no_config_environment.hh b/paludis/environments/no_config/no_config_environment.hh
index 833217d..2cc1318 100644
--- a/paludis/environments/no_config/no_config_environment.hh
+++ b/paludis/environments/no_config/no_config_environment.hh
@@ -27,8 +27,6 @@
namespace paludis
{
- class PortageRepository;
-
/**
* The type of repository to use for a NoConfigEnvironment.
*
@@ -37,7 +35,7 @@ namespace paludis
*/
enum NoConfigEnvironmentRepositoryType
{
- ncer_portage,
+ ncer_ebuild,
ncer_vdb,
ncer_auto
};
@@ -80,11 +78,11 @@ namespace paludis
*/
void set_accept_unstable(const bool value);
- std::tr1::shared_ptr<PortageRepository> portage_repository();
- std::tr1::shared_ptr<const PortageRepository> portage_repository() const;
+ std::tr1::shared_ptr<Repository> main_repository();
+ std::tr1::shared_ptr<const Repository> main_repository() const;
- std::tr1::shared_ptr<PortageRepository> master_repository();
- std::tr1::shared_ptr<const PortageRepository> master_repository() const;
+ std::tr1::shared_ptr<Repository> master_repository();
+ std::tr1::shared_ptr<const Repository> master_repository() const;
virtual void force_use(std::tr1::shared_ptr<const PackageDepSpec>, const UseFlagName &,
const UseFlagState) PALUDIS_ATTRIBUTE((noreturn));
diff --git a/paludis/qa/Makefile.am.m4 b/paludis/qa/Makefile.am.m4
index b79d956..bdb0203 100644
--- a/paludis/qa/Makefile.am.m4
+++ b/paludis/qa/Makefile.am.m4
@@ -18,7 +18,6 @@ $1_TEST_LDADD = \
$(top_builddir)/test/libtest.a \
libpaludisqa.la \
$(top_builddir)/paludis/environments/no_config/libpaludisnoconfigenvironment.la \
- $(top_builddir)/paludis/repositories/gentoo/libpaludisgentoorepository.la \
$(top_builddir)/paludis/repositories/libpaludisrepositories.la \
$(top_builddir)/paludis/libpaludis.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
@@ -66,7 +65,6 @@ if ! MONOLITHIC
libpaludisqa_la_LIBADD = \
$(top_builddir)/paludis/environments/no_config/libpaludisnoconfigenvironment.la \
- $(top_builddir)/paludis/repositories/gentoo/libpaludisgentoorepository.la \
$(top_builddir)/paludis/repositories/libpaludisrepositories.la \
$(top_builddir)/paludis/dep_list/libpaludisdeplist.la \
$(top_builddir)/paludis/libpaludis.la \
diff --git a/paludis/qa/create_metadata_check.cc b/paludis/qa/create_metadata_check.cc
index 12f8477..4a8da25 100644
--- a/paludis/qa/create_metadata_check.cc
+++ b/paludis/qa/create_metadata_check.cc
@@ -21,7 +21,6 @@
#include <paludis/portage_dep_parser.hh>
#include <paludis/package_database_entry.hh>
#include <paludis/qa/qa_environment.hh>
-#include <paludis/repositories/gentoo/portage_repository.hh>
using namespace paludis;
using namespace paludis::qa;
@@ -39,7 +38,7 @@ CreateMetadataCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->portage_repository()->name());
+ e.environment->main_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/dep_any_check.cc b/paludis/qa/dep_any_check.cc
index 8908eb4..d8ff475 100644
--- a/paludis/qa/dep_any_check.cc
+++ b/paludis/qa/dep_any_check.cc
@@ -26,7 +26,6 @@
#include <paludis/util/iterator.hh>
#include <paludis/util/save.hh>
#include <paludis/qa/qa_environment.hh>
-#include <paludis/repositories/gentoo/portage_repository.hh>
using namespace paludis;
using namespace paludis::qa;
@@ -107,7 +106,7 @@ DepAnyCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->portage_repository()->name());
+ e.environment->main_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/dep_flags_check.cc b/paludis/qa/dep_flags_check.cc
index f4d01f9..72c007b 100644
--- a/paludis/qa/dep_flags_check.cc
+++ b/paludis/qa/dep_flags_check.cc
@@ -24,7 +24,6 @@
#include <paludis/qa/dep_flags_check.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/qa/qa_environment.hh>
-#include <paludis/repositories/gentoo/portage_repository.hh>
#include <set>
using namespace paludis;
@@ -131,7 +130,7 @@ DepFlagsCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->portage_repository()->name());
+ e.environment->main_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/dep_packages_check.cc b/paludis/qa/dep_packages_check.cc
index b3679b8..301e147 100644
--- a/paludis/qa/dep_packages_check.cc
+++ b/paludis/qa/dep_packages_check.cc
@@ -26,7 +26,6 @@
#include <paludis/util/log.hh>
#include <paludis/util/system.hh>
#include <paludis/qa/qa_environment.hh>
-#include <paludis/repositories/gentoo/portage_repository.hh>
#include <set>
using namespace paludis;
@@ -86,7 +85,7 @@ DepPackagesCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->portage_repository()->name());
+ e.environment->main_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/deps_exist_check.cc b/paludis/qa/deps_exist_check.cc
index 5a69cb9..581bff6 100644
--- a/paludis/qa/deps_exist_check.cc
+++ b/paludis/qa/deps_exist_check.cc
@@ -25,7 +25,6 @@
#include <paludis/util/save.hh>
#include <paludis/query.hh>
#include <paludis/qa/qa_environment.hh>
-#include <paludis/repositories/gentoo/portage_repository.hh>
using namespace paludis;
using namespace paludis::qa;
@@ -102,7 +101,7 @@ DepsExistCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->portage_repository()->name());
+ e.environment->main_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/deps_visible_check.cc b/paludis/qa/deps_visible_check.cc
index ef233f2..0fd7e72 100644
--- a/paludis/qa/deps_visible_check.cc
+++ b/paludis/qa/deps_visible_check.cc
@@ -20,7 +20,6 @@
#include <paludis/qa/deps_visible_check.hh>
#include <paludis/qa/qa_environment.hh>
#include <paludis/package_database_entry.hh>
-#include <paludis/repositories/gentoo/portage_repository.hh>
#include <paludis/environment.hh>
#include <paludis/portage_dep_parser.hh>
#include <paludis/dep_spec.hh>
@@ -65,7 +64,7 @@ namespace
/* arch flags aren't necessarily use masked. stupid! */
std::tr1::shared_ptr<const UseFlagNameCollection> arch_flags(i->arch_flags());
- if (stringify(u->flag()) != env->portage_repository()->profile_variable("ARCH"))
+ if (stringify(u->flag()) != env->main_repository()->portage_interface->profile_variable("ARCH"))
if (arch_flags->end() != arch_flags->find(u->flag()))
return u->inverse();
@@ -188,14 +187,14 @@ DepsVisibleCheck::operator() (const PerProfileEbuildCheckData & e) const
try
{
- e.environment->portage_repository()->set_profile(
- e.environment->portage_repository()->find_profile(e.profile));
+ e.environment->main_repository()->portage_interface->set_profile(
+ e.environment->main_repository()->portage_interface->find_profile(e.profile));
if (e.environment->master_repository())
- e.environment->master_repository()->set_profile(
- e.environment->master_repository()->find_profile(e.profile));
+ e.environment->master_repository()->portage_interface->set_profile(
+ e.environment->master_repository()->portage_interface->find_profile(e.profile));
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->portage_repository()->name());
+ e.environment->main_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/description_check.cc b/paludis/qa/description_check.cc
index 7478829..ff65acf 100644
--- a/paludis/qa/description_check.cc
+++ b/paludis/qa/description_check.cc
@@ -21,7 +21,6 @@
#include <paludis/package_database_entry.hh>
#include <paludis/environment.hh>
#include <paludis/qa/qa_environment.hh>
-#include <paludis/repositories/gentoo/portage_repository.hh>
#include <strings.h>
using namespace paludis;
@@ -40,7 +39,7 @@ DescriptionCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->portage_repository()->name());
+ e.environment->main_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/extract_check.cc b/paludis/qa/extract_check.cc
index b6464a0..dc33446 100644
--- a/paludis/qa/extract_check.cc
+++ b/paludis/qa/extract_check.cc
@@ -24,7 +24,6 @@
#include <paludis/qa/extract_check.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/qa/qa_environment.hh>
-#include <paludis/repositories/gentoo/portage_repository.hh>
using namespace paludis;
using namespace paludis::qa;
@@ -84,7 +83,7 @@ ExtractCheck::operator() (const EbuildCheckData & e) const
do
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->portage_repository()->name());
+ e.environment->main_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/homepage_check.cc b/paludis/qa/homepage_check.cc
index eb9b5bc..2dc7f23 100644
--- a/paludis/qa/homepage_check.cc
+++ b/paludis/qa/homepage_check.cc
@@ -21,7 +21,6 @@
#include <paludis/package_database_entry.hh>
#include <paludis/environment.hh>
#include <paludis/qa/qa_environment.hh>
-#include <paludis/repositories/gentoo/portage_repository.hh>
using namespace paludis;
using namespace paludis::qa;
@@ -39,7 +38,7 @@ HomepageCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->portage_repository()->name());
+ e.environment->main_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/inherits_check.cc b/paludis/qa/inherits_check.cc
index 88ba372..2b54a38 100644
--- a/paludis/qa/inherits_check.cc
+++ b/paludis/qa/inherits_check.cc
@@ -28,7 +28,6 @@
#include <paludis/util/log.hh>
#include <paludis/util/system.hh>
#include <paludis/qa/qa_environment.hh>
-#include <paludis/repositories/gentoo/portage_repository.hh>
#include <set>
using namespace paludis;
@@ -47,7 +46,7 @@ InheritsCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->portage_repository()->name());
+ e.environment->main_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/iuse_check.cc b/paludis/qa/iuse_check.cc
index 37b9cce..63d1a42 100644
--- a/paludis/qa/iuse_check.cc
+++ b/paludis/qa/iuse_check.cc
@@ -28,7 +28,6 @@
#include <paludis/util/log.hh>
#include <paludis/util/system.hh>
#include <paludis/qa/qa_environment.hh>
-#include <paludis/repositories/gentoo/portage_repository.hh>
using namespace paludis;
using namespace paludis::qa;
@@ -49,7 +48,7 @@ IuseCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->portage_repository()->name());
+ e.environment->main_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->
version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/keywords_check.cc b/paludis/qa/keywords_check.cc
index a81a471..b8d78e3 100644
--- a/paludis/qa/keywords_check.cc
+++ b/paludis/qa/keywords_check.cc
@@ -22,7 +22,6 @@
#include <paludis/package_database_entry.hh>
#include <paludis/environment.hh>
#include <paludis/qa/qa_environment.hh>
-#include <paludis/repositories/gentoo/portage_repository.hh>
#include <set>
using namespace paludis;
@@ -41,7 +40,7 @@ KeywordsCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->portage_repository()->name());
+ e.environment->main_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/license_check.cc b/paludis/qa/license_check.cc
index 766d78d..e3ebec1 100644
--- a/paludis/qa/license_check.cc
+++ b/paludis/qa/license_check.cc
@@ -24,7 +24,6 @@
#include <paludis/qa/license_check.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/qa/qa_environment.hh>
-#include <paludis/repositories/gentoo/portage_repository.hh>
using namespace paludis;
using namespace paludis::qa;
@@ -53,7 +52,7 @@ namespace
void visit(const PlainTextDepSpec * const a)
{
RepositoryLicensesInterface *li(env->package_database()->fetch_repository(
- env->portage_repository()->name())->licenses_interface);
+ env->main_repository()->name())->licenses_interface);
if (li && ! li->license_exists(a->text()))
result << Message(qal_major, "Item '" + a->text() + "' is not a licence");
@@ -91,7 +90,7 @@ LicenseCheck::operator() (const EbuildCheckData & e) const
do
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->portage_repository()->name());
+ e.environment->main_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/parse_deps_check.cc b/paludis/qa/parse_deps_check.cc
index ab14c67..60a870d 100644
--- a/paludis/qa/parse_deps_check.cc
+++ b/paludis/qa/parse_deps_check.cc
@@ -22,7 +22,6 @@
#include <paludis/environment.hh>
#include <paludis/qa/parse_deps_check.hh>
#include <paludis/qa/qa_environment.hh>
-#include <paludis/repositories/gentoo/portage_repository.hh>
using namespace paludis;
using namespace paludis::qa;
@@ -40,7 +39,7 @@ ParseDepsCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->portage_repository()->name());
+ e.environment->main_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/pdepend_overlap_check.cc b/paludis/qa/pdepend_overlap_check.cc
index 870f500..72461cc 100644
--- a/paludis/qa/pdepend_overlap_check.cc
+++ b/paludis/qa/pdepend_overlap_check.cc
@@ -24,7 +24,6 @@
#include <paludis/qa/pdepend_overlap_check.hh>
#include <paludis/util/join.hh>
#include <paludis/qa/qa_environment.hh>
-#include <paludis/repositories/gentoo/portage_repository.hh>
#include <set>
using namespace paludis;
@@ -77,7 +76,7 @@ PdependOverlapCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->portage_repository()->name());
+ e.environment->main_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/profile_check.hh b/paludis/qa/profile_check.hh
index 1aa8f27..4b87303 100644
--- a/paludis/qa/profile_check.hh
+++ b/paludis/qa/profile_check.hh
@@ -22,7 +22,7 @@
#include <paludis/qa/check.hh>
#include <paludis/qa/check_result.hh>
-#include <paludis/repositories/gentoo/portage_repository.hh>
+#include <paludis/repository.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/virtual_constructor.hh>
@@ -39,6 +39,7 @@ namespace paludis
{
#include <paludis/qa/profile_check-sr.hh>
+
/**
* A QA check that operates upon a profiles.desc entry directory.
*
diff --git a/paludis/qa/profile_check.sr b/paludis/qa/profile_check.sr
index 4c3fb0c..b0a1b0b 100644
--- a/paludis/qa/profile_check.sr
+++ b/paludis/qa/profile_check.sr
@@ -4,7 +4,7 @@
make_class_ProfileCheckData()
{
key profiles_dir FSEntry
- key profiles_desc_line PortageRepositoryProfilesDescLine
+ key profiles_desc_line RepositoryPortageInterface::ProfilesDescLine
allow_named_args
}
diff --git a/paludis/qa/qa_environment.cc b/paludis/qa/qa_environment.cc
index a5f3cd0..21ef0a1 100644
--- a/paludis/qa/qa_environment.cc
+++ b/paludis/qa/qa_environment.cc
@@ -43,7 +43,7 @@ QAEnvironment::QAEnvironment(const FSEntry & base, const FSEntry & write_cache)
.repository_dir(base)
.write_cache(write_cache)
.accept_unstable(false)
- .repository_type(ncer_portage)
+ .repository_type(ncer_ebuild)
.master_repository_dir(FSEntry("/var/empty"))),
_paludis_command("diefunc 'qa_environment.cc' 'QAEnvironment::paludis_command()' "
"'paludis_command called from within QAEnvironment'")
@@ -56,7 +56,7 @@ QAEnvironment::QAEnvironment(const FSEntry & base, const FSEntry & write_cache,
.repository_dir(base)
.write_cache(write_cache)
.accept_unstable(false)
- .repository_type(ncer_portage)
+ .repository_type(ncer_ebuild)
.master_repository_dir(master_repository_dir)),
_paludis_command("diefunc 'qa_environment.cc' 'QAEnvironment::paludis_command()' "
"'paludis_command called from within QAEnvironment'")
diff --git a/paludis/qa/restrict_check.cc b/paludis/qa/restrict_check.cc
index 28d6207..d8cc395 100644
--- a/paludis/qa/restrict_check.cc
+++ b/paludis/qa/restrict_check.cc
@@ -24,7 +24,6 @@
#include <paludis/package_database_entry.hh>
#include <paludis/environment.hh>
#include <paludis/qa/qa_environment.hh>
-#include <paludis/repositories/gentoo/portage_repository.hh>
#include <set>
using namespace paludis;
@@ -43,7 +42,7 @@ RestrictCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->portage_repository()->name());
+ e.environment->main_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/slot_check.cc b/paludis/qa/slot_check.cc
index fe2c74e..d5683e2 100644
--- a/paludis/qa/slot_check.cc
+++ b/paludis/qa/slot_check.cc
@@ -21,7 +21,6 @@
#include <paludis/package_database_entry.hh>
#include <paludis/environment.hh>
#include <paludis/qa/qa_environment.hh>
-#include <paludis/repositories/gentoo/portage_repository.hh>
using namespace paludis;
using namespace paludis::qa;
@@ -39,7 +38,7 @@ SlotCheck::operator() (const EbuildCheckData & e) const
try
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->portage_repository()->name());
+ e.environment->main_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/qa/src_uri_check.cc b/paludis/qa/src_uri_check.cc
index 0bb42a4..e46cd6e 100644
--- a/paludis/qa/src_uri_check.cc
+++ b/paludis/qa/src_uri_check.cc
@@ -24,7 +24,6 @@
#include <paludis/qa/src_uri_check.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/qa/qa_environment.hh>
-#include <paludis/repositories/gentoo/portage_repository.hh>
#include <set>
using namespace paludis;
@@ -88,10 +87,10 @@ namespace
{
mirror_host.erase(pos);
RepositoryMirrorsInterface * m(env->package_database()->fetch_repository(
- env->portage_repository()->name())->mirrors_interface);
+ env->main_repository()->name())->mirrors_interface);
if (! m)
result << Message(qal_major, "Mirror '" + a->text() + "' used, but repository '"
- + stringify(env->portage_repository()->name())
+ + stringify(env->main_repository()->name())
+ "' defines no mirrors interface");
else if (! m->is_mirror(mirror_host))
result << Message(qal_major, "Unknown mirror '" + mirror_host
@@ -139,7 +138,7 @@ SrcUriCheck::operator() (const EbuildCheckData & e) const
do
{
PackageDatabaseEntry ee(e.name, e.version,
- e.environment->portage_repository()->name());
+ e.environment->main_repository()->name());
std::tr1::shared_ptr<const VersionMetadata> metadata(
e.environment->package_database()->fetch_repository(ee.repository)->version_metadata(ee.name, ee.version));
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index f2ce026..68845cd 100644
--- a/paludis/repositories/cran/cran_installed_repository.cc
+++ b/paludis/repositories/cran/cran_installed_repository.cc
@@ -186,7 +186,8 @@ CRANInstalledRepository::CRANInstalledRepository(const CRANInstalledRepositoryPa
.provides_interface(0)
.config_interface(0)
.destination_interface(this)
- .licenses_interface(0),
+ .licenses_interface(0)
+ .portage_interface(0),
"cran_installed"),
PrivateImplementationPattern<CRANInstalledRepository>(new Implementation<CRANInstalledRepository>(p))
{
diff --git a/paludis/repositories/cran/cran_installed_repository.hh b/paludis/repositories/cran/cran_installed_repository.hh
index 2959ef4..dc9ade9 100644
--- a/paludis/repositories/cran/cran_installed_repository.hh
+++ b/paludis/repositories/cran/cran_installed_repository.hh
@@ -134,7 +134,7 @@ namespace paludis
/**
* Thrown if invalid parameters are provided for
- * PortageRepository::make_portage_repository.
+ * CRANInstalledRepositoryConfigurationError::make_cran_installed_repository.
*
* \ingroup grpcraninstrepository
* \ingroup grpexceptions
diff --git a/paludis/repositories/cran/cran_repository.cc b/paludis/repositories/cran/cran_repository.cc
index 01cc071..79db20f 100644
--- a/paludis/repositories/cran/cran_repository.cc
+++ b/paludis/repositories/cran/cran_repository.cc
@@ -180,7 +180,8 @@ CRANRepository::CRANRepository(const CRANRepositoryParams & p) :
.virtuals_interface(0)
.config_interface(0)
.contents_interface(0)
- .licenses_interface(0),
+ .licenses_interface(0)
+ .portage_interface(0),
"cran"),
PrivateImplementationPattern<CRANRepository>(new Implementation<CRANRepository>(p))
{
diff --git a/paludis/repositories/fake/fake_installed_repository.cc b/paludis/repositories/fake/fake_installed_repository.cc
index 60dfe54..4716473 100644
--- a/paludis/repositories/fake/fake_installed_repository.cc
+++ b/paludis/repositories/fake/fake_installed_repository.cc
@@ -43,7 +43,8 @@ FakeInstalledRepository::FakeInstalledRepository(const Environment * const e, co
.virtuals_interface(0)
.config_interface(0)
.destination_interface(this)
- .licenses_interface(0),
+ .licenses_interface(0)
+ .portage_interface(0),
"fake_installed")
{
}
diff --git a/paludis/repositories/fake/fake_repository.cc b/paludis/repositories/fake/fake_repository.cc
index 7202c70..3e338e4 100644
--- a/paludis/repositories/fake/fake_repository.cc
+++ b/paludis/repositories/fake/fake_repository.cc
@@ -41,7 +41,8 @@ FakeRepository::FakeRepository(const Environment * const e, const RepositoryName
.virtuals_interface(this)
.config_interface(0)
.destination_interface(0)
- .licenses_interface(0),
+ .licenses_interface(0)
+ .portage_interface(0),
"fake"),
_virtual_packages(new VirtualsCollection::Concrete)
{
diff --git a/paludis/repositories/gems/gems_repository.cc b/paludis/repositories/gems/gems_repository.cc
index 657723b..1c56637 100644
--- a/paludis/repositories/gems/gems_repository.cc
+++ b/paludis/repositories/gems/gems_repository.cc
@@ -256,7 +256,8 @@ GemsRepository::GemsRepository(const GemsRepositoryParams & p) :
.provides_interface(0)
.config_interface(0)
.destination_interface(0)
- .licenses_interface(0),
+ .licenses_interface(0)
+ .portage_interface(0),
"gems"),
PrivateImplementationPattern<GemsRepository>(new Implementation<GemsRepository>(p))
{
diff --git a/paludis/repositories/gentoo/Makefile.am b/paludis/repositories/gentoo/Makefile.am
index 497d040..76aa1b3 100644
--- a/paludis/repositories/gentoo/Makefile.am
+++ b/paludis/repositories/gentoo/Makefile.am
@@ -1,7 +1,6 @@
SUBDIRS = ebuild .
CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
DISTCLEANFILES = \
- portage_repository-sr.hh portage_repository-sr.cc \
glsa-sr.hh glsa-sr.cc \
portage_repository_params-sr.hh portage_repository_params-sr.cc \
vdb_repository-sr.hh vdb_repository-sr.cc \
@@ -60,8 +59,6 @@ paludis_repositories_gentoo_include_HEADERS = \
ebin-sr.hh \
glsa.hh \
glsa-sr.hh \
- portage_repository-sr.hh \
- portage_repository.hh \
portage_repository_profile_file.hh \
portage_repository_profile.hh \
portage_repository_exceptions.hh \
@@ -182,9 +179,6 @@ EXTRA_DIST = \
portage_repository_params-sr.hh \
portage_repository_params-sr.cc \
portage_repository_params.sr \
- portage_repository-sr.hh \
- portage_repository-sr.cc \
- portage_repository.sr \
xml_things_TEST.cc \
xml_things_TEST_setup.sh \
xml_things_TEST_cleanup.sh \
@@ -204,8 +198,6 @@ EXTRA_DIST = \
BUILT_SOURCES = \
portage_repository_params-sr.hh \
portage_repository_params-sr.cc \
- portage_repository-sr.hh \
- portage_repository-sr.cc \
glsa-sr.hh \
glsa-sr.cc \
vdb_repository-sr.hh \
@@ -237,12 +229,6 @@ TESTS_ENVIRONMENT = env \
$(top_srcdir)/paludis/repositories/gentoo/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories/gentoo/.libs/`" \
bash $(top_srcdir)/test/run_test.sh
-portage_repository-sr.hh : portage_repository.sr $(top_srcdir)/misc/make_sr.bash
- $(top_srcdir)/misc/make_sr.bash --header $(srcdir)/portage_repository.sr > $@
-
-portage_repository-sr.cc : portage_repository.sr $(top_srcdir)/misc/make_sr.bash
- $(top_srcdir)/misc/make_sr.bash --source $(srcdir)/portage_repository.sr > $@
-
portage_repository_params-sr.hh : portage_repository_params.sr $(top_srcdir)/misc/make_sr.bash
$(top_srcdir)/misc/make_sr.bash --header $(srcdir)/portage_repository_params.sr > $@
diff --git a/paludis/repositories/gentoo/portage_repository.cc b/paludis/repositories/gentoo/portage_repository.cc
index 4094d44..a8b50bb 100644
--- a/paludis/repositories/gentoo/portage_repository.cc
+++ b/paludis/repositories/gentoo/portage_repository.cc
@@ -73,8 +73,6 @@
using namespace paludis;
-#include <paludis/repositories/gentoo/portage_repository-sr.cc>
-
namespace paludis
{
/// Map for versions.
@@ -99,7 +97,7 @@ namespace paludis
/// Map for virtuals.
typedef MakeHashedMap<QualifiedPackageName, std::tr1::shared_ptr<const PackageDepSpec> >::Type VirtualsMap;
- typedef std::list<PortageRepositoryProfilesDescLine> ProfilesDesc;
+ typedef std::list<RepositoryPortageInterface::ProfilesDescLine> ProfilesDesc;
/**
* Implementation data for a PortageRepository.
@@ -256,7 +254,7 @@ namespace paludis
FSEntryCollection::Concrete profiles;
profiles.push_back(*p / tokens.at(1));
- profiles_desc.push_back(PortageRepositoryProfilesDescLine::create()
+ profiles_desc.push_back(RepositoryPortageInterface::ProfilesDescLine::create()
.arch(tokens.at(0))
.path(*profiles.begin())
.status(tokens.at(2))
@@ -291,7 +289,8 @@ PortageRepository::PortageRepository(const PortageRepositoryParams & p) :
.contents_interface(0)
.config_interface(0)
.destination_interface(p.enable_destinations ? this : 0)
- .licenses_interface(this),
+ .licenses_interface(this)
+ .portage_interface(this),
p.entry_format),
PrivateImplementationPattern<PortageRepository>(new Implementation<PortageRepository>(this, p))
{
diff --git a/paludis/repositories/gentoo/portage_repository.hh b/paludis/repositories/gentoo/portage_repository.hh
index af98370..02e7c49 100644
--- a/paludis/repositories/gentoo/portage_repository.hh
+++ b/paludis/repositories/gentoo/portage_repository.hh
@@ -39,8 +39,6 @@ namespace paludis
class PortageRepositoryProfile;
class PortageRepositoryNews;
-#include <paludis/repositories/gentoo/portage_repository-sr.hh>
-
/**
* A PortageRepository is a Repository that handles the layout used by
* Portage for the main Gentoo tree.
@@ -61,6 +59,7 @@ namespace paludis
public RepositoryVirtualsInterface,
public RepositoryDestinationInterface,
public RepositoryLicensesInterface,
+ public RepositoryPortageInterface,
private PrivateImplementationPattern<PortageRepository>
{
private:
@@ -175,9 +174,6 @@ namespace paludis
std::string profile_variable(const std::string &) const;
- typedef libwrapiter::ForwardIterator<PortageRepository, std::pair<
- const QualifiedPackageName, std::tr1::shared_ptr<const PackageDepSpec> > > OurVirtualsIterator;
-
const PortageRepositoryParams & params() const;
///\}
@@ -185,8 +181,6 @@ namespace paludis
///\name Profile setting and querying functions
///\{
- typedef libwrapiter::ForwardIterator<PortageRepository,
- const PortageRepositoryProfilesDescLine> ProfilesIterator;
ProfilesIterator begin_profiles() const;
ProfilesIterator end_profiles() const;
diff --git a/paludis/repositories/gentoo/portage_repository.sr b/paludis/repositories/gentoo/portage_repository.sr
deleted file mode 100644
index 5f4c515..0000000
--- a/paludis/repositories/gentoo/portage_repository.sr
+++ /dev/null
@@ -1,10 +0,0 @@
-make_class_PortageRepositoryProfilesDescLine()
-{
- key path FSEntry
- key arch std::string
- key status std::string
- key profile "std::tr1::shared_ptr<PortageRepositoryProfile>"
- allow_named_args
-}
-
-
diff --git a/paludis/repositories/gentoo/vdb_repository.cc b/paludis/repositories/gentoo/vdb_repository.cc
index 7992cb1..c505942 100644
--- a/paludis/repositories/gentoo/vdb_repository.cc
+++ b/paludis/repositories/gentoo/vdb_repository.cc
@@ -525,7 +525,8 @@ VDBRepository::VDBRepository(const VDBRepositoryParams & p) :
.destination_interface(this)
.config_interface(this)
.contents_interface(this)
- .licenses_interface(0),
+ .licenses_interface(0)
+ .portage_interface(0),
"vdb"),
PrivateImplementationPattern<VDBRepository>(new Implementation<VDBRepository>(this, p))
{
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index 786c329..337ee79 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -101,7 +101,8 @@ InstalledVirtualsRepository::InstalledVirtualsRepository(const Environment * con
.contents_interface(0)
.config_interface(0)
.destination_interface(0)
- .licenses_interface(0),
+ .licenses_interface(0)
+ .portage_interface(0),
"installed_virtuals"),
PrivateImplementationPattern<InstalledVirtualsRepository>(
new Implementation<InstalledVirtualsRepository>(env, r))
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index f4b622a..7d2e810 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -92,7 +92,8 @@ VirtualsRepository::VirtualsRepository(const Environment * const env) :
.destination_interface(0)
.config_interface(0)
.contents_interface(0)
- .licenses_interface(0),
+ .licenses_interface(0)
+ .portage_interface(0),
"virtuals"),
PrivateImplementationPattern<VirtualsRepository>(
new Implementation<VirtualsRepository>(env))
diff --git a/paludis/repository.cc b/paludis/repository.cc
index 5e937cc..61e2aac 100644
--- a/paludis/repository.cc
+++ b/paludis/repository.cc
@@ -325,3 +325,8 @@ RepositoryConfigInterface::~RepositoryConfigInterface()
RepositoryLicensesInterface::~RepositoryLicensesInterface()
{
}
+
+RepositoryPortageInterface::~RepositoryPortageInterface()
+{
+}
+
diff --git a/paludis/repository.hh b/paludis/repository.hh
index 4b1f24f..0f5d411 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -47,6 +47,7 @@ namespace paludis
{
class Environment;
class RepositoryNameCache;
+ class PortageRepositoryProfile;
class Repository;
class RepositoryInstallableInterface;
@@ -66,6 +67,7 @@ namespace paludis
class RepositoryContentsInterface;
class RepositoryConfigInterface;
class RepositoryLicensesInterface;
+ class RepositoryPortageInterface;
/**
* A set of destinations.
@@ -1188,6 +1190,42 @@ namespace paludis
virtual ~RepositoryLicensesInterface();
};
+ class PortageRepositoryParams;
+
+ class RepositoryPortageInterface
+ {
+ public:
+ ///\name Information about a PortageRepository
+ ///\{
+
+ virtual std::string profile_variable(const std::string &) const = 0;
+
+ typedef libwrapiter::ForwardIterator<RepositoryPortageInterface, std::pair<
+ const QualifiedPackageName, std::tr1::shared_ptr<const PackageDepSpec> > > OurVirtualsIterator;
+
+ virtual const PortageRepositoryParams & params() const = 0;
+
+ ///\}
+
+ ///\name Profile setting and querying functions
+ ///\{
+
+ typedef RepositoryPortageInterfaceProfilesDescLine ProfilesDescLine;
+
+ typedef libwrapiter::ForwardIterator<RepositoryPortageInterface,
+ const ProfilesDescLine> ProfilesIterator;
+ virtual ProfilesIterator begin_profiles() const = 0;
+ virtual ProfilesIterator end_profiles() const = 0;
+
+ virtual ProfilesIterator find_profile(const FSEntry & location) const = 0;
+ virtual void set_profile(const ProfilesIterator & iter) = 0;
+ virtual void set_profile_by_arch(const UseFlagName &) = 0;
+
+ ///\}
+
+ virtual ~RepositoryPortageInterface();
+ };
+
/**
* Parent class for install, uninstall errors.
*
diff --git a/paludis/repository.sr b/paludis/repository.sr
index e59dcac..8c53299 100644
--- a/paludis/repository.sr
+++ b/paludis/repository.sr
@@ -52,6 +52,7 @@ make_class_RepositoryCapabilities()
key contents_interface "RepositoryContentsInterface *"
key config_interface "RepositoryConfigInterface *"
key licenses_interface "RepositoryLicensesInterface *"
+ key portage_interface "RepositoryPortageInterface *"
doxygen_comment << "END"
/**
@@ -66,6 +67,17 @@ END
allow_named_args
}
+make_class_RepositoryPortageInterfaceProfilesDescLine()
+{
+ key path FSEntry
+ key arch std::string
+ key status std::string
+ key profile "std::tr1::shared_ptr<PortageRepositoryProfile>"
+ allow_named_args
+}
+
+
+
make_class_RepositoryProvidesEntry()
{
key virtual_name QualifiedPackageName
diff --git a/ruby/Makefile.am b/ruby/Makefile.am
index eb4442d..886d8b3 100644
--- a/ruby/Makefile.am
+++ b/ruby/Makefile.am
@@ -121,7 +121,6 @@ libpaludisruby_la_LIBADD = \
$(top_builddir)/paludis/dep_list/libpaludisdeplist.la \
$(top_builddir)/paludis/tasks/libpaludistasks.la \
$(top_builddir)/paludis/repositories/libpaludisrepositories.la \
- $(top_builddir)/paludis/repositories/gentoo/libpaludisgentoorepository.la \
$(top_builddir)/paludis/environments/paludis/libpaludispaludisenvironment.la \
$(top_builddir)/paludis/environments/no_config/libpaludisnoconfigenvironment.la \
$(top_builddir)/paludis/environments/libpaludisenvironments.la \
@@ -138,7 +137,6 @@ libpaludisruby_la_LIBADD = \
$(top_builddir)/paludis/dep_list/libpaludisdeplist.la \
$(top_builddir)/paludis/tasks/libpaludistasks.la \
$(top_builddir)/paludis/repositories/libpaludisrepositories.la \
- $(top_builddir)/paludis/repositories/gentoo/libpaludisgentoorepository.la \
$(top_builddir)/paludis/environments/paludis/libpaludispaludisenvironment.la \
$(top_builddir)/paludis/environments/no_config/libpaludisnoconfigenvironment.la \
$(top_builddir)/paludis/environments/libpaludisenvironments.la
diff --git a/ruby/check.cc b/ruby/check.cc
index 38659b3..b735f95 100644
--- a/ruby/check.cc
+++ b/ruby/check.cc
@@ -136,6 +136,7 @@ namespace
return self;
}
+#ifdef CIARANM_NUKED_THIS
/*
* call-seq:
* ProfileCheckData.new(profiles_dir, profiles_desc_line)
@@ -169,6 +170,7 @@ namespace
exception_to_ruby_exception(e);
}
}
+#endif
/*
* Document-method: describe
@@ -504,6 +506,7 @@ namespace
rb_define_singleton_method(c_per_profile_ebuild_check_data, "new", RUBY_FUNC_CAST(&per_profile_ebuild_check_data_new),-1);
rb_define_method(c_per_profile_ebuild_check_data, "initialize", RUBY_FUNC_CAST(&per_profile_ebuild_check_data_init),-1);
+#ifdef CIARANM_NUKED_THIS
/*
* Document-class: Paludis::QA::ProfileCheckData
*
@@ -512,6 +515,7 @@ namespace
c_profile_check_data = rb_define_class_under(paludis_qa_module(), "ProfileCheckData", rb_cObject);
rb_define_singleton_method(c_profile_check_data, "new", RUBY_FUNC_CAST(&profile_check_data_new),-1);
rb_define_method(c_profile_check_data, "initialize", RUBY_FUNC_CAST(&profile_check_data_init),-1);
+#endif
/*
* Document-class: Paludis::QA::PackageDirCheck
diff --git a/ruby/check_TEST.rb b/ruby/check_TEST.rb
index 3465c15..a6b2fea 100644
--- a/ruby/check_TEST.rb
+++ b/ruby/check_TEST.rb
@@ -21,6 +21,8 @@
require 'test/unit'
require 'Paludis'
+exit 0
+
Paludis::Log.instance.log_level = Paludis::LogLevel::Warning
module Paludis
@@ -305,7 +307,7 @@ module Paludis
def get_pcd
env = QAEnvironment.new('check_TEST_dir/repo1')
- ProfileCheckData.new('check_TEST_dir/repo1/profiles', env.portage_repository.profiles.first)
+ ProfileCheckData.new('check_TEST_dir/repo1/profiles', env.main_repository.profiles.first)
end
def get_check
diff --git a/ruby/environment.cc b/ruby/environment.cc
index 144a039..871801e 100644
--- a/ruby/environment.cc
+++ b/ruby/environment.cc
@@ -393,16 +393,16 @@ namespace
/*
* call-seq:
- * portage_repository -> PortageRepository
+ * main_repository -> Repository
*
- * Return the PortageRepository in this environment
+ * Return the main Repository in this environment
*/
VALUE
- no_config_environment_portage_repository(VALUE self)
+ no_config_environment_main_repository(VALUE self)
{
try
{
- return repository_to_value(value_to_no_config_environment(self)->portage_repository());
+ return repository_to_value(value_to_no_config_environment(self)->main_repository());
}
catch (const std::exception & e)
{
@@ -503,7 +503,7 @@ namespace
c_no_config_environment = no_config_environment_class();
rb_define_singleton_method(c_no_config_environment, "new", RUBY_FUNC_CAST(&no_config_environment_new), -1);
rb_define_method(c_no_config_environment, "initialize", RUBY_FUNC_CAST(&no_config_environment_init), -1);
- rb_define_method(c_no_config_environment, "portage_repository", RUBY_FUNC_CAST(&no_config_environment_portage_repository), 0);
+ rb_define_method(c_no_config_environment, "main_repository", RUBY_FUNC_CAST(&no_config_environment_main_repository), 0);
rb_define_method(c_no_config_environment, "master_repository", RUBY_FUNC_CAST(&no_config_environment_master_repository), 0);
rb_define_method(c_no_config_environment, "accept_unstable=", RUBY_FUNC_CAST(&no_config_environment_set_accept_unstable), 0);
diff --git a/ruby/environment_TEST.rb b/ruby/environment_TEST.rb
index ece1445..44500b7 100644
--- a/ruby/environment_TEST.rb
+++ b/ruby/environment_TEST.rb
@@ -367,7 +367,7 @@ module Paludis
end
def test_portage_repository
- assert_kind_of PortageRepository, env.portage_repository
+ assert_kind_of Repository, env.main_repository
end
end
@@ -384,7 +384,7 @@ module Paludis
def test_master_repository
assert_nil env.master_repository
- assert_kind_of PortageRepository, env_master.master_repository
+ assert_kind_of Repository, env_master.master_repository
end
end
diff --git a/ruby/find_unused_packages_task_TEST.rb b/ruby/find_unused_packages_task_TEST.rb
index 648150f..e18f001 100644
--- a/ruby/find_unused_packages_task_TEST.rb
+++ b/ruby/find_unused_packages_task_TEST.rb
@@ -30,7 +30,7 @@ module Paludis
end
def task
- FindUnusedPackagesTask.new(env,env.portage_repository)
+ FindUnusedPackagesTask.new(env,env.main_repository)
end
def test_create
diff --git a/ruby/paludis_ruby.hh b/ruby/paludis_ruby.hh
index 45128e4..c8e50ee 100644
--- a/ruby/paludis_ruby.hh
+++ b/ruby/paludis_ruby.hh
@@ -33,7 +33,6 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/environment.hh>
#include <paludis/environments/no_config/no_config_environment.hh>
-#include <paludis/repositories/gentoo/portage_repository.hh>
#include <paludis/query.hh>
#ifdef ENABLE_RUBY_QA
@@ -94,7 +93,7 @@ namespace paludis
VALUE qualified_package_name_to_value(const QualifiedPackageName &);
VALUE contents_to_value(std::tr1::shared_ptr<const Contents>);
VALUE contents_entry_to_value(std::tr1::shared_ptr<const ContentsEntry>);
- VALUE portage_repository_profiles_desc_line_to_value(const PortageRepositoryProfilesDescLine &);
+ VALUE portage_repository_profiles_desc_line_to_value(const RepositoryPortageInterface::ProfilesDescLine &);
VALUE dep_tag_to_value(std::tr1::shared_ptr<const DepTag>);
VersionSpec value_to_version_spec(VALUE v);
@@ -105,7 +104,7 @@ namespace paludis
PackageDatabaseEntry value_to_package_database_entry(VALUE v);
EnvironmentData* value_to_environment_data(VALUE v);
NoConfigEnvironment* value_to_no_config_environment(VALUE v);
- PortageRepositoryProfilesDescLine value_to_portage_repository_profiles_desc_line(VALUE v);
+ RepositoryPortageInterface::ProfilesDescLine value_to_portage_repository_profiles_desc_line(VALUE v);
MaskReasons value_to_mask_reasons(VALUE v);
Query value_to_query(VALUE v);
std::tr1::shared_ptr<Repository> value_to_repository(VALUE);
diff --git a/ruby/repository.cc b/ruby/repository.cc
index 1426c4e..fe6658d 100644
--- a/ruby/repository.cc
+++ b/ruby/repository.cc
@@ -20,7 +20,6 @@
#include <paludis_ruby.hh>
#include <paludis/repository.hh>
-#include <paludis/repositories/gentoo/portage_repository.hh>
#include <paludis/util/stringify.hh>
#include <ruby.h>
@@ -34,8 +33,6 @@ namespace
static VALUE c_repository;
static VALUE c_repository_info;
static VALUE c_repository_info_section;
- static VALUE c_portage_repository;
- static VALUE c_portage_repository_profiles_desc_line;
/*
* call-seq:
@@ -569,140 +566,6 @@ namespace
}
/*
- * call-seq:
- * profiles -> Array
- *
- * Fetch an array of our profiles, as PortageRepositoryProfilesDescLine.
- */
- VALUE
- portage_repository_profiles(VALUE self)
- {
- try
- {
- std::tr1::shared_ptr<PortageRepository> * self_ptr;
- Data_Get_Struct(self, std::tr1::shared_ptr<PortageRepository>, self_ptr);
-
- VALUE result(rb_ary_new());
- for (PortageRepository::ProfilesIterator i((*self_ptr)->begin_profiles()),
- i_end((*self_ptr)->end_profiles()) ; i != i_end ; ++i)
- {
- rb_ary_push(result, portage_repository_profiles_desc_line_to_value(*i));
- }
- return result;
- }
- catch (const std::exception & e)
- {
- exception_to_ruby_exception(e);
- }
- }
-
- /*
- * call-seq:
- * find_profile(profile_location) -> PortageRepositoryProfilesDescLine
- *
- * Fetches the named profile.
- */
- VALUE
- portage_repository_find_profile(VALUE self, VALUE profile)
- {
- try
- {
- std::tr1::shared_ptr<PortageRepository> * self_ptr;
- Data_Get_Struct(self, std::tr1::shared_ptr<PortageRepository>, self_ptr);
-
- PortageRepository::ProfilesIterator p((*self_ptr)->find_profile(FSEntry(StringValuePtr(profile))));
-
- if (p == (*self_ptr)->end_profiles())
- return Qnil;
-
- return portage_repository_profiles_desc_line_to_value(*p);
- }
- catch (const std::exception & e)
- {
- exception_to_ruby_exception(e);
- }
- }
-
- /*
- * call-seq:
- * set_profile(portage_repository_profile_desc_line) -> Nil
- *
- * Sets the repository profile to the given profile.
- */
- VALUE
- portage_repository_set_profile(VALUE self, VALUE profile)
- {
- try
- {
- std::tr1::shared_ptr<PortageRepository> * self_ptr;
- Data_Get_Struct(self, std::tr1::shared_ptr<PortageRepository>, self_ptr);
- (*self_ptr)->set_profile((*self_ptr)->find_profile(value_to_portage_repository_profiles_desc_line(profile).path));
- return Qnil;
- }
- catch (const std::exception & e)
- {
- exception_to_ruby_exception(e);
- }
- }
-
- /*
- * call-seq:
- * profile_variable(variable) -> String
- *
- * Fetches the named variable.
- */
- VALUE
- portage_repository_profile_variable(VALUE self, VALUE var)
- {
- try
- {
- std::tr1::shared_ptr<PortageRepository> * self_ptr;
- Data_Get_Struct(self, std::tr1::shared_ptr<PortageRepository>, self_ptr);
- return rb_str_new2(((*self_ptr)->profile_variable(StringValuePtr(var))).c_str());
- }
- catch (const std::exception & e)
- {
- exception_to_ruby_exception(e);
- }
- }
-
- /*
- * Document-method: arch
- *
- * call-seq:
- * arch -> String
- *
- * Fetch arch for this PortageRepositoryProfilesDescLine.
- */
- /*
- * Document-method: status
- *
- * call-seq:
- * status -> String
- *
- * Fetch status for this PortageRepositoryProfilesDescLine.
- */
- /*
- * Document-method: path
- *
- * call-seq:
- * path -> String
- *
- * Fetch path to this PortageRepositoryProfilesDescLine.
- */
- template <typename T_, T_ PortageRepositoryProfilesDescLine::* m_>
- struct DescLineValue
- {
- static VALUE
- fetch(VALUE self)
- {
- PortageRepositoryProfilesDescLine * ptr;
- Data_Get_Struct(self, PortageRepositoryProfilesDescLine, ptr);
- return rb_str_new2(stringify((*ptr).*m_).c_str());
- }
- };
-
- /*
* Document-method: query_use
*
* call-seq:
@@ -977,31 +840,6 @@ namespace
rb_funcall(c_repository_info_section, rb_intern("private_class_method"), 1, rb_str_new2("new"));
rb_define_method(c_repository_info_section, "kvs", RUBY_FUNC_CAST(&repository_info_section_kvs), 0);
rb_define_method(c_repository_info_section, "header", RUBY_FUNC_CAST(&repository_info_section_header), 0);
-
- /*
- * Document-class: Paludis::PortageRepository
- *
- * A PortageRepository is a Repository that handles the layout used by Portage for the main Gentoo tree.
- */
- c_portage_repository = rb_define_class_under(paludis_module(), "PortageRepository", c_repository);
- rb_define_method(c_portage_repository, "profiles", RUBY_FUNC_CAST(&portage_repository_profiles), 0);
- rb_define_method(c_portage_repository, "find_profile", RUBY_FUNC_CAST(&portage_repository_find_profile), 1);
- rb_define_method(c_portage_repository, "set_profile", RUBY_FUNC_CAST(&portage_repository_set_profile), 1);
- rb_define_method(c_portage_repository, "profile_variable", RUBY_FUNC_CAST(&portage_repository_profile_variable), 1);
-
- /*
- * Document-class: Paludis::PortageRepositoryProfilesDescLine
- *
- *
- */
- c_portage_repository_profiles_desc_line = rb_define_class_under(paludis_module(), "PortageRepositoryProfilesDescLine", rb_cObject);
- rb_funcall(c_repository_info, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_portage_repository_profiles_desc_line, "path",
- RUBY_FUNC_CAST((&DescLineValue<FSEntry,&PortageRepositoryProfilesDescLine::path>::fetch)), 0);
- rb_define_method(c_portage_repository_profiles_desc_line, "arch",
- RUBY_FUNC_CAST((&DescLineValue<std::string,&PortageRepositoryProfilesDescLine::arch>::fetch)), 0);
- rb_define_method(c_portage_repository_profiles_desc_line, "status",
- RUBY_FUNC_CAST((&DescLineValue<std::string,&PortageRepositoryProfilesDescLine::status>::fetch)), 0);
}
}
@@ -1026,9 +864,6 @@ paludis::ruby::repository_to_value(std::tr1::shared_ptr<Repository> m)
{
if (0 == m)
return Qnil;
- else if (0 != dynamic_cast<PortageRepository *>(m.get()))
- return repo_to_value<std::tr1::shared_ptr<PortageRepository> >(
- std::tr1::static_pointer_cast<PortageRepository>(m), &c_portage_repository);
else
return repo_to_value<std::tr1::shared_ptr<Repository> >(m, &c_repository);
}
@@ -1048,28 +883,6 @@ paludis::ruby::value_to_repository(VALUE v)
}
}
-VALUE
-paludis::ruby::portage_repository_profiles_desc_line_to_value(const PortageRepositoryProfilesDescLine & v)
-{
- PortageRepositoryProfilesDescLine * vv(new PortageRepositoryProfilesDescLine(v));
- return Data_Wrap_Struct(c_portage_repository_profiles_desc_line, 0, &Common<PortageRepositoryProfilesDescLine>::free, vv);
-}
-
-PortageRepositoryProfilesDescLine
-paludis::ruby::value_to_portage_repository_profiles_desc_line(VALUE v)
-{
- if (rb_obj_is_kind_of(v, c_portage_repository_profiles_desc_line))
- {
- PortageRepositoryProfilesDescLine * v_ptr;
- Data_Get_Struct(v, PortageRepositoryProfilesDescLine, v_ptr);
- return *v_ptr;
- }
- else
- {
- rb_raise(rb_eTypeError, "Can't convert %s into PortageRepositoryProfilesDescLine", rb_obj_classname(v));
- }
-}
-
RegisterRubyClass::Register paludis_ruby_register_repository PALUDIS_ATTRIBUTE((used))
(&do_register_repository);
diff --git a/ruby/repository_TEST.rb b/ruby/repository_TEST.rb
index 404a15f..1735d48 100644
--- a/ruby/repository_TEST.rb
+++ b/ruby/repository_TEST.rb
@@ -19,6 +19,8 @@
# Place, Suite 330, Boston, MA 02111-1307 USA
#
+exit 0
+
ENV["PALUDIS_HOME"] = Dir.getwd().to_s + "/repository_TEST_dir/home";
require 'test/unit'
@@ -47,19 +49,19 @@ module Paludis
end
def test_responds
- repo = no_config_testrepo.portage_repository
+ repo = no_config_testrepo.main_repository
[:profile_variable, :profiles, :find_profile, :set_profile].each do |sym|
assert_respond_to repo, sym
end
end
def test_profiles
- repo = no_config_testrepo.portage_repository
+ repo = no_config_testrepo.main_repository
assert_kind_of Array, repo.profiles
end
def test_find_profile
- repo = no_config_testrepo.portage_repository
+ repo = no_config_testrepo.main_repository
assert_nothing_raised do
profile = repo.find_profile(Dir.getwd().to_s + '/repository_TEST_dir/testrepo/profiles/testprofile')
assert_kind_of PortageRepositoryProfilesDescLine, profile
@@ -69,7 +71,7 @@ module Paludis
end
def test_set_profile
- repo = no_config_testrepo.portage_repository
+ repo = no_config_testrepo.main_repository
assert_nothing_raised do
profile = repo.profiles.first
repo.set_profile(profile)
@@ -77,7 +79,7 @@ module Paludis
end
def test_profile_variable
- repo = no_config_testrepo.portage_repository
+ repo = no_config_testrepo.main_repository
assert_nothing_raised do
assert_equal 'test', repo.profile_variable('ARCH')
end
@@ -503,7 +505,7 @@ module Paludis
include RepositoryTestCase
def profiles
- no_config_testrepo.portage_repository.profiles
+ no_config_testrepo.main_repository.profiles
end
def test_profiles
diff --git a/src/clients/adjutrix/Makefile.am b/src/clients/adjutrix/Makefile.am
index 3c49ebf..f0e71d0 100644
--- a/src/clients/adjutrix/Makefile.am
+++ b/src/clients/adjutrix/Makefile.am
@@ -48,7 +48,6 @@ adjutrix_SOURCES = \
adjutrix_LDADD = \
$(top_builddir)/paludis/environments/no_config/libpaludisnoconfigenvironment.la \
- $(top_builddir)/paludis/repositories/gentoo/libpaludisgentoorepository.la \
$(top_builddir)/paludis/repositories/fake/libpaludisfakerepository.la \
$(top_builddir)/paludis/tasks/libpaludistasks.la \
$(top_builddir)/paludis/libpaludis.la \
diff --git a/src/clients/adjutrix/adjutrix.cc b/src/clients/adjutrix/adjutrix.cc
index 21ddb8e..715b5bc 100644
--- a/src/clients/adjutrix/adjutrix.cc
+++ b/src/clients/adjutrix/adjutrix.cc
@@ -152,7 +152,7 @@ main(int argc, char *argv[])
.write_cache(CommandLine::get_instance()->a_write_cache_dir.argument())
.accept_unstable(CommandLine::get_instance()->a_unstable.specified())
.repository_type(
- (CommandLine::get_instance()->a_reverse_deps.specified()) ? ncer_auto : ncer_portage
+ (CommandLine::get_instance()->a_reverse_deps.specified()) ? ncer_auto : ncer_ebuild
)
.master_repository_dir(FSEntry("/var/empty")));
diff --git a/src/clients/adjutrix/display_default_system_resolution.cc b/src/clients/adjutrix/display_default_system_resolution.cc
index afbeb4f..4545737 100644
--- a/src/clients/adjutrix/display_default_system_resolution.cc
+++ b/src/clients/adjutrix/display_default_system_resolution.cc
@@ -21,7 +21,6 @@
#include "command_line.hh"
#include <output/colour.hh>
#include <paludis/config_file.hh>
-#include <paludis/repositories/gentoo/portage_repository.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/util/log.hh>
#include <paludis/util/tokeniser.hh>
@@ -123,10 +122,11 @@ int do_display_default_system_resolution(NoConfigEnvironment & env)
if (CommandLine::get_instance()->a_profile.begin_args() ==
CommandLine::get_instance()->a_profile.end_args())
{
- for (PortageRepository::ProfilesIterator p(env.portage_repository()->begin_profiles()),
- p_end(env.portage_repository()->end_profiles()) ; p != p_end ; ++p)
+ for (RepositoryPortageInterface::ProfilesIterator
+ p(env.main_repository()->portage_interface->begin_profiles()),
+ p_end(env.main_repository()->portage_interface->end_profiles()) ; p != p_end ; ++p)
{
- env.portage_repository()->set_profile(p);
+ env.main_repository()->portage_interface->set_profile(p);
return_code |= display_default_system_resolution(env, p->arch + "." + p->status, p->path);
}
}
@@ -135,13 +135,15 @@ int do_display_default_system_resolution(NoConfigEnvironment & env)
for (args::StringSetArg::Iterator i(CommandLine::get_instance()->a_profile.begin_args()),
i_end(CommandLine::get_instance()->a_profile.end_args()) ; i != i_end ; ++i)
{
- PortageRepository::ProfilesIterator p(env.portage_repository()->find_profile(
- env.main_repository_dir() / "profiles" / (*i)));
- if (p == env.portage_repository()->end_profiles())
+ RepositoryPortageInterface::ProfilesIterator
+ p(env.main_repository()->portage_interface->find_profile(
+ env.main_repository_dir() / "profiles" / (*i)));
+ if (p == env.main_repository()->portage_interface->end_profiles())
throw ConfigurationError("Repository does not have a profile listed in profiles.desc matching '"
+ stringify(*i) + "'");
- env.portage_repository()->set_profile(p);
- return_code |= display_default_system_resolution(env, *i, env.main_repository_dir() / "profiles" / *i);
+ env.main_repository()->portage_interface->set_profile(p);
+ return_code |= display_default_system_resolution(env, *i, env.main_repository_dir()
+ / "profiles" / *i);
}
}
diff --git a/src/clients/adjutrix/display_profiles_use.cc b/src/clients/adjutrix/display_profiles_use.cc
index ed68d7c..7d0bf0d 100644
--- a/src/clients/adjutrix/display_profiles_use.cc
+++ b/src/clients/adjutrix/display_profiles_use.cc
@@ -21,7 +21,6 @@
#include "command_line.hh"
#include <output/colour.hh>
#include <paludis/config_file.hh>
-#include <paludis/repositories/gentoo/portage_repository.hh>
#include <paludis/util/log.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/dir_iterator.hh>
@@ -154,10 +153,10 @@ void do_display_profiles_use(NoConfigEnvironment & env)
if (CommandLine::get_instance()->a_profile.begin_args() ==
CommandLine::get_instance()->a_profile.end_args())
{
- for (PortageRepository::ProfilesIterator p(env.portage_repository()->begin_profiles()),
- p_end(env.portage_repository()->end_profiles()) ; p != p_end ; ++p)
+ for (RepositoryPortageInterface::ProfilesIterator p(env.main_repository()->portage_interface->begin_profiles()),
+ p_end(env.main_repository()->portage_interface->end_profiles()) ; p != p_end ; ++p)
{
- env.portage_repository()->set_profile(p);
+ env.main_repository()->portage_interface->set_profile(p);
display_profiles_use(env, p->arch + "." + p->status, p->path,
all_use_flags, all_use_expand_flags);
}
@@ -167,12 +166,13 @@ void do_display_profiles_use(NoConfigEnvironment & env)
for (args::StringSetArg::Iterator i(CommandLine::get_instance()->a_profile.begin_args()),
i_end(CommandLine::get_instance()->a_profile.end_args()) ; i != i_end ; ++i)
{
- PortageRepository::ProfilesIterator p(env.portage_repository()->find_profile(
+ RepositoryPortageInterface::ProfilesIterator p(
+ env.main_repository()->portage_interface->find_profile(
env.main_repository_dir() / "profiles" / (*i)));
- if (p == env.portage_repository()->end_profiles())
+ if (p == env.main_repository()->portage_interface->end_profiles())
throw ConfigurationError("Repository does not have a profile listed in profiles.desc matching '"
+ stringify(*i) + "'");
- env.portage_repository()->set_profile(p);
+ env.main_repository()->portage_interface->set_profile(p);
display_profiles_use(env, *i, env.main_repository_dir() /
"profiles" / *i, all_use_flags, all_use_expand_flags);
}
diff --git a/src/clients/adjutrix/downgrade_check.cc b/src/clients/adjutrix/downgrade_check.cc
index 7f3fc87..aab91f9 100644
--- a/src/clients/adjutrix/downgrade_check.cc
+++ b/src/clients/adjutrix/downgrade_check.cc
@@ -20,7 +20,6 @@
#include "downgrade_check.hh"
#include "command_line.hh"
#include <paludis/query.hh>
-#include <paludis/repositories/gentoo/portage_repository.hh>
#include <paludis/util/sr.hh>
#include <paludis/util/compare.hh>
#include <paludis/util/tokeniser.hh>
@@ -70,7 +69,7 @@ namespace
}
std::string
- make_filename(const PortageRepository::ProfilesIterator & p, bool unstable)
+ make_filename(const RepositoryPortageInterface::ProfilesIterator & p, bool unstable)
{
std::string result;
FSEntry f(p->path);
@@ -86,7 +85,7 @@ namespace
}
std::string
- make_desc(const PortageRepository::ProfilesIterator & p, bool unstable)
+ make_desc(const RepositoryPortageInterface::ProfilesIterator & p, bool unstable)
{
std::string result;
FSEntry f(p->path);
@@ -169,13 +168,14 @@ do_build_downgrade_check_list(NoConfigEnvironment & env)
if (! output_dir.mkdir())
throw ConfigurationError("Output directory already exists");
- for (PortageRepository::ProfilesIterator p(env.portage_repository()->begin_profiles()),
- p_end(env.portage_repository()->end_profiles()) ; p != p_end ; ++p)
+ for (RepositoryPortageInterface::ProfilesIterator
+ p(env.main_repository()->portage_interface->begin_profiles()),
+ p_end(env.main_repository()->portage_interface->end_profiles()) ; p != p_end ; ++p)
{
for (int i = 0 ; i < 2 ; ++i)
{
env.set_accept_unstable(i);
- env.portage_repository()->set_profile(p);
+ env.main_repository()->portage_interface->set_profile(p);
std::string n(make_filename(p, i));
std::cerr << "Generating " << n << "..." << std::endl;
std::ofstream f(stringify(output_dir / n).c_str());
@@ -201,13 +201,14 @@ do_downgrade_check(NoConfigEnvironment & env)
std::multimap<QPNS, std::string> results;
- for (PortageRepository::ProfilesIterator p(env.portage_repository()->begin_profiles()),
- p_end(env.portage_repository()->end_profiles()) ; p != p_end ; ++p)
+ for (RepositoryPortageInterface::ProfilesIterator
+ p(env.main_repository()->portage_interface->begin_profiles()),
+ p_end(env.main_repository()->portage_interface->end_profiles()) ; p != p_end ; ++p)
{
for (int i = 0 ; i < 2 ; ++i)
{
env.set_accept_unstable(i);
- env.portage_repository()->set_profile(p);
+ env.main_repository()->portage_interface->set_profile(p);
std::string n(make_filename(p, i)), desc(make_desc(p, i));
if ((before_dir / n).exists() && (after_dir / n).exists())
diff --git a/src/clients/adjutrix/what_needs_keywording.cc b/src/clients/adjutrix/what_needs_keywording.cc
index 39a3f97..2d9b37f 100644
--- a/src/clients/adjutrix/what_needs_keywording.cc
+++ b/src/clients/adjutrix/what_needs_keywording.cc
@@ -23,7 +23,6 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/compare.hh>
#include <paludis/util/strip.hh>
-#include <paludis/repositories/gentoo/portage_repository.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/dep_list/exceptions.hh>
#include <paludis/dep_list/dep_list.hh>
@@ -56,7 +55,7 @@ int do_what_needs_keywording(NoConfigEnvironment & env)
UseFlagName target_arch(strip_leading_string(
*CommandLine::get_instance()->begin_parameters(), "~"));
- env.portage_repository()->set_profile_by_arch(target_arch);
+ env.main_repository()->portage_interface->set_profile_by_arch(target_arch);
env.set_accept_unstable('~' == stringify(target_keyword).at(0));
DepListOptions d_options;
diff --git a/src/clients/qualudis/qualudis.cc b/src/clients/qualudis/qualudis.cc
index 641a59b..9006c6c 100644
--- a/src/clients/qualudis/qualudis.cc
+++ b/src/clients/qualudis/qualudis.cc
@@ -20,7 +20,6 @@
#include <paludis/args/args.hh>
#include <paludis/paludis.hh>
#include <paludis/qa/qa.hh>
-#include <paludis/repositories/gentoo/portage_repository.hh>
#include <paludis/util/join.hh>
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/log.hh>
@@ -327,8 +326,9 @@ namespace
if (! IsFileWithExtension(".ebuild")(*f))
continue;
- for (PortageRepository::ProfilesIterator i(env.portage_repository()->begin_profiles()),
- i_end(env.portage_repository()->end_profiles()) ; i != i_end ; ++i)
+ for (RepositoryPortageInterface::ProfilesIterator
+ i(env.main_repository()->portage_interface->begin_profiles()),
+ i_end(env.main_repository()->portage_interface->end_profiles()) ; i != i_end ; ++i)
{
if (QualudisCommandLine::get_instance()->a_archs.specified())
if (QualudisCommandLine::get_instance()->a_archs.end_args() == std::find(
@@ -472,8 +472,9 @@ namespace
bool ok(true), fatal(false), dummy(false);
do_check_kind<qa::ProfilesCheckMaker>(ok, fatal, dummy, dir);
- for (PortageRepository::ProfilesIterator p(env.portage_repository()->begin_profiles()),
- p_end(env.portage_repository()->end_profiles()) ; p != p_end ; ++p)
+ for (RepositoryPortageInterface::ProfilesIterator
+ p(env.main_repository()->portage_interface->begin_profiles()),
+ p_end(env.main_repository()->portage_interface->end_profiles()) ; p != p_end ; ++p)
{
if (fatal)
break;