aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/cran/registration.cc
diff options
context:
space:
mode:
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
);