aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-06-11 22:35:14 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-06-11 22:35:32 +0100
commitc8c5434b8587ac54c1da2d3510962fe5005db845 (patch)
tree29b174adbebc95a9b527d2aebf2cba963a5acc7f
parente27dabb7c338116b1f496d09d51c6869e298e043 (diff)
downloadpaludis-c8c5434b8587ac54c1da2d3510962fe5005db845.tar.gz
paludis-c8c5434b8587ac54c1da2d3510962fe5005db845.tar.xz
Remove VirtualsInterface
-rw-r--r--.gitignore4
-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
-rw-r--r--paludis/repository-fwd.hh2
-rw-r--r--paludis/repository.cc12
-rw-r--r--paludis/repository.hh62
-rw-r--r--paludis/resolver/Makefile.am22
-rw-r--r--paludis/resolver/resolver_TEST_virtuals.cc113
-rwxr-xr-xpaludis/resolver/resolver_TEST_virtuals_cleanup.sh9
-rwxr-xr-xpaludis/resolver/resolver_TEST_virtuals_setup.sh74
-rwxr-xr-xpython/environment_TEST.py8
-rwxr-xr-xpython/mask_TEST.py16
-rwxr-xr-xpython/package_id_TEST.py8
-rw-r--r--python/repository.cc21
-rwxr-xr-xpython/repository_TEST.py4
-rw-r--r--ruby/repository.cc2
-rw-r--r--ruby/repository_TEST.rb4
37 files changed, 20 insertions, 863 deletions
diff --git a/.gitignore b/.gitignore
index 5a22b83..c2e0902 100644
--- a/.gitignore
+++ b/.gitignore
@@ -363,8 +363,6 @@ paludis-*.*.*.tar.bz2
/paludis/repositories/unpackaged/installed_repository_TEST
/paludis/repositories/unpackaged/unpackaged_repository_TEST
/paludis/repositories/unwritten/unwritten_repository_TEST
-/paludis/repositories/virtuals/installed_virtuals_repository_TEST
-/paludis/repositories/virtuals/virtuals_repository_TEST
/paludis/repository_name_cache_TEST
/paludis/resolver/resolver_TEST_any
/paludis/resolver/resolver_TEST_blockers
@@ -377,7 +375,6 @@ paludis-*.*.*.tar.bz2
/paludis/resolver/resolver_TEST_simple
/paludis/resolver/resolver_TEST_suggestions
/paludis/resolver/resolver_TEST_uninstalls
-/paludis/resolver/resolver_TEST_virtuals
/paludis/selection_TEST
/paludis/set_file_TEST
/paludis/stringify_formatter_TEST
@@ -480,7 +477,6 @@ paludis-*.*.*.tar.bz2
/paludis/util/tokeniser_TEST
/paludis/util/tribool_TEST
/paludis/util/util.hh
-/paludis/util/virtual_constructor_TEST
/paludis/util/visitor_TEST
/paludis/util/visitor_cast_TEST
/paludis/util/wildcard_expander_TEST
diff --git a/paludis/repositories/accounts/accounts_repository.cc b/paludis/repositories/accounts/accounts_repository.cc
index 7742e6c..1827d2b 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 04a93d9..9fc779e 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 411d52b..63f4930 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 24eef92..b1c81d5 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 1227fe7..7fb2d82 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 5c6c4f4..d2963b3 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 1bc15b5..bec8e5c 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 3bed239..ca106a0 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 02cdcd5..a7cd664 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 dc3f291..b1895ef 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 faab0cb..567c503 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 957341b..8bb872c 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 fca38ad..2cbade8 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 159c38b..df90d9f 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 49e17fe..cd92f72 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 fbf1929..717fbc7 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 af68f0f..bd575b8 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 1a41407..0ed495f 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 aac3eac..0000000
--- 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 d3233e7..69155cb 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 3544ecc..9b476b6 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 529fb40..0000000
--- 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()), " | "));
-}
-
diff --git a/paludis/repository-fwd.hh b/paludis/repository-fwd.hh
index f65a7b6..bb4a978 100644
--- a/paludis/repository-fwd.hh
+++ b/paludis/repository-fwd.hh
@@ -42,8 +42,6 @@ namespace paludis
class Repository;
class RepositoryEnvironmentVariableInterface;
- class RepositoryVirtualsInterface;
- class RepositoryMakeVirtualsInterface;
class RepositoryDestinationInterface;
class RepositoryManifestInterface;
diff --git a/paludis/repository.cc b/paludis/repository.cc
index 67f4251..f0dcb18 100644
--- a/paludis/repository.cc
+++ b/paludis/repository.cc
@@ -49,10 +49,6 @@ template class Set<std::shared_ptr<Repository> >;
template class WrappedForwardIterator<Set<std::shared_ptr<Repository> >::ConstIteratorTag, const std::shared_ptr<Repository> >;
template class WrappedOutputIterator<Set<std::shared_ptr<Repository> >::InserterTag, std::shared_ptr<Repository> >;
-template class Sequence<RepositoryVirtualsEntry>;
-template class WrappedForwardIterator<Sequence<RepositoryVirtualsEntry>::ConstIteratorTag, const RepositoryVirtualsEntry>;
-template class WrappedOutputIterator<Sequence<RepositoryVirtualsEntry>::InserterTag, RepositoryVirtualsEntry>;
-
NoSuchSetError::NoSuchSetError(const std::string & our_name) throw () :
Exception("Could not find '" + our_name + "'"),
_name(our_name)
@@ -181,18 +177,10 @@ RepositoryEnvironmentVariableInterface::~RepositoryEnvironmentVariableInterface(
{
}
-RepositoryVirtualsInterface::~RepositoryVirtualsInterface()
-{
-}
-
RepositoryDestinationInterface::~RepositoryDestinationInterface()
{
}
-RepositoryMakeVirtualsInterface::~RepositoryMakeVirtualsInterface()
-{
-}
-
RepositoryManifestInterface::~RepositoryManifestInterface()
{
}
diff --git a/paludis/repository.hh b/paludis/repository.hh
index abf077b..e6899c3 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -94,23 +94,7 @@ namespace paludis
{
NamedValue<n::destination_interface, RepositoryDestinationInterface *> destination_interface;
NamedValue<n::environment_variable_interface, RepositoryEnvironmentVariableInterface *> environment_variable_interface;
- NamedValue<n::make_virtuals_interface, RepositoryMakeVirtualsInterface *> make_virtuals_interface;
NamedValue<n::manifest_interface, RepositoryManifestInterface *> manifest_interface;
- NamedValue<n::virtuals_interface, RepositoryVirtualsInterface *> virtuals_interface;
- };
-
- /**
- * A virtuals entry in a Repository implementing RepositoryVirtualsInterface.
- *
- * \see Repository
- * \see RepositoryVirtualsInterface
- * \ingroup g_repository
- * \since 0.30
- */
- struct RepositoryVirtualsEntry
- {
- NamedValue<n::provided_by_spec, std::shared_ptr<const PackageDepSpec> > provided_by_spec;
- NamedValue<n::virtual_name, QualifiedPackageName> virtual_name;
};
/**
@@ -498,52 +482,6 @@ namespace paludis
};
/**
- * Interface for repositories that define virtuals.
- *
- * \see Repository
- * \ingroup g_repository
- * \nosubgrouping
- */
- class PALUDIS_VISIBLE RepositoryVirtualsInterface
- {
- public:
- ///\name Virtuals functionality
- ///\{
-
- /**
- * A collection of virtuals.
- */
- typedef Sequence<RepositoryVirtualsEntry> VirtualsSequence;
-
- /**
- * Fetch our virtual packages.
- */
- virtual std::shared_ptr<const VirtualsSequence> virtual_packages() const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
-
- ///\}
-
- virtual ~RepositoryVirtualsInterface();
- };
-
- /**
- * Interface for repositories that can make virtuals on the fly.
- *
- * \see Repository
- * \ingroup g_repository
- * \nosubgrouping
- */
- class PALUDIS_VISIBLE RepositoryMakeVirtualsInterface
- {
- public:
- virtual ~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)) = 0;
- };
-
- /**
* Interface for repositories that can be used as an install destination.
*
* \see Repository
diff --git a/paludis/resolver/Makefile.am b/paludis/resolver/Makefile.am
index dddbf1b..e334cb5 100644
--- a/paludis/resolver/Makefile.am
+++ b/paludis/resolver/Makefile.am
@@ -177,10 +177,6 @@ libpaludisresolver_a_SOURCES = \
use_existing.cc \
why_changed_choices.cc
-if ENABLE_VIRTUALS_REPOSITORY
-virtuals_tests = resolver_TEST_virtuals
-endif
-
noinst_LIBRARIES = libpaludisresolver.a
TESTS = \
@@ -194,8 +190,7 @@ TESTS = \
resolver_TEST_continue_on_failure \
resolver_TEST_uninstalls \
resolver_TEST_fetches \
- resolver_TEST_purges \
- $(virtuals_tests)
+ resolver_TEST_purges
check_PROGRAMS = $(TESTS)
@@ -205,7 +200,6 @@ check_SCRIPTS = \
resolver_TEST_serialisation_setup.sh resolver_TEST_serialisation_cleanup.sh \
resolver_TEST_suggestions_setup.sh resolver_TEST_suggestions_cleanup.sh \
resolver_TEST_simple_setup.sh resolver_TEST_simple_cleanup.sh \
- resolver_TEST_virtuals_setup.sh resolver_TEST_virtuals_cleanup.sh \
resolver_TEST_any_setup.sh resolver_TEST_any_cleanup.sh \
resolver_TEST_errors_setup.sh resolver_TEST_errors_cleanup.sh \
resolver_TEST_continue_on_failure_setup.sh resolver_TEST_continue_on_failure_cleanup.sh \
@@ -247,20 +241,6 @@ resolver_TEST_cycles_CXXFLAGS = $(AM_CXXFLAGS) @PALUDIS_CXXFLAGS_NO_DEBUGGING@ @
resolver_TEST_cycles_LDFLAGS = @GTESTDEPS_LDFLAGS@ @GTESTDEPS_LIBS@
-resolver_TEST_virtuals_SOURCES = resolver_TEST_virtuals.cc
-
-resolver_TEST_virtuals_LDADD = \
- libpaludisresolvertest.a \
- $(top_builddir)/paludis/util/gtest_runner.o \
- $(top_builddir)/paludis/libpaludis_@PALUDIS_PC_SLOT@.la \
- $(top_builddir)/paludis/util/libpaludisutil_@PALUDIS_PC_SLOT@.la \
- libpaludisresolver.a \
- $(DYNAMIC_LD_LIBS)
-
-resolver_TEST_virtuals_CXXFLAGS = $(AM_CXXFLAGS) @PALUDIS_CXXFLAGS_NO_DEBUGGING@ @GTESTDEPS_CXXFLAGS@
-
-resolver_TEST_virtuals_LDFLAGS = @GTESTDEPS_LDFLAGS@ @GTESTDEPS_LIBS@
-
resolver_TEST_suggestions_SOURCES = resolver_TEST_suggestions.cc
resolver_TEST_suggestions_LDADD = \
diff --git a/paludis/resolver/resolver_TEST_virtuals.cc b/paludis/resolver/resolver_TEST_virtuals.cc
deleted file mode 100644
index 5bbc7dc..0000000
--- a/paludis/resolver/resolver_TEST_virtuals.cc
+++ /dev/null
@@ -1,113 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 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/resolver/resolver.hh>
-#include <paludis/resolver/resolver_functions.hh>
-#include <paludis/resolver/resolution.hh>
-#include <paludis/resolver/decision.hh>
-#include <paludis/resolver/constraint.hh>
-#include <paludis/resolver/resolvent.hh>
-#include <paludis/resolver/suggest_restart.hh>
-
-#include <paludis/environments/test/test_environment.hh>
-
-#include <paludis/util/make_named_values.hh>
-#include <paludis/util/options.hh>
-#include <paludis/util/wrapped_forward_iterator-impl.hh>
-#include <paludis/util/sequence.hh>
-#include <paludis/util/map.hh>
-#include <paludis/util/indirect_iterator-impl.hh>
-#include <paludis/util/accept_visitor.hh>
-#include <paludis/util/make_shared_copy.hh>
-
-#include <paludis/user_dep_spec.hh>
-#include <paludis/repository_factory.hh>
-
-#include <paludis/resolver/resolver_test.hh>
-
-#include <list>
-#include <functional>
-#include <algorithm>
-#include <map>
-
-using namespace paludis;
-using namespace paludis::resolver;
-using namespace paludis::resolver::resolver_test;
-
-namespace
-{
- struct ResolverVirtualsTestCase : ResolverTestCase
- {
- std::shared_ptr<ResolverTestData> data;
-
- void SetUp()
- {
- data = std::make_shared<ResolverTestData>("virtuals", "0", "traditional");
- }
-
- void TearDown()
- {
- data.reset();
- }
- };
-}
-
-TEST_F(ResolverVirtualsTestCase, Virtuals)
-{
- std::shared_ptr<const Resolved> resolved(data->get_resolved("virtuals/target"));
-
- check_resolved(resolved,
- n::taken_change_or_remove_decisions() = make_shared_copy(DecisionChecks()
- .change(QualifiedPackageName("cat/foo-a"))
- .change(QualifiedPackageName("virtuals/target"))
- .finished()),
- n::taken_unable_to_make_decisions() = make_shared_copy(DecisionChecks()
- .finished()),
- n::taken_unconfirmed_decisions() = make_shared_copy(DecisionChecks()
- .finished()),
- n::taken_unorderable_decisions() = make_shared_copy(DecisionChecks()
- .finished()),
- n::untaken_change_or_remove_decisions() = make_shared_copy(DecisionChecks()
- .finished()),
- n::untaken_unable_to_make_decisions() = make_shared_copy(DecisionChecks()
- .finished())
- );
-}
-
-TEST_F(ResolverVirtualsTestCase, VirtualsTarget)
-{
- std::shared_ptr<const Resolved> resolved(data->get_resolved("virtual/virtual-target"));
-
- check_resolved(resolved,
- n::taken_change_or_remove_decisions() = make_shared_copy(DecisionChecks()
- .change(QualifiedPackageName("cat/real-target"))
- .finished()),
- n::taken_unable_to_make_decisions() = make_shared_copy(DecisionChecks()
- .finished()),
- n::taken_unconfirmed_decisions() = make_shared_copy(DecisionChecks()
- .finished()),
- n::taken_unorderable_decisions() = make_shared_copy(DecisionChecks()
- .finished()),
- n::untaken_change_or_remove_decisions() = make_shared_copy(DecisionChecks()
- .finished()),
- n::untaken_unable_to_make_decisions() = make_shared_copy(DecisionChecks()
- .finished())
- );
-}
-
diff --git a/paludis/resolver/resolver_TEST_virtuals_cleanup.sh b/paludis/resolver/resolver_TEST_virtuals_cleanup.sh
deleted file mode 100755
index 85c857e..0000000
--- a/paludis/resolver/resolver_TEST_virtuals_cleanup.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/env bash
-# vim: set ft=sh sw=4 sts=4 et :
-
-if [ -d resolver_TEST_virtuals_dir ] ; then
- rm -fr resolver_TEST_virtuals_dir
-else
- true
-fi
-
diff --git a/paludis/resolver/resolver_TEST_virtuals_setup.sh b/paludis/resolver/resolver_TEST_virtuals_setup.sh
deleted file mode 100755
index cffe73b..0000000
--- a/paludis/resolver/resolver_TEST_virtuals_setup.sh
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/usr/bin/env bash
-# vim: set ft=sh sw=4 sts=4 et :
-
-mkdir resolver_TEST_virtuals_dir || exit 1
-cd resolver_TEST_virtuals_dir || exit 1
-
-mkdir -p build
-mkdir -p distdir
-mkdir -p installed
-
-mkdir -p repo/{profiles/profile,metadata}
-
-cd repo
-echo "repo" > profiles/repo_name
-: > profiles/categories
-cat <<'END' > profiles/profile/make.defaults
-ARCH=test
-END
-cat <<'END' > profiles/profile/virtuals
-virtual/foo cat/foo-a
-virtual/virtual-target cat/real-target
-END
-
-# common providers
-
-echo 'cat' >> profiles/categories
-
-mkdir -p 'cat/real-target'
-cat <<END > cat/real-target/real-target-1.ebuild
-DESCRIPTION="dep"
-KEYWORDS="test"
-SLOT="0"
-PROVIDE="virtual/virtual-target"
-END
-
-mkdir -p 'cat/foo-a'
-cat <<END > cat/foo-a/foo-a-1.ebuild
-DESCRIPTION="dep"
-KEYWORDS="test"
-SLOT="0"
-PROVIDE="virtual/foo"
-END
-
-mkdir -p 'cat/foo-b'
-cat <<END > cat/foo-b/foo-b-1.ebuild
-DESCRIPTION="dep"
-KEYWORDS="test"
-SLOT="0"
-PROVIDE="virtual/foo"
-END
-
-mkdir -p 'cat/foo-c'
-cat <<END > cat/foo-c/foo-c-1.ebuild
-DESCRIPTION="dep"
-KEYWORDS="test"
-SLOT="0"
-PROVIDE="virtual/foo"
-END
-
-# virtuals
-echo 'virtuals' >> profiles/categories
-
-mkdir -p 'virtuals/target'
-cat <<END > virtuals/target/target-1.ebuild
-DESCRIPTION="target"
-KEYWORDS="test"
-SLOT="0"
-DEPEND="
- ( virtual/foo )
- "
-END
-
-cd ..
-
diff --git a/python/environment_TEST.py b/python/environment_TEST.py
index a9e62d6..c81b01f 100755
--- a/python/environment_TEST.py
+++ b/python/environment_TEST.py
@@ -80,14 +80,6 @@ class TestCase_01_Environments(unittest.TestCase):
self.assertRaises(NoSuchPackageError, self.e.fetch_unique_qualified_package_name, "bar",
Filter.SupportsUninstallAction())
- def test_26_repositories(self):
- if os.environ.get("PALUDIS_ENABLE_VIRTUALS_REPOSITORY") == "yes":
- self.assert_(self.e.more_important_than("testrepo", "virtuals"))
- self.assert_(not self.e.more_important_than("virtuals", "testrepo"))
- self.assertRaises(NoSuchRepositoryError, self.e.fetch_repository, "blah")
-
- self.assertEqual(len(list(self.e.repositories)), 3)
-
class TestCase_03_TestEnvironment(unittest.TestCase):
def test_01_create(self):
e = TestEnvironment()
diff --git a/python/mask_TEST.py b/python/mask_TEST.py
index f38a2da..e9f7221 100755
--- a/python/mask_TEST.py
+++ b/python/mask_TEST.py
@@ -86,22 +86,6 @@ class TestCase_01_Masks(unittest.TestCase):
self.assertEquals(m.description(), "eapi")
self.assertEquals(m.explanation(), "Unsupported EAPI 'unsupported'")
- def test_05_association_mask(self):
- if os.environ.get("PALUDIS_ENABLE_VIRTUALS_REPOSITORY") == "yes":
- q = Selection.RequireExactlyOne(Generator.Matches(
- parse_user_package_dep_spec("=virtual/association-1.0", self.e, []), []))
- pid = iter(self.e[q]).next()
- m = iter(pid.masks).next()
-
- self.assert_(isinstance(m, Mask))
- self.assert_(isinstance(m, AssociationMask))
-
- self.assertEquals(m.key(), "A")
- self.assertEquals(m.description(), "by association")
- self.assertEquals(m.associated_package_spec().package, "masked/repo")
- elif os.environ.get("PALUDIS_ENABLE_VIRTUALS_REPOSITORY") != "no":
- raise "oops"
-
class TestCase_02_Masks_subclassing(unittest.TestCase):
def test_01_user_mask(self):
class TestUserMask(UserMask):
diff --git a/python/package_id_TEST.py b/python/package_id_TEST.py
index b85b52b..620f78d 100755
--- a/python/package_id_TEST.py
+++ b/python/package_id_TEST.py
@@ -33,8 +33,6 @@ class TestCase_01_PackageID(unittest.TestCase):
self.e = NoConfigEnvironment(repo_path, "/var/empty")
self.ie = NoConfigEnvironment(irepo_path)
self.pid = iter(self.e.fetch_repository("testrepo").package_ids("foo/bar", [])).next()
- if os.environ.get("PALUDIS_ENABLE_VIRTUALS_REPOSITORY") == "yes":
- self.vpid = iter(self.e.fetch_repository("virtuals").package_ids("virtual/bar", [])).next()
self.ipid = iter(self.ie.fetch_repository("installed").package_ids("cat-one/pkg-one", [])).next()
self.mpid = iter(self.e.fetch_repository("testrepo").package_ids("cat/masked", [])).next()
@@ -106,12 +104,6 @@ class TestCase_01_PackageID(unittest.TestCase):
mask = iter(self.mpid.masks).next()
self.assert_(isinstance(mask, UnacceptedMask))
- def test_14_virtual_for_key(self):
- if os.environ.get("PALUDIS_ENABLE_VIRTUALS_REPOSITORY") == "yes":
- self.assertEquals(self.vpid.virtual_for_key().parse_value(), self.pid)
- self.assertEquals(self.pid.virtual_for_key(), None)
- self.assertEquals(self.ipid.virtual_for_key(), None)
-
def test_15_provide_key(self):
self.assert_(isinstance(self.pid.provide_key(), MetadataProvideSpecTreeKey))
self.assertEquals(self.ipid.provide_key(), None)
diff --git a/python/repository.cc b/python/repository.cc
index 25e8821..17df1b1 100644
--- a/python/repository.cc
+++ b/python/repository.cc
@@ -47,12 +47,6 @@ struct RepositoryWrapper :
return self.environment_variable_interface();
}
- static RepositoryVirtualsInterface *
- get_virtuals_interface(const Repository & self)
- {
- return self.virtuals_interface();
- }
-
static RepositoryDestinationInterface *
get_destination_interface(const Repository & self)
{
@@ -172,11 +166,6 @@ void expose_repository()
"[ro] RepositoryEnvironmentInterface"
)
- .add_property("virtuals_interface", bp::make_function(&RepositoryWrapper::get_virtuals_interface,
- bp::return_internal_reference<>()),
- "[ro] RepositoryVirtualsInterface"
- )
-
.add_property("destination_interface", bp::make_function(&RepositoryWrapper::get_destination_interface,
bp::return_internal_reference<>()),
"[ro] RepositoryDestinationInterface"
@@ -218,16 +207,6 @@ void expose_repository()
);
/**
- * RepositoryVirtualsInterface
- */
- bp::class_<RepositoryVirtualsInterface, boost::noncopyable>
- (
- "RepositoryVirtualsInterface",
- "Interface for repositories that define virtuals.",
- bp::no_init
- );
-
- /**
* RepositoryDestinationInterface
*/
bp::class_<RepositoryDestinationInterface, boost::noncopyable>
diff --git a/python/repository_TEST.py b/python/repository_TEST.py
index 101282c..4cb9d3b 100755
--- a/python/repository_TEST.py
+++ b/python/repository_TEST.py
@@ -110,10 +110,6 @@ class TestCase_02_RepositoryInterfaces(unittest.TestCase):
evi = repo.environment_variable_interface
self.assert_(isinstance(evi, RepositoryEnvironmentVariableInterface))
- def test_09_virtuals_interface(self):
- vi = repo.virtuals_interface
- self.assert_(isinstance(vi, RepositoryVirtualsInterface))
-
def test_10_destination_interface(self):
di = irepo.destination_interface
self.assert_(isinstance(di, RepositoryDestinationInterface))
diff --git a/ruby/repository.cc b/ruby/repository.cc
index 537e51c..78a1044 100644
--- a/ruby/repository.cc
+++ b/ruby/repository.cc
@@ -632,8 +632,6 @@ namespace
rb_define_method(c_repository, "environment_variable_interface", RUBY_FUNC_CAST((&Interface<
n::environment_variable_interface, RepositoryEnvironmentVariableInterface, &Repository::environment_variable_interface>::fetch)), 0);
- rb_define_method(c_repository, "virtuals_interface", RUBY_FUNC_CAST((&Interface<
- n::virtuals_interface, RepositoryVirtualsInterface, &Repository::virtuals_interface>::fetch)), 0);
rb_define_method(c_repository, "some_ids_might_support_action", RUBY_FUNC_CAST(&repository_some_ids_might_support_action), 1);
rb_define_method(c_repository, "[]", RUBY_FUNC_CAST(&repository_subscript), 1);
diff --git a/ruby/repository_TEST.rb b/ruby/repository_TEST.rb
index 8ca9957..dfb2a3b 100644
--- a/ruby/repository_TEST.rb
+++ b/ruby/repository_TEST.rb
@@ -167,15 +167,13 @@ module Paludis
def test_responds
repo = no_config_testrepo.main_repository
- [
- :environment_variable_interface, :virtuals_interface].each do |sym|
+ [ :environment_variable_interface ].each do |sym|
assert_respond_to repo, sym
end
end
def test_interfaces
assert_equal installed_repo.name, installed_repo.environment_variable_interface.name
- assert_nil installed_repo.virtuals_interface
end
def text_repository_environment_interface