aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/cran/registration.cc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-08-11 12:47:15 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-08-11 19:18:14 +0100
commit59ebf547d0096912cc7b1110926300cd5d227640 (patch)
tree520b6fcb711b07f36a6748e603a49461531f6bcf /paludis/repositories/cran/registration.cc
parent8cf3a9dca43a6799a15d749b266e070525e7a46b (diff)
downloadpaludis-59ebf547d0096912cc7b1110926300cd5d227640.tar.gz
paludis-59ebf547d0096912cc7b1110926300cd5d227640.tar.xz
Replace RepositoryMaker with a more flexible RepositoryFactory.
Diffstat (limited to 'paludis/repositories/cran/registration.cc')
-rw-r--r--paludis/repositories/cran/registration.cc40
1 files changed, 25 insertions, 15 deletions
diff --git a/paludis/repositories/cran/registration.cc b/paludis/repositories/cran/registration.cc
index 68b72418f..663460af8 100644
--- a/paludis/repositories/cran/registration.cc
+++ b/paludis/repositories/cran/registration.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008 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
@@ -17,26 +17,36 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/repository_maker.hh>
+#include <paludis/repository_factory.hh>
#include <paludis/repositories/cran/cran_repository.hh>
#include <paludis/repositories/cran/cran_installed_repository.hh>
-#include "config.h"
+#include <paludis/util/set.hh>
using namespace paludis;
-#ifndef MONOLITHIC
+extern "C" void paludis_initialise_repository_so(RepositoryFactory * const factory) PALUDIS_VISIBLE;
-extern "C"
+void paludis_initialise_repository_so(RepositoryFactory * const factory)
{
- void PALUDIS_VISIBLE register_repositories(RepositoryMaker * maker);
+ std::tr1::shared_ptr<Set<std::string> > cran_formats(new Set<std::string>);
+ cran_formats->insert("cran");
+
+ factory->add_repository_format(
+ cran_formats,
+ &CRANRepository::repository_factory_name,
+ &CRANRepository::repository_factory_create,
+ &CRANRepository::repository_factory_dependencies
+ );
+
+ std::tr1::shared_ptr<Set<std::string> > installed_cran_formats(new Set<std::string>);
+ installed_cran_formats->insert("installed_cran");
+ installed_cran_formats->insert("installed-cran");
+
+ factory->add_repository_format(
+ installed_cran_formats,
+ &CRANInstalledRepository::repository_factory_name,
+ &CRANInstalledRepository::repository_factory_create,
+ &CRANInstalledRepository::repository_factory_dependencies
+ );
}
-void register_repositories(RepositoryMaker * maker)
-{
- maker->register_maker("cran", &CRANRepository::make_cran_repository);
- maker->register_maker("installed_cran", &CRANInstalledRepository::make_cran_installed_repository);
-}
-
-#endif
-
-