# to find the KeyRingTest receiver
INCLUDE_DIRECTORIES( ${LIBZYPP_SOURCE_DIR}/tests/zypp )
-ADD_TESTS(RepoVariables ExtendedMetadata LocalServices)
+ADD_TESTS(RepoVariables ExtendedMetadata PluginServices)
#include "zypp/PathInfo.h"
#include "zypp/TmpPath.h"
#include "zypp/ZConfig.h"
-#include "zypp/repo/LocalServices.h"
+#include "zypp/repo/PluginServices.h"
#include "zypp/ServiceInfo.h"
using std::cout;
};
-BOOST_AUTO_TEST_CASE(replace_text)
+BOOST_AUTO_TEST_CASE(plugin_services)
{
ServiceCollector::ServiceSet services;
- LocalServices local("/space/tmp/services", ServiceCollector(services));
+ PluginServices local("/space/tmp/services", ServiceCollector(services));
}
// vim: set ts=2 sts=2 sw=2 ai et:
BOOST_CHECK( r.info().hasLicense() );
}
-BOOST_AUTO_TEST_CASE(localservices_test)
+BOOST_AUTO_TEST_CASE(pluginservices_test)
{
TmpDir tmpCachePath;
RepoManagerOptions opts( RepoManagerOptions::makeTestSetup( tmpCachePath ) ) ;
filesystem::mkdir( opts.knownReposPath );
filesystem::mkdir( opts.knownServicesPath );
- opts.localServicesPath = DATADIR + "/local-service-lib-1";
- BOOST_CHECK(PathInfo(opts.localServicesPath / "service").isExist());
+ opts.pluginServicesPath = DATADIR + "/plugin-service-lib-1";
+ BOOST_CHECK(PathInfo(opts.pluginServicesPath / "service").isExist());
{
RepoManager manager(opts);
- BOOST_CHECK_EQUAL(1, manager.serviceSize());
+ BOOST_REQUIRE_EQUAL(1, manager.serviceSize());
BOOST_CHECK(manager.repoEmpty());
ServiceInfo service(*manager.serviceBegin());
BOOST_CHECK_EQUAL("service", service.alias());
- BOOST_CHECK_EQUAL( "file:" + DATADIR.asString() + "/local-service-lib-1/service", service.url().asString());
+ BOOST_CHECK_EQUAL( "file:" + DATADIR.asString() + "/plugin-service-lib-1/service", service.url().asString());
// now refresh the service
manager.refreshServices();
BOOST_CHECK_EQUAL((unsigned) 2, manager.repoSize());
-
//std::list<RepoInfo> infos;
//manager.getRepositoriesInService("test",
// insert_iterator<std::list<RepoInfo> >(infos,infos.begin()));
}
// Now simulate the service changed
- opts.localServicesPath = DATADIR + "/local-service-lib-2";
+ opts.pluginServicesPath = DATADIR + "/plugin-service-lib-2";
{
RepoManager manager(opts);
- BOOST_CHECK_EQUAL(1, manager.serviceSize());
+ BOOST_REQUIRE_EQUAL(1, manager.serviceSize());
ServiceInfo service(*manager.serviceBegin());
BOOST_CHECK_EQUAL("service", service.alias());
- BOOST_CHECK_EQUAL( "file:" + DATADIR.asString() + "/local-service-lib-2/service", service.url().asString());
+ BOOST_CHECK_EQUAL( "file:" + DATADIR.asString() + "/plugin-service-lib-2/service", service.url().asString());
// now refresh the service
manager.refreshServices();
BOOST_CHECK_EQUAL((unsigned) 1, manager.repoSize());
repo/Downloader.cc
repo/RepoVariables.cc
repo/RepoInfoBase.cc
- repo/LocalServices.cc
+ repo/PluginServices.cc
repo/ServiceRepos.cc
)
repo/RepoVariables.h
repo/RepoInfoBase.h
repo/RepoInfoBaseImpl.h
- repo/LocalServices.h
+ repo/PluginServices.h
repo/ServiceRepos.h
)
#include "zypp/repo/yum/Downloader.h"
#include "zypp/repo/susetags/Downloader.h"
#include "zypp/parser/plaindir/RepoParser.h"
-#include "zypp/repo/LocalServices.h"
+#include "zypp/repo/PluginServices.h"
#include "zypp/Target.h" // for Target::targetDistribution() for repo index services
#include "zypp/ZYppFactory.h" // to get the Target from ZYpp instance
repoPackagesCachePath = Pathname::assertprefix( root_r, ZConfig::instance().repoPackagesPath() );
knownReposPath = Pathname::assertprefix( root_r, ZConfig::instance().knownReposPath() );
knownServicesPath = Pathname::assertprefix( root_r, ZConfig::instance().knownServicesPath() );
- localServicesPath = Pathname::assertprefix( root_r, ZConfig::instance().localServicesPath() );
+ pluginServicesPath = Pathname::assertprefix( root_r, ZConfig::instance().pluginServicesPath() );
probe = ZConfig::instance().repo_add_probe();
rootDir = root_r;
ret.repoPackagesCachePath = root_r/"packages";
ret.knownReposPath = root_r/"repos.d";
ret.knownServicesPath = root_r/"services.d";
- ret.localServicesPath = root_r/"services-lib";
+ ret.pluginServicesPath = root_r/"plugin-services";
ret.rootDir = root_r;
return ret;
}
}
}
- repo::LocalServices(options.localServicesPath, ServiceCollector(services));
+ repo::PluginServices(options.pluginServicesPath, ServiceCollector(services));
}
void RepoManager::Impl::init_knownRepositories()
Pathname repoPackagesCachePath;
Pathname knownReposPath;
Pathname knownServicesPath;
- Pathname localServicesPath;
+ Pathname pluginServicesPath;
bool probe;
/**
* Target distro ID to be used when refreshing repo index services.
{
cfg_known_services_path = Pathname(value);
}
- else if ( entry == "localservicesdir" )
+ else if ( entry == "pluginservicesdir" )
{
- cfg_local_services_path = Pathname(value);
+ cfg_plugin_services_path = Pathname(value);
}
else if ( entry == "repo.add.probe" )
{
Pathname cfg_config_path;
Pathname cfg_known_repos_path;
Pathname cfg_known_services_path;
- Pathname cfg_local_services_path;
+ Pathname cfg_plugin_services_path;
Pathname cfg_vendor_path;
Pathname locks_file;
? (configPath()/"services.d") : _pimpl->cfg_known_repos_path );
}
- Pathname ZConfig::localServicesPath() const
+ Pathname ZConfig::pluginServicesPath() const
{
- return ( _pimpl->cfg_local_services_path.empty()
- ? ("/space/tmp/services") : _pimpl->cfg_local_services_path );
+ return ( _pimpl->cfg_plugin_services_path.empty()
+ ? ("/space/tmp/services") : _pimpl->cfg_plugin_services_path );
}
Pathname ZConfig::vendorPath() const
Pathname knownServicesPath() const;
/**
- * Path where local services are installed
- * local services are scripts returning a repository
+ * Path where plugin services are installed
+ * plugin services are scripts returning a repository
* list
* \ingroup g_ZC_CONFIGFILES
*/
- Pathname localServicesPath() const;
+ Pathname pluginServicesPath() const;
/**
* Whether repository urls should be probed.
#include "zypp/base/InputStream.h"
#include "zypp/base/UserRequestException.h"
-#include "zypp/repo/LocalServices.h"
+#include "zypp/repo/PluginServices.h"
#include "zypp/ServiceInfo.h"
#include "zypp/RepoInfo.h"
#include "zypp/PathInfo.h"
namespace repo
{ /////////////////////////////////////////////////////////////////
- class LocalServices::Impl
+ class PluginServices::Impl
{
public:
static void loadServices( const Pathname &path,
- const LocalServices::ProcessService &callback );
+ const PluginServices::ProcessService &callback );
};
- void LocalServices::Impl::loadServices( const Pathname &path,
- const LocalServices::ProcessService & callback/*,
+ void PluginServices::Impl::loadServices( const Pathname &path,
+ const PluginServices::ProcessService & callback/*,
const ProgressData::ReceiverFnc &progress*/ )
{
std::list<Pathname> entries;
url.setPathName((*it).asString());
url.setScheme("file");
service_info.setUrl(url);
- service_info.setType(ServiceType::LOCAL);
+ service_info.setType(ServiceType::PLUGIN);
callback(service_info);
}
}
}
- LocalServices::LocalServices( const Pathname &path,
+ PluginServices::PluginServices( const Pathname &path,
const ProcessService & callback/*,
const ProgressData::ReceiverFnc &progress */)
{
Impl::loadServices(path, callback/*, progress*/);
}
- LocalServices::~LocalServices()
+ PluginServices::~PluginServices()
{}
- std::ostream & operator<<( std::ostream & str, const LocalServices & obj )
+ std::ostream & operator<<( std::ostream & str, const PluginServices & obj )
{
return str;
}
| |
\---------------------------------------------------------------------*/
-#ifndef ZYPP_REPO_LOCALSERVICES_H
-#define ZYPP_REPO_LOCALSERVICES_H
+#ifndef ZYPP_REPO_PLUGINSERVICES_H
+#define ZYPP_REPO_PLUGINSERVICES_H
#include <iosfwd>
namespace repo
{ /////////////////////////////////////////////////////////////////
- class LocalServices
+ class PluginServices
{
- friend std::ostream & operator<<( std::ostream & str, const LocalServices& obj );
+ friend std::ostream & operator<<( std::ostream & str, const PluginServices& obj );
public:
/**
class Impl;
public:
- LocalServices(const Pathname &path,
+ PluginServices(const Pathname &path,
const ProcessService & callback);
/**
* Dtor
*/
- ~LocalServices();
+ ~PluginServices();
};
///////////////////////////////////////////////////////////////////
/** \relates ServiceFileReader Stream output */
- std::ostream & operator<<( std::ostream & str, const LocalServices & obj );
+ std::ostream & operator<<( std::ostream & str, const PluginServices & obj );
/////////////////////////////////////////////////////////////////
} // namespace repo
}
};
-class LocalServiceRepos : public ServiceRepos::Impl
+class PluginServiceRepos : public ServiceRepos::Impl
{
public:
ServiceRepos::ProcessRepo _callback;
- LocalServiceRepos(const ServiceInfo &service,
+ PluginServiceRepos(const ServiceInfo &service,
const ServiceRepos::ProcessRepo & callback,
const ProgressData::ReceiverFnc &progress = ProgressData::ReceiverFnc() )
: _callback(callback)
parser::RepoFileReader parser(buffer, _callback);
}
- ~LocalServiceRepos()
+ ~PluginServiceRepos()
{
}
ServiceRepos::ServiceRepos(const ServiceInfo &service,
const ServiceRepos::ProcessRepo & callback,
const ProgressData::ReceiverFnc &progress)
- : _impl( (service.type() == ServiceType::LOCAL) ? (ServiceRepos::Impl *)(new LocalServiceRepos(service, callback, progress)) : (ServiceRepos::Impl *)(new RIMServiceRepos(service, callback, progress)))
+ : _impl( (service.type() == ServiceType::PLUGIN) ? (ServiceRepos::Impl *)(new PluginServiceRepos(service, callback, progress)) : (ServiceRepos::Impl *)(new RIMServiceRepos(service, callback, progress)))
{
}
const ServiceType ServiceType::RIS(ServiceType::RIS_e);
const ServiceType ServiceType::NONE(ServiceType::NONE_e);
- const ServiceType ServiceType::LOCAL(ServiceType::LOCAL_e);
+ const ServiceType ServiceType::PLUGIN(ServiceType::PLUGIN_e);
ServiceType::ServiceType(const std::string & strval_r)
: _type(parse(strval_r))
_table["RIS"] = ServiceType::RIS_e;
_table["nu"] = ServiceType::RIS_e;
_table["NU"] = ServiceType::RIS_e;
- _table["local"] = ServiceType::LOCAL_e;
- _table["LOCAL"] = ServiceType::LOCAL_e;
+ _table["plugin"] = ServiceType::PLUGIN_e;
+ _table["PLUGIN"] = ServiceType::PLUGIN_e;
_table["NONE"] = _table["none"] = ServiceType::NONE_e;
}
{
// initialize it
_table[RIS_e] = "ris";
- _table[LOCAL_e] = "local";
+ _table[PLUGIN_e] = "plugin";
_table[NONE_e] = "NONE";
}
return _table[_type];
static const ServiceType RIS;
/** No service set. */
static const ServiceType NONE;
- static const ServiceType LOCAL;
+ /**
+ * Plugin services are scripts installed on
+ * your system that provide the package manager with
+ * repositories.
+ *
+ * The mechanism used to create this repository list
+ * is completely up to the script
+ */
+ static const ServiceType PLUGIN;
enum Type
{
NONE_e,
RIS_e,
- LOCAL_e,
+ PLUGIN_e,
};
ServiceType() : _type(NONE_e) {}