aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/cran/registration.cc
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/cran/registration.cc
parentc80df694dad34cf04487a584066137e4383996f6 (diff)
downloadpaludis-c0f76979f86fb54bd8ea21c0cd4e020e1577e743.tar.gz
paludis-c0f76979f86fb54bd8ea21c0cd4e020e1577e743.tar.xz
Let repositories suggest an importance.
Diffstat (limited to 'paludis/repositories/cran/registration.cc')
-rw-r--r--paludis/repositories/cran/registration.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/paludis/repositories/cran/registration.cc b/paludis/repositories/cran/registration.cc
index 663460af8..8cfe3449c 100644
--- a/paludis/repositories/cran/registration.cc
+++ b/paludis/repositories/cran/registration.cc
@@ -21,11 +21,23 @@
#include <paludis/repositories/cran/cran_repository.hh>
#include <paludis/repositories/cran/cran_installed_repository.hh>
#include <paludis/util/set.hh>
+#include <paludis/util/destringify.hh>
using namespace paludis;
extern "C" void paludis_initialise_repository_so(RepositoryFactory * const factory) PALUDIS_VISIBLE;
+namespace
+{
+ int generic_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;
+ }
+}
+
void paludis_initialise_repository_so(RepositoryFactory * const factory)
{
std::tr1::shared_ptr<Set<std::string> > cran_formats(new Set<std::string>);
@@ -34,6 +46,7 @@ void paludis_initialise_repository_so(RepositoryFactory * const factory)
factory->add_repository_format(
cran_formats,
&CRANRepository::repository_factory_name,
+ &generic_importance,
&CRANRepository::repository_factory_create,
&CRANRepository::repository_factory_dependencies
);
@@ -45,6 +58,7 @@ void paludis_initialise_repository_so(RepositoryFactory * const factory)
factory->add_repository_format(
installed_cran_formats,
&CRANInstalledRepository::repository_factory_name,
+ &generic_importance,
&CRANInstalledRepository::repository_factory_create,
&CRANInstalledRepository::repository_factory_dependencies
);