aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/virtuals
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-08-16 17:28:41 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-08-16 17:28:41 +0100
commitc0f76979f86fb54bd8ea21c0cd4e020e1577e743 (patch)
treeee84a0c996c823d961b721e196d6cf2b98222ad7 /paludis/repositories/virtuals
parentc80df694dad34cf04487a584066137e4383996f6 (diff)
downloadpaludis-c0f76979f86fb54bd8ea21c0cd4e020e1577e743.tar.gz
paludis-c0f76979f86fb54bd8ea21c0cd4e020e1577e743.tar.xz
Let repositories suggest an importance.
Diffstat (limited to 'paludis/repositories/virtuals')
-rw-r--r--paludis/repositories/virtuals/registration.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/paludis/repositories/virtuals/registration.cc b/paludis/repositories/virtuals/registration.cc
index bc533be71..1a6716506 100644
--- a/paludis/repositories/virtuals/registration.cc
+++ b/paludis/repositories/virtuals/registration.cc
@@ -21,9 +21,21 @@
#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>
using namespace paludis;
+namespace
+{
+ int virtual_importance(const Environment * const, const std::tr1::function<std::string (const std::string &)> & f)
+ {
+ if (! f("importance").empty())
+ return destringify<int>(f("importance"));
+ else
+ return -1;
+ }
+}
+
extern "C" void paludis_initialise_repository_so(RepositoryFactory * const factory) PALUDIS_VISIBLE;
void paludis_initialise_repository_so(RepositoryFactory * const factory)
@@ -34,6 +46,7 @@ void paludis_initialise_repository_so(RepositoryFactory * const factory)
factory->add_repository_format(
virtuals_formats,
&VirtualsRepository::repository_factory_name,
+ &virtual_importance,
&VirtualsRepository::repository_factory_create,
&VirtualsRepository::repository_factory_dependencies
);
@@ -45,6 +58,7 @@ void paludis_initialise_repository_so(RepositoryFactory * const factory)
factory->add_repository_format(
installed_virtuals_formats,
&InstalledVirtualsRepository::repository_factory_name,
+ &virtual_importance,
&InstalledVirtualsRepository::repository_factory_create,
&InstalledVirtualsRepository::repository_factory_dependencies
);