aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2013-05-16 17:51:23 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2013-05-22 16:43:42 +0100
commit39834ca3b05fadb14f855a8ab6dcea98c35738a7 (patch)
treebc6819fec8a4f4bd67c71f11a0699e9f1bac0772
parent9c7d9f9aef92e9073ee9d295b1ed5ea779f8a96d (diff)
downloadpaludis-39834ca3b05fadb14f855a8ab6dcea98c35738a7.tar.gz
paludis-39834ca3b05fadb14f855a8ab6dcea98c35738a7.tar.xz
Kill old virtuals repo code
-rw-r--r--configure.ac10
-rw-r--r--paludis/Makefile.am.m41
-rw-r--r--paludis/repositories/virtuals/Makefile.am30
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc278
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.hh138
-rw-r--r--paludis/repositories/virtuals/registration.cc75
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc227
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.hh127
-rw-r--r--paludis/repository_factory.cc3
9 files changed, 5 insertions, 884 deletions
diff --git a/configure.ac b/configure.ac
index 6c9a281..6861c5d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1482,15 +1482,15 @@ AC_SUBST([VIM_INSTALL_DIR])
dnl }}}
dnl {{{ repositories
-m4_define(ALL_REPOSITORIES_m4, [accounts,e,fake,gemcutter,repository,unavailable,unpackaged,unwritten,virtuals])
+m4_define(ALL_REPOSITORIES_m4, [accounts,e,fake,gemcutter,repository,unavailable,unpackaged,unwritten])
ALL_REPOSITORIES=`echo ALL_REPOSITORIES_m4 | tr , ' '`
-DEFAULT_REPOSITORIES="e fake repository unavailable unpackaged unwritten virtuals"
+DEFAULT_REPOSITORIES="e fake repository unavailable unpackaged unwritten"
AC_MSG_CHECKING([which repositories to build...])
AC_ARG_WITH([repositories],
[ --with-repositories=foo,bar,...
Build the specified repositories:
all All available repositories
- default Equivalent to e,fake,unavailable,unpackaged,unwritten,virtuals
+ default Equivalent to e,fake,unavailable,unpackaged,unwritten
accounts Account management (requires distribution support)
e Ebuild, Ebin, Exheres, VDB etc
@@ -1499,8 +1499,7 @@ AC_ARG_WITH([repositories],
repository Automatic repository config generation (via 'unavailable')
unavailable Unavailable
unpackaged Unpackaged (for cave import)
- unwritten Unwritten
- virtuals Old style Gentoo virtuals (non-functional, for backwards compatibility)],
+ unwritten Unwritten],
[repositories="`echo $with_repositories | tr ',' ' '`"],
[repositories="$DEFAULT_REPOSITORIES"])
repositories=`echo $repositories | tr ' ' '\n' \
@@ -1872,7 +1871,6 @@ AC_CONFIG_FILES([
paludis/repositories/unavailable/Makefile
paludis/repositories/unpackaged/Makefile
paludis/repositories/unwritten/Makefile
- paludis/repositories/virtuals/Makefile
paludis/resolver/Makefile
paludis/selinux/Makefile
paludis/syncers/Makefile
diff --git a/paludis/Makefile.am.m4 b/paludis/Makefile.am.m4
index 1b9f5eb..7fa0084 100644
--- a/paludis/Makefile.am.m4
+++ b/paludis/Makefile.am.m4
@@ -104,7 +104,6 @@ condrepo(repository)
condrepo(unavailable)
condrepo(unpackaged)
condrepo(unwritten)
-condrepo(virtuals)
environments_libadd =
diff --git a/paludis/repositories/virtuals/Makefile.am b/paludis/repositories/virtuals/Makefile.am
deleted file mode 100644
index 306fcb0..0000000
--- a/paludis/repositories/virtuals/Makefile.am
+++ /dev/null
@@ -1,30 +0,0 @@
-include $(top_srcdir)/misc/common-makefile.am
-
-AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@ @PALUDIS_CXXFLAGS_VISIBILITY@
-DEFS= \
- -DSYSCONFDIR=\"$(sysconfdir)\" \
- -DLIBEXECDIR=\"$(libexecdir)\" \
- -DDATADIR=\"$(datadir)\" \
- -DLIBDIR=\"$(libdir)\"
-
-paludis_repositories_libdir = $(libdir)/paludis/repositories
-
-noinst_LTLIBRARIES = libpaludisvirtualsrepository.la
-
-noinst_HEADERS = \
- virtuals_repository.hh \
- installed_virtuals_repository.hh
-
-libpaludisvirtualsrepository_la_SOURCES = \
- virtuals_repository.cc \
- installed_virtuals_repository.cc \
- registration.cc \
- $(noinst_HEADERS)
-
-TESTS =
-
-check_PROGRAMS = $(TESTS)
-check_SCRIPTS =
-
-EXTRA_DIST =
-
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
deleted file mode 100644
index 70e3a91..0000000
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ /dev/null
@@ -1,278 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 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/virtuals/installed_virtuals_repository.hh>
-
-#include <paludis/environment.hh>
-#include <paludis/hook.hh>
-#include <paludis/literal_metadata_key.hh>
-#include <paludis/action.hh>
-
-#include <paludis/util/pimp-impl.hh>
-#include <paludis/util/sequence.hh>
-#include <paludis/util/set.hh>
-#include <paludis/util/map.hh>
-#include <paludis/util/mutex.hh>
-#include <paludis/util/hashes.hh>
-#include <paludis/util/make_named_values.hh>
-#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/wrapped_output_iterator.hh>
-#include <paludis/util/make_null_shared_ptr.hh>
-#include <paludis/util/stringify.hh>
-#include <paludis/util/log.hh>
-
-#include <functional>
-#include <unordered_map>
-#include <algorithm>
-#include <vector>
-
-using namespace paludis;
-
-namespace paludis
-{
- template<>
- struct Imp<InstalledVirtualsRepository>
- {
- std::shared_ptr<const MetadataValueKey<FSPath> > root_key;
- std::shared_ptr<const MetadataValueKey<std::string> > format_key;
-
- Imp(const FSPath & r) :
- root_key(std::make_shared<LiteralMetadataValueKey<FSPath> >("root", "root", mkt_normal, r)),
- format_key(std::make_shared<LiteralMetadataValueKey<std::string> >("format", "format", mkt_significant, "installed_virtuals"))
- {
- }
- };
-}
-
-namespace
-{
- struct MakeSafe
- {
- char operator() (const char & c) const
- {
- static const std::string allow(
- "abcdefghijklmnopqrstuvwxyz"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- "0123456789_-");
-
- if (std::string::npos == allow.find(c))
- return '-';
- else
- return c;
- }
- };
-
- RepositoryName
- make_name(const FSPath & r)
- {
- if (FSPath("/") == r)
- return RepositoryName("installed-virtuals");
- else
- {
- std::string n("installed-virtuals-" + stringify(r)), result;
- std::transform(n.begin(), n.end(), std::back_inserter(result), MakeSafe());
- return RepositoryName(result);
- }
- }
-}
-
-InstalledVirtualsRepository::InstalledVirtualsRepository(const Environment * const env,
- const FSPath & r) :
- 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::manifest_interface() = static_cast<RepositoryManifestInterface *>(0)
- )),
- _imp(r)
-{
- add_metadata_key(_imp->root_key);
- add_metadata_key(_imp->format_key);
-}
-
-InstalledVirtualsRepository::~InstalledVirtualsRepository()
-{
-}
-
-std::shared_ptr<const PackageIDSequence>
-InstalledVirtualsRepository::package_ids(const QualifiedPackageName &, const RepositoryContentMayExcludes &) const
-{
- return std::make_shared<PackageIDSequence>();
-}
-
-std::shared_ptr<const QualifiedPackageNameSet>
-InstalledVirtualsRepository::package_names(const CategoryNamePart &, const RepositoryContentMayExcludes &) const
-{
- return std::make_shared<QualifiedPackageNameSet>();
-}
-
-std::shared_ptr<const CategoryNamePartSet>
-InstalledVirtualsRepository::category_names(const RepositoryContentMayExcludes &) const
-{
- std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
- return result;
-}
-
-bool
-InstalledVirtualsRepository::has_package_named(const QualifiedPackageName &, const RepositoryContentMayExcludes &) const
-{
- return false;
-}
-
-bool
-InstalledVirtualsRepository::has_category_named(const CategoryNamePart &, const RepositoryContentMayExcludes &) const
-{
- return false;
-}
-
-void
-InstalledVirtualsRepository::invalidate()
-{
-}
-
-HookResult
-InstalledVirtualsRepository::perform_hook(const Hook & hook, const std::shared_ptr<OutputManager> &)
-{
- Context context("When performing hook '" + stringify(hook.name()) + "' for repository '"
- + stringify(name()) + "':");
-
- return make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = "");
-}
-
-const bool
-InstalledVirtualsRepository::is_unimportant() const
-{
- return false;
-}
-
-bool
-InstalledVirtualsRepository::some_ids_might_support_action(const SupportsActionTestBase &) const
-{
- return false;
-}
-
-bool
-InstalledVirtualsRepository::some_ids_might_not_be_masked() const
-{
- return false;
-}
-
-std::shared_ptr<const CategoryNamePartSet>
-InstalledVirtualsRepository::unimportant_category_names(const RepositoryContentMayExcludes &) const
-{
- std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
- return result;
-}
-
-const std::shared_ptr<const MetadataValueKey<std::string> >
-InstalledVirtualsRepository::format_key() const
-{
- return _imp->format_key;
-}
-
-const std::shared_ptr<const MetadataValueKey<FSPath> >
-InstalledVirtualsRepository::location_key() const
-{
- return std::shared_ptr<const MetadataValueKey<FSPath> >();
-}
-
-const std::shared_ptr<const MetadataValueKey<FSPath> >
-InstalledVirtualsRepository::installed_root_key() const
-{
- return _imp->root_key;
-}
-
-void
-InstalledVirtualsRepository::need_keys_added() const
-{
-}
-
-RepositoryName
-InstalledVirtualsRepository::repository_factory_name(
- const Environment * const,
- const std::function<std::string (const std::string &)> & f)
-{
- return make_name(FSPath(f("root")));
-}
-
-std::shared_ptr<Repository>
-InstalledVirtualsRepository::repository_factory_create(
- const Environment * const env,
- const std::function<std::string (const std::string &)> & f)
-{
- if (f("root").empty())
- throw ConfigurationError("Key 'root' unspecified or empty");
-
- Log::get_instance()->message("installed_virtuals.deprecated", ll_warning, lc_no_context)
- << "Old-style virtuals no longer exist. You should remove " << f("repo_file");
-
- return std::make_shared<InstalledVirtualsRepository>(env, FSPath(f("root")));
-}
-
-std::shared_ptr<const RepositoryNameSet>
-InstalledVirtualsRepository::repository_factory_dependencies(
- const Environment * const,
- const std::function<std::string (const std::string &)> &)
-{
- return std::make_shared<RepositoryNameSet>();
-}
-
-bool
-InstalledVirtualsRepository::is_suitable_destination_for(const std::shared_ptr<const PackageID> &) const
-{
- return false;
-}
-
-bool
-InstalledVirtualsRepository::want_pre_post_phases() const
-{
- return false;
-}
-
-void
-InstalledVirtualsRepository::merge(const MergeParams &)
-{
- throw InternalError(PALUDIS_HERE, "can't merge to installed virtuals");
-}
-
-void
-InstalledVirtualsRepository::populate_sets() const
-{
-}
-
-bool
-InstalledVirtualsRepository::sync(
- const std::string &,
- const std::string &,
- const std::shared_ptr<OutputManager> &) const
-{
- return false;
-}
-
-const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > >
-InstalledVirtualsRepository::sync_host_key() const
-{
- return make_null_shared_ptr();
-}
-
-const std::shared_ptr<const Set<std::string> >
-InstalledVirtualsRepository::maybe_expand_licence_nonrecursively(const std::string &) const
-{
- return make_null_shared_ptr();
-}
-
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.hh b/paludis/repositories/virtuals/installed_virtuals_repository.hh
deleted file mode 100644
index 49dc75e..0000000
--- a/paludis/repositories/virtuals/installed_virtuals_repository.hh
+++ /dev/null
@@ -1,138 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 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
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_VIRTUALS_INSTALLED_VIRTUALS_REPOSITORY_HH
-#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_VIRTUALS_INSTALLED_VIRTUALS_REPOSITORY_HH 1
-
-#include <paludis/repository.hh>
-#include <paludis/util/map-fwd.hh>
-#include <paludis/util/sequence-fwd.hh>
-#include <memory>
-
-namespace paludis
-{
- /**
- * Repository representing installed virtual packages.
- *
- * \ingroup grpvirtualsrepository
- */
- class PALUDIS_VISIBLE InstalledVirtualsRepository :
- public Repository,
- public RepositoryDestinationInterface,
- public std::enable_shared_from_this<InstalledVirtualsRepository>
- {
- private:
- Pimp<InstalledVirtualsRepository> _imp;
-
- protected:
- virtual void need_keys_added() const;
-
- public:
- ///\name Basic operations
- //\{
-
- InstalledVirtualsRepository(const Environment * const env,
- const FSPath & root);
-
- virtual ~InstalledVirtualsRepository();
-
- ///\}
-
- ///\name RepositoryFactory functions
- ///\{
-
- static RepositoryName repository_factory_name(
- const Environment * const env,
- const std::function<std::string (const std::string &)> &);
-
- static std::shared_ptr<Repository> repository_factory_create(
- const Environment * const env,
- const std::function<std::string (const std::string &)> &);
-
- static std::shared_ptr<const RepositoryNameSet> repository_factory_dependencies(
- const Environment * const env,
- const std::function<std::string (const std::string &)> &);
-
- ///\}
-
- virtual std::shared_ptr<const CategoryNamePartSet> unimportant_category_names(
- const RepositoryContentMayExcludes &) const;
-
- virtual void invalidate();
-
- virtual const bool is_unimportant() const;
-
- HookResult perform_hook(const Hook &, const std::shared_ptr<OutputManager> &)
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- /* Repository */
-
- virtual std::shared_ptr<const PackageIDSequence> package_ids(
- const QualifiedPackageName &, const RepositoryContentMayExcludes &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual std::shared_ptr<const QualifiedPackageNameSet> package_names(
- const CategoryNamePart &, const RepositoryContentMayExcludes &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual std::shared_ptr<const CategoryNamePartSet> category_names(const RepositoryContentMayExcludes &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual bool has_package_named(const QualifiedPackageName &, const RepositoryContentMayExcludes &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual bool has_category_named(const CategoryNamePart &, const RepositoryContentMayExcludes &) 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;
-
- virtual bool sync(const std::string &, const std::string &, const std::shared_ptr<OutputManager> &) const;
-
- virtual const std::shared_ptr<const Set<std::string> > maybe_expand_licence_nonrecursively(
- const std::string &) const;
-
- /* Keys */
-
- virtual const std::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
- virtual const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_host_key() const;
-
- /* RepositoryDestinationInterface */
-
- virtual bool is_suitable_destination_for(const std::shared_ptr<const PackageID> &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual bool want_pre_post_phases() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual void merge(const MergeParams &) PALUDIS_ATTRIBUTE((noreturn));
-
- ///\name Set methods
- ///\{
-
- virtual void populate_sets() const;
-
- ///\}
- };
-}
-
-#endif
diff --git a/paludis/repositories/virtuals/registration.cc b/paludis/repositories/virtuals/registration.cc
deleted file mode 100644
index f9abb56..0000000
--- a/paludis/repositories/virtuals/registration.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007, 2008, 2009, 2010 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/repository_factory.hh>
-#include <paludis/repositories/virtuals/installed_virtuals_repository.hh>
-#include <paludis/repositories/virtuals/virtuals_repository.hh>
-#include <paludis/util/set.hh>
-#include <paludis/util/destringify.hh>
-#include "config.h"
-
-using namespace paludis;
-
-namespace
-{
- int virtual_importance(const Environment * const, const std::function<std::string (const std::string &)> & f)
- {
- if (! f("importance").empty())
- return destringify<int>(f("importance"));
- else
- return -1;
- }
-}
-
-namespace paludis
-{
- namespace repository_groups
- {
- REPOSITORY_GROUPS_DECLS;
- }
-
- template <>
- void register_repositories<repository_groups::virtuals>(const repository_groups::virtuals * const,
- RepositoryFactory * const factory)
- {
- std::shared_ptr<Set<std::string> > virtuals_formats(std::make_shared<Set<std::string>>());
- virtuals_formats->insert("virtuals");
-
- factory->add_repository_format(
- virtuals_formats,
- &VirtualsRepository::repository_factory_name,
- &virtual_importance,
- &VirtualsRepository::repository_factory_create,
- &VirtualsRepository::repository_factory_dependencies
- );
-
- std::shared_ptr<Set<std::string> > installed_virtuals_formats(std::make_shared<Set<std::string>>());
- installed_virtuals_formats->insert("installed_virtuals");
- installed_virtuals_formats->insert("installed-virtuals");
-
- factory->add_repository_format(
- installed_virtuals_formats,
- &InstalledVirtualsRepository::repository_factory_name,
- &virtual_importance,
- &InstalledVirtualsRepository::repository_factory_create,
- &InstalledVirtualsRepository::repository_factory_dependencies
- );
- }
-}
-
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
deleted file mode 100644
index e85fe84..0000000
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ /dev/null
@@ -1,227 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 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/virtuals/virtuals_repository.hh>
-
-#include <paludis/environment.hh>
-#include <paludis/match_package.hh>
-#include <paludis/action.hh>
-#include <paludis/literal_metadata_key.hh>
-#include <paludis/selection.hh>
-#include <paludis/generator.hh>
-#include <paludis/filter.hh>
-#include <paludis/filtered_generator.hh>
-#include <paludis/hook.hh>
-#include <paludis/partially_made_package_dep_spec.hh>
-
-#include <paludis/util/log.hh>
-#include <paludis/util/operators.hh>
-#include <paludis/util/pimp-impl.hh>
-#include <paludis/util/map.hh>
-#include <paludis/util/set.hh>
-#include <paludis/util/sequence.hh>
-#include <paludis/util/mutex.hh>
-#include <paludis/util/hashes.hh>
-#include <paludis/util/make_named_values.hh>
-#include <paludis/util/wrapped_forward_iterator.hh>
-#include <paludis/util/wrapped_output_iterator.hh>
-#include <paludis/util/make_null_shared_ptr.hh>
-
-#include <functional>
-#include <unordered_map>
-#include <vector>
-#include <utility>
-#include <algorithm>
-
-using namespace paludis;
-
-typedef std::unordered_map<QualifiedPackageName, std::shared_ptr<PackageIDSequence>, Hash<QualifiedPackageName> > IDMap;
-
-namespace paludis
-{
- template<>
- struct Imp<VirtualsRepository>
- {
- std::shared_ptr<const MetadataValueKey<std::string> > format_key;
-
- Imp() :
- format_key(std::make_shared<LiteralMetadataValueKey<std::string> >("format", "format", mkt_significant, "virtuals"))
- {
- }
- };
-}
-
-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::manifest_interface() = static_cast<RepositoryManifestInterface *>(0)
- )),
- _imp()
-{
- add_metadata_key(_imp->format_key);
-}
-
-VirtualsRepository::~VirtualsRepository()
-{
-}
-
-std::shared_ptr<const PackageIDSequence>
-VirtualsRepository::package_ids(const QualifiedPackageName &, const RepositoryContentMayExcludes &) const
-{
- return std::make_shared<PackageIDSequence>();
-}
-
-std::shared_ptr<const QualifiedPackageNameSet>
-VirtualsRepository::package_names(const CategoryNamePart &, const RepositoryContentMayExcludes &) const
-{
- return std::make_shared<QualifiedPackageNameSet>();
-}
-
-std::shared_ptr<const CategoryNamePartSet>
-VirtualsRepository::category_names(const RepositoryContentMayExcludes &) const
-{
- std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
- return result;
-}
-
-bool
-VirtualsRepository::has_package_named(const QualifiedPackageName &, const RepositoryContentMayExcludes &) const
-{
- return false;
-}
-
-bool
-VirtualsRepository::has_category_named(const CategoryNamePart &, const RepositoryContentMayExcludes &) const
-{
- return false;
-}
-
-void
-VirtualsRepository::invalidate()
-{
-}
-
-const bool
-VirtualsRepository::is_unimportant() const
-{
- return false;
-}
-
-bool
-VirtualsRepository::some_ids_might_support_action(const SupportsActionTestBase &) const
-{
- return false;
-}
-
-bool
-VirtualsRepository::some_ids_might_not_be_masked() const
-{
- return true;
-}
-
-std::shared_ptr<const CategoryNamePartSet>
-VirtualsRepository::unimportant_category_names(const RepositoryContentMayExcludes &) const
-{
- std::shared_ptr<CategoryNamePartSet> result(std::make_shared<CategoryNamePartSet>());
- return result;
-}
-
-const std::shared_ptr<const MetadataValueKey<std::string> >
-VirtualsRepository::format_key() const
-{
- return _imp->format_key;
-}
-
-const std::shared_ptr<const MetadataValueKey<FSPath> >
-VirtualsRepository::location_key() const
-{
- return std::shared_ptr<const MetadataValueKey<FSPath> >();
-}
-
-const std::shared_ptr<const MetadataValueKey<FSPath> >
-VirtualsRepository::installed_root_key() const
-{
- return std::shared_ptr<const MetadataValueKey<FSPath> >();
-}
-
-void
-VirtualsRepository::need_keys_added() const
-{
-}
-
-RepositoryName
-VirtualsRepository::repository_factory_name(
- const Environment * const,
- const std::function<std::string (const std::string &)> &)
-{
- return RepositoryName("virtuals");
-}
-
-std::shared_ptr<Repository>
-VirtualsRepository::repository_factory_create(
- const Environment * const env,
- const std::function<std::string (const std::string &)> & f)
-{
- Log::get_instance()->message("virtuals.deprecated", ll_warning, lc_no_context)
- << "Old-style virtuals no longer exist. You should remove " << f("repo_file");
-
- return std::make_shared<VirtualsRepository>(env);
-}
-
-std::shared_ptr<const RepositoryNameSet>
-VirtualsRepository::repository_factory_dependencies(
- const Environment * const,
- const std::function<std::string (const std::string &)> &)
-{
- return std::make_shared<RepositoryNameSet>();
-}
-
-void
-VirtualsRepository::populate_sets() const
-{
-}
-
-HookResult
-VirtualsRepository::perform_hook(const Hook &, const std::shared_ptr<OutputManager> &)
-{
- return make_named_values<HookResult>(n::max_exit_status() = 0, n::output() = "");
-}
-
-bool
-VirtualsRepository::sync(
- const std::string &,
- const std::string &,
- const std::shared_ptr<OutputManager> &) const
-{
- return false;
-}
-
-const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > >
-VirtualsRepository::sync_host_key() const
-{
- return make_null_shared_ptr();
-}
-
-const std::shared_ptr<const Set<std::string> >
-VirtualsRepository::maybe_expand_licence_nonrecursively(const std::string &) const
-{
- return make_null_shared_ptr();
-}
-
diff --git a/paludis/repositories/virtuals/virtuals_repository.hh b/paludis/repositories/virtuals/virtuals_repository.hh
deleted file mode 100644
index 09ea90c..0000000
--- a/paludis/repositories/virtuals/virtuals_repository.hh
+++ /dev/null
@@ -1,127 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 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
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_VIRTUALS_VIRTUALS_REPOSITORY_HH
-#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_VIRTUALS_VIRTUALS_REPOSITORY_HH 1
-
-#include <paludis/repository.hh>
-#include <paludis/util/map-fwd.hh>
-#include <memory>
-
-namespace paludis
-{
- /**
- * A repository holding packages representing virtuals.
- *
- * \ingroup grpvirtualsrepository
- */
- class PALUDIS_VISIBLE VirtualsRepository :
- public Repository,
- public std::enable_shared_from_this<VirtualsRepository>
- {
- private:
- Pimp<VirtualsRepository> _imp;
-
- protected:
- virtual void need_keys_added() const;
-
- public:
- ///\name Basic operations
- ///\{
-
- VirtualsRepository(const Environment * const env);
-
- virtual ~VirtualsRepository();
-
- ///\}
-
-
- ///\name RepositoryFactory functions
- ///\{
-
- static RepositoryName repository_factory_name(
- const Environment * const env,
- const std::function<std::string (const std::string &)> &);
-
- static std::shared_ptr<Repository> repository_factory_create(
- const Environment * const env,
- const std::function<std::string (const std::string &)> &);
-
- static std::shared_ptr<const RepositoryNameSet> repository_factory_dependencies(
- const Environment * const env,
- const std::function<std::string (const std::string &)> &);
-
- ///\}
-
- virtual std::shared_ptr<const CategoryNamePartSet> unimportant_category_names(
- const RepositoryContentMayExcludes &) const;
-
- virtual void invalidate();
-
- virtual const bool is_unimportant() const;
-
- virtual const std::shared_ptr<const Set<std::string> > maybe_expand_licence_nonrecursively(
- const std::string &) const;
-
- /* Repository */
-
- virtual std::shared_ptr<const PackageIDSequence> package_ids(
- const QualifiedPackageName &, const RepositoryContentMayExcludes &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual std::shared_ptr<const QualifiedPackageNameSet> package_names(
- const CategoryNamePart &, const RepositoryContentMayExcludes &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual std::shared_ptr<const CategoryNamePartSet> category_names(
- const RepositoryContentMayExcludes &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual bool has_package_named(const QualifiedPackageName &, const RepositoryContentMayExcludes &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual bool has_category_named(const CategoryNamePart &, const RepositoryContentMayExcludes &) 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;
-
- virtual bool sync(const std::string &, const std::string &, const std::shared_ptr<OutputManager> &) const;
-
- /* Keys */
-
- virtual const std::shared_ptr<const MetadataValueKey<std::string> > format_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSPath> > location_key() const;
- virtual const std::shared_ptr<const MetadataValueKey<FSPath> > installed_root_key() const;
- virtual const std::shared_ptr<const MetadataCollectionKey<Map<std::string, std::string> > > sync_host_key() const;
-
- ///\name Set methods
- ///\{
-
- virtual void populate_sets() const;
-
- ///\}
-
- virtual HookResult perform_hook(const Hook & hook, const std::shared_ptr<OutputManager> &)
- PALUDIS_ATTRIBUTE((warn_unused_result));
- };
-}
-
-#endif
diff --git a/paludis/repository_factory.cc b/paludis/repository_factory.cc
index 2966072..6e5db6c 100644
--- a/paludis/repository_factory.cc
+++ b/paludis/repository_factory.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009, 2010, 2011 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010, 2011, 2013 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
@@ -124,7 +124,6 @@ RepositoryFactory::RepositoryFactory() :
register_repositories(static_cast<const TypeOrNoType<REPOSITORY_GROUP_IF_unavailable>::Type *>(0), this);
register_repositories(static_cast<const TypeOrNoType<REPOSITORY_GROUP_IF_unwritten>::Type *>(0), this);
register_repositories(static_cast<const TypeOrNoType<REPOSITORY_GROUP_IF_unpackaged>::Type *>(0), this);
- register_repositories(static_cast<const TypeOrNoType<REPOSITORY_GROUP_IF_virtuals>::Type *>(0), this);
}
RepositoryFactory::~RepositoryFactory()