aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/repositories')
-rw-r--r--paludis/repositories/accounts/accounts_repository.cc8
-rw-r--r--paludis/repositories/e/e_repository.cc25
-rw-r--r--paludis/repositories/e/e_repository.hh6
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc78
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_setup.sh24
-rw-r--r--paludis/repositories/e/exndbam_repository.cc4
-rw-r--r--paludis/repositories/e/vdb_repository.cc4
-rw-r--r--paludis/repositories/fake/fake_installed_repository.cc4
-rw-r--r--paludis/repositories/fake/fake_repository.cc22
-rw-r--r--paludis/repositories/fake/fake_repository.hh13
-rw-r--r--paludis/repositories/gemcutter/gemcutter_repository.cc4
-rw-r--r--paludis/repositories/repository/repository_repository.cc4
-rw-r--r--paludis/repositories/unavailable/unavailable_repository.cc4
-rw-r--r--paludis/repositories/unpackaged/installed_repository.cc4
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository.cc4
-rw-r--r--paludis/repositories/unwritten/unwritten_repository.cc4
-rw-r--r--paludis/repositories/virtuals/Makefile.am28
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc4
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository_TEST.cc33
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc73
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.hh7
-rw-r--r--paludis/repositories/virtuals/virtuals_repository_TEST.cc165
22 files changed, 18 insertions, 504 deletions
diff --git a/paludis/repositories/accounts/accounts_repository.cc b/paludis/repositories/accounts/accounts_repository.cc
index 7742e6c21..1827d2bb0 100644
--- a/paludis/repositories/accounts/accounts_repository.cc
+++ b/paludis/repositories/accounts/accounts_repository.cc
@@ -111,9 +111,7 @@ AccountsRepository::AccountsRepository(const AccountsRepositoryParams & p) :
make_named_values<RepositoryCapabilities>(
n::destination_interface() = static_cast<RepositoryDestinationInterface *>(0),
n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(0),
- n::make_virtuals_interface() = static_cast<RepositoryMakeVirtualsInterface *>(0),
- n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0),
- n::virtuals_interface() = static_cast<RepositoryVirtualsInterface *>(0)
+ n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0)
)),
_imp(p.name(), p)
{
@@ -127,9 +125,7 @@ AccountsRepository::AccountsRepository(const InstalledAccountsRepositoryParams &
make_named_values<RepositoryCapabilities>(
n::destination_interface() = this,
n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(0),
- n::make_virtuals_interface() = static_cast<RepositoryMakeVirtualsInterface *>(0),
- n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0),
- n::virtuals_interface() = static_cast<RepositoryVirtualsInterface *>(0)
+ n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0)
)),
_imp(p.name(), p)
{
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index 04a93d99c..9fc779e41 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -128,7 +128,6 @@ using namespace paludis;
using namespace paludis::erepository;
typedef std::unordered_map<std::string, std::shared_ptr<MirrorsSequence> > MirrorMap;
-typedef std::unordered_map<QualifiedPackageName, std::shared_ptr<const PackageDepSpec>, Hash<QualifiedPackageName> > VirtualsMap;
typedef std::map<FSPath, std::string, FSPathComparator> EAPIForFileMap;
@@ -520,9 +519,7 @@ ERepository::ERepository(const ERepositoryParams & p) :
make_named_values<RepositoryCapabilities>(
n::destination_interface() = p.binary_destination() ? this : 0,
n::environment_variable_interface() = this,
- n::make_virtuals_interface() = static_cast<RepositoryMakeVirtualsInterface *>(0),
- n::manifest_interface() = this,
- n::virtuals_interface() = (*DistributionData::get_instance()->distribution_from_string(p.environment()->distribution())).support_old_style_virtuals() ? this : 0
+ n::manifest_interface() = this
)),
_imp(this, p)
{
@@ -877,26 +874,6 @@ ERepository::environment_updated_profile_variable(const std::string & var) const
return join(values.begin(), last, " ");
}
-std::shared_ptr<const ERepository::VirtualsSequence>
-ERepository::virtual_packages() const
-{
- Context context("When loading virtual packages for repository '" +
- stringify(name()) + "'");
-
- _imp->need_profiles();
-
- std::shared_ptr<VirtualsSequence> result(std::make_shared<VirtualsSequence>());
-
- for (Map<QualifiedPackageName, PackageDepSpec>::ConstIterator i(_imp->profile_ptr->virtuals()->begin()),
- i_end(_imp->profile_ptr->virtuals()->end()) ; i != i_end ; ++i)
- result->push_back(make_named_values<RepositoryVirtualsEntry>(
- n::provided_by_spec() = make_shared_copy(i->second),
- n::virtual_name() = i->first
- ));
-
- return result;
-}
-
void
ERepository::regenerate_cache() const
{
diff --git a/paludis/repositories/e/e_repository.hh b/paludis/repositories/e/e_repository.hh
index 411d52b96..63f4930bd 100644
--- a/paludis/repositories/e/e_repository.hh
+++ b/paludis/repositories/e/e_repository.hh
@@ -51,7 +51,6 @@ namespace paludis
class PALUDIS_VISIBLE ERepository :
public Repository,
public RepositoryEnvironmentVariableInterface,
- public RepositoryVirtualsInterface,
public RepositoryDestinationInterface,
public RepositoryManifestInterface,
public std::enable_shared_from_this<ERepository>
@@ -81,11 +80,6 @@ namespace paludis
virtual void purge_invalid_cache() const;
- /* RepositoryVirtualsInterface */
-
- virtual std::shared_ptr<const VirtualsSequence> virtual_packages() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
/* RepositoryDestinationInterface */
virtual bool is_suitable_destination_for(const std::shared_ptr<const PackageID> &) const
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 24eef92f8..b1c81d50b 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -640,84 +640,6 @@ TEST(ERepository, ProfileMasks)
}
}
-TEST(ERepository, Virtuals)
-{
- TestEnvironment env;
- std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
- keys->insert("format", "e");
- keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo15"));
- keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo15/profiles/profile"));
- keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
- std::shared_ptr<ERepository> repo(std::static_pointer_cast<ERepository>(ERepository::repository_factory_create(&env,
- std::bind(from_keys, keys, std::placeholders::_1))));
- env.add_repository(1, repo);
-
- bool has_one(false), has_two(false);
- int count(0);
-
- std::shared_ptr<const RepositoryVirtualsInterface::VirtualsSequence> seq(repo->virtual_packages());
- for (RepositoryVirtualsInterface::VirtualsSequence::ConstIterator it(seq->begin()),
- it_end(seq->end()); it_end != it; ++it, ++count)
- if ("virtual/one" == stringify(it->virtual_name()))
- {
- has_one = true;
- EXPECT_EQ("cat-one/pkg-one", stringify(*it->provided_by_spec()));
- }
- else
- {
- EXPECT_EQ("virtual/two", stringify(it->virtual_name()));
- has_two = true;
- EXPECT_EQ("cat-two/pkg-two", stringify(*it->provided_by_spec()));
- }
-
- EXPECT_TRUE(has_one);
- EXPECT_TRUE(has_two);
- EXPECT_EQ(2, count);
-}
-
-TEST(ERepository, MoreVirtuals)
-{
- TestEnvironment env;
- std::shared_ptr<Map<std::string, std::string> > keys(std::make_shared<Map<std::string, std::string>>());
- keys->insert("format", "e");
- keys->insert("names_cache", "/var/empty");
- keys->insert("location", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo15"));
- keys->insert("profiles", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "repo15/profiles/profile/subprofile"));
- keys->insert("builddir", stringify(FSPath::cwd() / "e_repository_TEST_dir" / "build"));
- std::shared_ptr<ERepository> repo(std::static_pointer_cast<ERepository>(ERepository::repository_factory_create(&env,
- std::bind(from_keys, keys, std::placeholders::_1))));
- env.add_repository(1, repo);
-
- bool has_one(false), has_two(false), has_three(false);
- int count(0);
-
- std::shared_ptr<const RepositoryVirtualsInterface::VirtualsSequence> seq(repo->virtual_packages());
- for (RepositoryVirtualsInterface::VirtualsSequence::ConstIterator it(seq->begin()),
- it_end(seq->end()); it_end != it; ++it, ++count)
- if ("virtual/one" == stringify(it->virtual_name()))
- {
- has_one = true;
- EXPECT_EQ("cat-two/pkg-two", stringify(*it->provided_by_spec()));
- }
- else if ("virtual/two" == stringify(it->virtual_name()))
- {
- has_two = true;
- EXPECT_EQ("cat-one/pkg-one", stringify(*it->provided_by_spec()));
- }
- else
- {
- EXPECT_EQ("virtual/three", stringify(it->virtual_name()));
- has_three = true;
- EXPECT_EQ("cat-three/pkg-three", stringify(*it->provided_by_spec()));
- }
-
- EXPECT_TRUE(has_one);
- EXPECT_TRUE(has_two);
- EXPECT_TRUE(has_three);
- EXPECT_EQ(3, count);
-}
-
TEST(ERepository, Manifest)
{
TestEnvironment env;
diff --git a/paludis/repositories/e/e_repository_TEST_setup.sh b/paludis/repositories/e/e_repository_TEST_setup.sh
index 1227fe720..7fb2d822a 100755
--- a/paludis/repositories/e/e_repository_TEST_setup.sh
+++ b/paludis/repositories/e/e_repository_TEST_setup.sh
@@ -458,30 +458,6 @@ DEPENDENCIES=""
END
cd ..
-mkdir -p repo15/{eclass,distfiles,profiles/profile/subprofile} || exit 1
-cd repo15 || exit 1
-echo "test-repo-15" >> profiles/repo_name || exit 1
-cat <<END >profiles/profiles.desc || exit 1
-test profile stable
-test profile/subprofile stable
-END
-cat <<END > profiles/profile/make.defaults || exit 1
-ARCH=test
-END
-cat <<END > profiles/profile/virtuals || exit 1
-virtual/one cat-one/pkg-one
-virtual/two cat-two/pkg-two
-END
-cat <<END >profiles/profile/subprofile/parent || exit 1
-..
-END
-cat <<END > profiles/profile/subprofile/virtuals || exit 1
-virtual/one cat-two/pkg-two
-virtual/two cat-one/pkg-one
-virtual/three cat-three/pkg-three
-END
-cd ..
-
mkdir -p repo16/{eclass,distfiles,profiles/profile} || exit 1
mkdir -p repo16/category/package-{a,b,c} || exit 1
cd repo16 || exit 1
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index 5c6c4f4c5..d2963b3c9 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -109,9 +109,7 @@ ExndbamRepository::ExndbamRepository(const RepositoryName & n, const ExndbamRepo
make_named_values<RepositoryCapabilities>(
n::destination_interface() = this,
n::environment_variable_interface() = this,
- n::make_virtuals_interface() = static_cast<RepositoryMakeVirtualsInterface *>(0),
- n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0),
- n::virtuals_interface() = static_cast<RepositoryVirtualsInterface *>(0)
+ n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0)
)),
_imp(p)
{
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index 1bc15b5d1..bec8e5cda 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -171,9 +171,7 @@ VDBRepository::VDBRepository(const VDBRepositoryParams & p) :
make_named_values<RepositoryCapabilities>(
n::destination_interface() = this,
n::environment_variable_interface() = this,
- n::make_virtuals_interface() = static_cast<RepositoryMakeVirtualsInterface *>(0),
- n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0),
- n::virtuals_interface() = static_cast<RepositoryVirtualsInterface *>(0)
+ n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0)
)),
_imp(this, p)
{
diff --git a/paludis/repositories/fake/fake_installed_repository.cc b/paludis/repositories/fake/fake_installed_repository.cc
index 3bed23946..ca106a004 100644
--- a/paludis/repositories/fake/fake_installed_repository.cc
+++ b/paludis/repositories/fake/fake_installed_repository.cc
@@ -61,9 +61,7 @@ FakeInstalledRepository::FakeInstalledRepository(const FakeInstalledRepositoryPa
FakeRepositoryBase(p.environment(), p.name(), make_named_values<RepositoryCapabilities>(
n::destination_interface() = this,
n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(0),
- n::make_virtuals_interface() = static_cast<RepositoryMakeVirtualsInterface *>(0),
- n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0),
- n::virtuals_interface() = static_cast<RepositoryVirtualsInterface *>(0)
+ n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0)
)),
_imp(p.supports_uninstall(), p.suitable_destination())
{
diff --git a/paludis/repositories/fake/fake_repository.cc b/paludis/repositories/fake/fake_repository.cc
index 02cdcd5e1..a7cd664d4 100644
--- a/paludis/repositories/fake/fake_repository.cc
+++ b/paludis/repositories/fake/fake_repository.cc
@@ -40,11 +40,9 @@ namespace paludis
template<>
struct Imp<FakeRepository>
{
- std::shared_ptr<FakeRepository::VirtualsSequence> virtual_packages;
std::shared_ptr<const MetadataValueKey<std::string> > format_key;
Imp() :
- virtual_packages(std::make_shared<FakeRepository::VirtualsSequence>()),
format_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"format", "format", mkt_significant, "fake"))
{
@@ -56,10 +54,7 @@ FakeRepository::FakeRepository(const FakeRepositoryParams & params) :
FakeRepositoryBase(params.environment(), params.name(), make_named_values<RepositoryCapabilities>(
n::destination_interface() = static_cast<RepositoryDestinationInterface *>(0),
n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(0),
- n::make_virtuals_interface() = static_cast<RepositoryMakeVirtualsInterface *>(0),
- n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0),
- n::virtuals_interface() = (*DistributionData::get_instance()->distribution_from_string(
- params.environment()->distribution())).support_old_style_virtuals() ? this : 0
+ n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0)
)),
_imp()
{
@@ -70,21 +65,6 @@ FakeRepository::~FakeRepository()
{
}
-std::shared_ptr<const FakeRepository::VirtualsSequence>
-FakeRepository::virtual_packages() const
-{
- return _imp->virtual_packages;
-}
-
-void
-FakeRepository::add_virtual_package(const QualifiedPackageName & q, const std::shared_ptr<const PackageDepSpec> & p)
-{
- _imp->virtual_packages->push_back(make_named_values<RepositoryVirtualsEntry>(
- n::provided_by_spec() = p,
- n::virtual_name() = q
- ));
-}
-
namespace paludis
{
class RepositoryFactory;
diff --git a/paludis/repositories/fake/fake_repository.hh b/paludis/repositories/fake/fake_repository.hh
index dc3f291a4..b1895ef01 100644
--- a/paludis/repositories/fake/fake_repository.hh
+++ b/paludis/repositories/fake/fake_repository.hh
@@ -51,8 +51,7 @@ namespace paludis
* \ingroup grpfakerepository
*/
class PALUDIS_VISIBLE FakeRepository :
- public FakeRepositoryBase,
- public RepositoryVirtualsInterface
+ public FakeRepositoryBase
{
private:
Pimp<FakeRepository> _imp;
@@ -68,16 +67,6 @@ namespace paludis
///\}
- /**
- * Add a virtual package.
- */
- void add_virtual_package(const QualifiedPackageName &, const std::shared_ptr<const PackageDepSpec> &);
-
- /* RepositoryVirtualsInterface */
-
- virtual std::shared_ptr<const VirtualsSequence> virtual_packages() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
virtual bool some_ids_might_support_action(const SupportsActionTestBase &) const;
virtual bool some_ids_might_not_be_masked() const;
diff --git a/paludis/repositories/gemcutter/gemcutter_repository.cc b/paludis/repositories/gemcutter/gemcutter_repository.cc
index faab0cb1c..567c50374 100644
--- a/paludis/repositories/gemcutter/gemcutter_repository.cc
+++ b/paludis/repositories/gemcutter/gemcutter_repository.cc
@@ -86,9 +86,7 @@ GemcutterRepository::GemcutterRepository(const GemcutterRepositoryParams & p) :
make_named_values<RepositoryCapabilities>(
n::destination_interface() = static_cast<RepositoryDestinationInterface *>(0),
n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(0),
- n::make_virtuals_interface() = static_cast<RepositoryMakeVirtualsInterface *>(0),
- n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0),
- n::virtuals_interface() = static_cast<RepositoryVirtualsInterface *>(0)
+ n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0)
)),
_imp(this, p)
{
diff --git a/paludis/repositories/repository/repository_repository.cc b/paludis/repositories/repository/repository_repository.cc
index 957341bda..8bb872c29 100644
--- a/paludis/repositories/repository/repository_repository.cc
+++ b/paludis/repositories/repository/repository_repository.cc
@@ -95,9 +95,7 @@ RepositoryRepository::RepositoryRepository(const RepositoryRepositoryParams & p)
make_named_values<RepositoryCapabilities>(
n::destination_interface() = static_cast<RepositoryDestinationInterface *>(this),
n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(0),
- n::make_virtuals_interface() = static_cast<RepositoryMakeVirtualsInterface *>(0),
- n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0),
- n::virtuals_interface() = static_cast<RepositoryVirtualsInterface *>(0)
+ n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0)
)),
_imp(this, p)
{
diff --git a/paludis/repositories/unavailable/unavailable_repository.cc b/paludis/repositories/unavailable/unavailable_repository.cc
index fca38ad78..2cbade85d 100644
--- a/paludis/repositories/unavailable/unavailable_repository.cc
+++ b/paludis/repositories/unavailable/unavailable_repository.cc
@@ -104,9 +104,7 @@ UnavailableRepository::UnavailableRepository(const UnavailableRepositoryParams &
make_named_values<RepositoryCapabilities>(
n::destination_interface() = static_cast<RepositoryDestinationInterface *>(0),
n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(0),
- n::make_virtuals_interface() = static_cast<RepositoryMakeVirtualsInterface *>(0),
- n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0),
- n::virtuals_interface() = static_cast<RepositoryVirtualsInterface *>(0)
+ n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0)
)),
_imp(this, p)
{
diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc
index 159c38bb3..df90d9fff 100644
--- a/paludis/repositories/unpackaged/installed_repository.cc
+++ b/paludis/repositories/unpackaged/installed_repository.cc
@@ -93,9 +93,7 @@ InstalledUnpackagedRepository::InstalledUnpackagedRepository(
Repository(p.environment(), n, make_named_values<RepositoryCapabilities>(
n::destination_interface() = this,
n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(0),
- n::make_virtuals_interface() = static_cast<RepositoryMakeVirtualsInterface *>(0),
- n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0),
- n::virtuals_interface() = static_cast<RepositoryVirtualsInterface *>(0)
+ n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0)
)),
_imp(p)
{
diff --git a/paludis/repositories/unpackaged/unpackaged_repository.cc b/paludis/repositories/unpackaged/unpackaged_repository.cc
index 49e17fe60..cd92f7205 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository.cc
+++ b/paludis/repositories/unpackaged/unpackaged_repository.cc
@@ -97,9 +97,7 @@ UnpackagedRepository::UnpackagedRepository(const RepositoryName & n,
Repository(params.environment(), n, make_named_values<RepositoryCapabilities>(
n::destination_interface() = static_cast<RepositoryDestinationInterface *>(0),
n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(0),
- n::make_virtuals_interface() = static_cast<RepositoryMakeVirtualsInterface *>(0),
- n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0),
- n::virtuals_interface() = static_cast<RepositoryVirtualsInterface *>(0)
+ n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0)
)),
_imp(n, params)
{
diff --git a/paludis/repositories/unwritten/unwritten_repository.cc b/paludis/repositories/unwritten/unwritten_repository.cc
index fbf1929ca..717fbc7dd 100644
--- a/paludis/repositories/unwritten/unwritten_repository.cc
+++ b/paludis/repositories/unwritten/unwritten_repository.cc
@@ -98,9 +98,7 @@ UnwrittenRepository::UnwrittenRepository(const UnwrittenRepositoryParams & p) :
make_named_values<RepositoryCapabilities>(
n::destination_interface() = static_cast<RepositoryDestinationInterface *>(0),
n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(0),
- n::make_virtuals_interface() = static_cast<RepositoryMakeVirtualsInterface *>(0),
- n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0),
- n::virtuals_interface() = static_cast<RepositoryVirtualsInterface *>(0)
+ n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0)
)),
_imp(this, p)
{
diff --git a/paludis/repositories/virtuals/Makefile.am b/paludis/repositories/virtuals/Makefile.am
index af68f0fd1..bd575b845 100644
--- a/paludis/repositories/virtuals/Makefile.am
+++ b/paludis/repositories/virtuals/Makefile.am
@@ -23,34 +23,10 @@ libpaludisvirtualsrepository_la_SOURCES = \
registration.cc \
$(noinst_HEADERS)
-TESTS = virtuals_repository_TEST installed_virtuals_repository_TEST
+TESTS =
check_PROGRAMS = $(TESTS)
check_SCRIPTS =
-EXTRA_DIST = $(virtuals_repository_TEST_SOURCES) $(installed_virtuals_repository_TEST_SOURCES)
-
-virtuals_repository_TEST_LDADD = \
- $(top_builddir)/paludis/util/gtest_runner.o \
- $(top_builddir)/paludis/util/libpaludisutil_@PALUDIS_PC_SLOT@.la \
- $(top_builddir)/paludis/libpaludis_@PALUDIS_PC_SLOT@.la
-
-virtuals_repository_TEST_CXXFLAGS = $(AM_CXXFLAGS) @PALUDIS_CXXFLAGS_NO_DEBUGGING@ @GTESTDEPS_CXXFLAGS@
-
-virtuals_repository_TEST_LDFLAGS = @GTESTDEPS_LDFLAGS@ @GTESTDEPS_LIBS@
-
-installed_virtuals_repository_TEST_LDADD = \
- $(top_builddir)/paludis/util/gtest_runner.o \
- $(top_builddir)/paludis/util/libpaludisutil_@PALUDIS_PC_SLOT@.la \
- $(top_builddir)/paludis/libpaludis_@PALUDIS_PC_SLOT@.la
-
-installed_virtuals_repository_TEST_CXXFLAGS = $(AM_CXXFLAGS) @PALUDIS_CXXFLAGS_NO_DEBUGGING@ @GTESTDEPS_CXXFLAGS@
-
-installed_virtuals_repository_TEST_LDFLAGS = @GTESTDEPS_LDFLAGS@ @GTESTDEPS_LIBS@
-
-virtuals_repository_TEST_SOURCES = \
- virtuals_repository_TEST.cc
-
-installed_virtuals_repository_TEST_SOURCES = \
- installed_virtuals_repository_TEST.cc
+EXTRA_DIST =
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index 1a4140724..0ed495f07 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -112,9 +112,7 @@ InstalledVirtualsRepository::InstalledVirtualsRepository(const Environment * con
Repository(env, RepositoryName(make_name(r)), make_named_values<RepositoryCapabilities>(
n::destination_interface() = static_cast<RepositoryDestinationInterface *>(this),
n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(0),
- n::make_virtuals_interface() = static_cast<RepositoryMakeVirtualsInterface *>(0),
- n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0),
- n::virtuals_interface() = static_cast<RepositoryVirtualsInterface *>(0)
+ n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0)
)),
_imp(env, r)
{
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository_TEST.cc b/paludis/repositories/virtuals/installed_virtuals_repository_TEST.cc
deleted file mode 100644
index aac3eac37..000000000
--- a/paludis/repositories/virtuals/installed_virtuals_repository_TEST.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007, 2008, 2010, 2011 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/virtuals/installed_virtuals_repository.hh>
-
-#include <paludis/environments/test/test_environment.hh>
-
-#include <gtest/gtest.h>
-
-using namespace paludis;
-
-TEST(InstalledVirtualsRepository, Workss)
-{
- TestEnvironment env;
- std::shared_ptr<const InstalledVirtualsRepository> r(std::make_shared<InstalledVirtualsRepository>(&env, FSPath("/")));
-}
-
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index d3233e76e..69155cb7a 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -123,9 +123,7 @@ VirtualsRepository::VirtualsRepository(const Environment * const env) :
Repository(env, RepositoryName("virtuals"), make_named_values<RepositoryCapabilities>(
n::destination_interface() = static_cast<RepositoryDestinationInterface *>(0),
n::environment_variable_interface() = static_cast<RepositoryEnvironmentVariableInterface *>(0),
- n::make_virtuals_interface() = this,
- n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0),
- n::virtuals_interface() = static_cast<RepositoryVirtualsInterface *>(0)
+ n::manifest_interface() = static_cast<RepositoryManifestInterface *>(0)
)),
_imp(env)
{
@@ -153,28 +151,6 @@ VirtualsRepository::need_names() const
std::vector<std::pair<QualifiedPackageName, std::shared_ptr<const PackageDepSpec> > > new_names;
- for (auto r(_imp->env->begin_repositories()), r_end(_imp->env->end_repositories()) ; r != r_end ; ++r)
- {
- if (! (**r).virtuals_interface())
- continue;
-
- std::shared_ptr<const RepositoryVirtualsInterface::VirtualsSequence> virtuals(
- (**r).virtuals_interface()->virtual_packages());
- for (RepositoryVirtualsInterface::VirtualsSequence::ConstIterator v(virtuals->begin()),
- v_end(virtuals->end()) ; v != v_end ; ++v)
- {
- std::pair<
- std::vector<std::pair<QualifiedPackageName, std::shared_ptr<const PackageDepSpec> > >::const_iterator,
- std::vector<std::pair<QualifiedPackageName, std::shared_ptr<const PackageDepSpec> > >::const_iterator> p(
- std::equal_range(_imp->names.begin(), _imp->names.end(),
- std::make_pair((*v).virtual_name(), std::shared_ptr<const PackageDepSpec>()),
- NamesNameComparator()));
-
- if (p.first == p.second)
- new_names.push_back(std::make_pair((*v).virtual_name(), (*v).provided_by_spec()));
- }
- }
-
std::copy(new_names.begin(), new_names.end(), std::back_inserter(_imp->names));
std::sort(_imp->names.begin(), _imp->names.end(), NamesSortComparator());
_imp->names.erase(std::unique(_imp->names.begin(), _imp->names.end(), NamesUniqueComparator()), _imp->names.end());
@@ -191,42 +167,6 @@ VirtualsRepository::need_ids() const
return;
_imp->has_ids = true;
-
- Context context("When loading entries for virtuals repository:");
- need_names();
-
- Log::get_instance()->message("virtuals.need_entries", ll_debug, lc_context) << "VirtualsRepository need_entries";
-
- IDMap my_ids;
-
- /* Populate our _imp->entries. */
- for (std::vector<std::pair<QualifiedPackageName, std::shared_ptr<const PackageDepSpec> > >::const_iterator
- v(_imp->names.begin()), v_end(_imp->names.end()) ; v != v_end ; ++v)
- {
- std::shared_ptr<const PackageIDSequence> matches((*_imp->env)[selection::AllVersionsSorted(
- generator::Matches(*v->second, make_null_shared_ptr(), { }) |
- filter::SupportsAction<InstallAction>())]);
-
- if (matches->empty())
- Log::get_instance()->message("virtuals.no_match", ll_warning, lc_context) << "No packages matching '"
- << *v->second << "' for virtual '" << v->first << "'";
-
- for (PackageIDSequence::ConstIterator m(matches->begin()), m_end(matches->end()) ;
- m != m_end ; ++m)
- {
- IDMap::iterator i(my_ids.find(v->first));
- if (my_ids.end() == i)
- i = my_ids.insert(std::make_pair(v->first, std::make_shared<PackageIDSequence>())).first;
-
- std::shared_ptr<const PackageID> id(make_virtual_package_id(QualifiedPackageName(v->first), *m));
- if (stringify(id->name().category()) != "virtual")
- throw InternalError(PALUDIS_HERE, "Got bad id '" + stringify(*id) + "'");
- i->second->push_back(id);
- }
- }
-
- using std::swap;
- swap(my_ids, _imp->ids);
}
std::shared_ptr<const PackageIDSequence>
@@ -298,17 +238,6 @@ VirtualsRepository::invalidate()
_imp.reset(new Imp<VirtualsRepository>(_imp->env, _imp->big_nasty_mutex));
}
-const std::shared_ptr<const PackageID>
-VirtualsRepository::make_virtual_package_id(
- const QualifiedPackageName & virtual_name, const std::shared_ptr<const PackageID> & provider) const
-{
- if (virtual_name.category().value() != "virtual")
- throw InternalError(PALUDIS_HERE, "tried to make a virtual package id using '" + stringify(virtual_name) + "', '"
- + stringify(*provider) + "'");
-
- return std::make_shared<virtuals::VirtualsPackageID>(_imp->env, name(), virtual_name, provider, true);
-}
-
const bool
VirtualsRepository::is_unimportant() const
{
diff --git a/paludis/repositories/virtuals/virtuals_repository.hh b/paludis/repositories/virtuals/virtuals_repository.hh
index 3544ecce1..9b476b61c 100644
--- a/paludis/repositories/virtuals/virtuals_repository.hh
+++ b/paludis/repositories/virtuals/virtuals_repository.hh
@@ -33,7 +33,6 @@ namespace paludis
*/
class PALUDIS_VISIBLE VirtualsRepository :
public Repository,
- public RepositoryMakeVirtualsInterface,
public std::enable_shared_from_this<VirtualsRepository>
{
private:
@@ -106,12 +105,6 @@ namespace paludis
virtual bool sync(const std::string &, const std::string &, const std::shared_ptr<OutputManager> &) const;
- /* RepositoryMakeVirtualsInterface */
-
- virtual const std::shared_ptr<const PackageID> make_virtual_package_id(
- const QualifiedPackageName & virtual_name, const std::shared_ptr<const PackageID> & provider) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
/* Keys */
virtual const std::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
diff --git a/paludis/repositories/virtuals/virtuals_repository_TEST.cc b/paludis/repositories/virtuals/virtuals_repository_TEST.cc
deleted file mode 100644
index 529fb40e8..000000000
--- a/paludis/repositories/virtuals/virtuals_repository_TEST.cc
+++ /dev/null
@@ -1,165 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007, 2008, 2009, 2010, 2011 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/fake/fake_repository.hh>
-#include <paludis/repositories/fake/fake_installed_repository.hh>
-#include <paludis/repositories/fake/fake_package_id.hh>
-
-#include <paludis/repositories/virtuals/virtuals_repository.hh>
-
-#include <paludis/environments/test/test_environment.hh>
-
-#include <paludis/generator.hh>
-#include <paludis/filter.hh>
-#include <paludis/filtered_generator.hh>
-#include <paludis/selection.hh>
-#include <paludis/user_dep_spec.hh>
-
-#include <paludis/util/sequence.hh>
-#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/indirect_iterator-impl.hh>
-#include <paludis/util/options.hh>
-#include <paludis/util/make_named_values.hh>
-#include <paludis/util/join.hh>
-
-#include <gtest/gtest.h>
-
-using namespace paludis;
-
-TEST(VirtualsRepository, Works)
-{
- TestEnvironment env;
- std::shared_ptr<VirtualsRepository> virtuals(std::make_shared<VirtualsRepository>(&env));
- const std::shared_ptr<FakeRepository> repo(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
- n::environment() = &env,
- n::name() = RepositoryName("repo")
- )));
- std::shared_ptr<FakeInstalledRepository> installed(std::make_shared<FakeInstalledRepository>(
- make_named_values<FakeInstalledRepositoryParams>(
- n::environment() = &env,
- n::name() = RepositoryName("installed"),
- n::suitable_destination() = true,
- n::supports_uninstall() = true
- )));
-
- ASSERT_TRUE(repo->virtuals_interface());
-
- env.add_repository(2, virtuals);
- env.add_repository(3, repo);
- env.add_repository(4, installed);
-
- repo->add_version("cat", "pkg", "1")->provide_key()->set_from_string("virtual/pkg");
- repo->add_version("cat", "pkg", "2")->provide_key()->set_from_string("virtual/pkg");
- repo->add_virtual_package(QualifiedPackageName("virtual/pkg"), std::make_shared<PackageDepSpec>(
- parse_user_package_dep_spec(">=cat/pkg-2", &env, { })));
-
- ASSERT_TRUE(bool(repo->virtual_packages()));
- ASSERT_EQ(1, std::distance(repo->virtual_packages()->begin(), repo->virtual_packages()->end()));
-
- EXPECT_TRUE(virtuals->has_category_named(CategoryNamePart("virtual"), { }));
- EXPECT_TRUE(virtuals->has_package_named(QualifiedPackageName("virtual/pkg"), { }));
-
- std::shared_ptr<const PackageIDSequence> r(env[selection::AllVersionsSorted(generator::All())]);
- ASSERT_EQ("cat/pkg-1:0::repo | cat/pkg-2:0::repo | virtual/pkg-2::virtuals (virtual for cat/pkg-2:0::repo)",
- join(indirect_iterator(r->begin()), indirect_iterator(r->end()), " | "));
-}
-
-TEST(VirtualsRepository, Duplicates)
-{
- TestEnvironment env;
- std::shared_ptr<VirtualsRepository> virtuals(std::make_shared<VirtualsRepository>(&env));
- const std::shared_ptr<FakeRepository> repo1(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
- n::environment() = &env,
- n::name() = RepositoryName("repo1")
- )));
- const std::shared_ptr<FakeRepository> repo2(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
- n::environment() = &env,
- n::name() = RepositoryName("repo2")
- )));
- std::shared_ptr<FakeInstalledRepository> installed(std::make_shared<FakeInstalledRepository>(
- make_named_values<FakeInstalledRepositoryParams>(
- n::environment() = &env,
- n::name() = RepositoryName("installed"),
- n::suitable_destination() = true,
- n::supports_uninstall() = true
- )));
-
- env.add_repository(2, virtuals);
- env.add_repository(3, repo1);
- env.add_repository(4, repo2);
- env.add_repository(5, installed);
-
- repo1->add_version("cat", "pkg", "1")->provide_key()->set_from_string("virtual/pkg");
- repo1->add_version("cat", "pkg", "2")->provide_key()->set_from_string("virtual/pkg");
- repo1->add_virtual_package(QualifiedPackageName("virtual/pkg"), std::make_shared<PackageDepSpec>(
- parse_user_package_dep_spec(">=cat/pkg-2", &env, { })));
- repo1->add_virtual_package(QualifiedPackageName("virtual/foo"), std::make_shared<PackageDepSpec>(
- parse_user_package_dep_spec(">=cat/pkg-2", &env, { })));
-
- repo2->add_virtual_package(QualifiedPackageName("virtual/pkg"), std::make_shared<PackageDepSpec>(
- parse_user_package_dep_spec(">=cat/pkg-2", &env, { })));
- repo2->add_virtual_package(QualifiedPackageName("virtual/foo"), std::make_shared<PackageDepSpec>(
- parse_user_package_dep_spec("<=cat/pkg-1", &env, { })));
-
- EXPECT_TRUE(virtuals->has_category_named(CategoryNamePart("virtual"), { }));
- EXPECT_TRUE(virtuals->has_package_named(QualifiedPackageName("virtual/pkg"), { }));
-
- std::shared_ptr<const PackageIDSequence> r(env[selection::AllVersionsSorted(generator::All())]);
- ASSERT_EQ("cat/pkg-1:0::repo1 | cat/pkg-2:0::repo1 | "
- "virtual/foo-1::virtuals (virtual for cat/pkg-1:0::repo1) | "
- "virtual/foo-2::virtuals (virtual for cat/pkg-2:0::repo1) | "
- "virtual/pkg-2::virtuals (virtual for cat/pkg-2:0::repo1)",
- join(indirect_iterator(r->begin()), indirect_iterator(r->end()), " | "));
-}
-
-TEST(VirtualsRepository, Recursion)
-{
- TestEnvironment env;
- std::shared_ptr<VirtualsRepository> virtuals(std::make_shared<VirtualsRepository>(&env));
- const std::shared_ptr<FakeRepository> repo1(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
- n::environment() = &env,
- n::name() = RepositoryName("repo1")
- )));
- const std::shared_ptr<FakeRepository> repo2(std::make_shared<FakeRepository>(make_named_values<FakeRepositoryParams>(
- n::environment() = &env,
- n::name() = RepositoryName("repo2")
- )));
-
- env.add_repository(2, repo1);
- env.add_repository(3, repo2);
- env.add_repository(4, virtuals);
-
- repo1->add_version("virtual", "gkp", "1")->provide_key()->set_from_string("virtual/pkg");
- repo1->add_virtual_package(QualifiedPackageName("virtual/pkg"), std::make_shared<PackageDepSpec>(
- parse_user_package_dep_spec("virtual/gkp", &env, { })));
-
- repo2->add_version("virtual", "pkg", "2")->provide_key()->set_from_string("virtual/pkg");
- repo2->add_virtual_package(QualifiedPackageName("virtual/pkg"), std::make_shared<PackageDepSpec>(
- parse_user_package_dep_spec("virtual/pkg", &env, { })));
-
- EXPECT_TRUE(virtuals->has_category_named(CategoryNamePart("virtual"), { }));
- EXPECT_TRUE(virtuals->has_package_named(QualifiedPackageName("virtual/pkg"), { }));
-
- std::shared_ptr<const PackageIDSequence> r(env[selection::AllVersionsSorted(generator::All())]);
- ASSERT_EQ(
- "virtual/gkp-1:0::repo1 | virtual/pkg-1::virtuals (virtual for virtual/gkp-1:0::repo1) | "
- "virtual/pkg-2:0::repo2 | virtual/pkg-2::virtuals (virtual for virtual/pkg-2:0::repo2)",
- join(indirect_iterator(r->begin()), indirect_iterator(r->end()), " | "));
-}
-