rename Local Services to Plugin Services as discussed with Michael
authorDuncan Mac-Vicar P <dmacvicar@suse.de>
Fri, 24 Sep 2010 11:15:46 +0000 (13:15 +0200)
committerDuncan Mac-Vicar P <dmacvicar@suse.de>
Fri, 24 Sep 2010 11:15:46 +0000 (13:15 +0200)
Andres

15 files changed:
tests/repo/CMakeLists.txt
tests/repo/PluginServices_test.cc [moved from tests/repo/LocalServices_test.cc with 85% similarity]
tests/zypp/RepoManager_test.cc
tests/zypp/data/RepoManager/plugin-service-lib-1/service [moved from tests/zypp/data/RepoManager/local-service-lib-1/service with 100% similarity]
tests/zypp/data/RepoManager/plugin-service-lib-2/service [moved from tests/zypp/data/RepoManager/local-service-lib-2/service with 100% similarity]
zypp/CMakeLists.txt
zypp/RepoManager.cc
zypp/RepoManager.h
zypp/ZConfig.cc
zypp/ZConfig.h
zypp/repo/PluginServices.cc [moved from zypp/repo/LocalServices.cc with 84% similarity]
zypp/repo/PluginServices.h [moved from zypp/repo/LocalServices.h with 88% similarity]
zypp/repo/ServiceRepos.cc
zypp/repo/ServiceType.cc
zypp/repo/ServiceType.h

index 12ecf4d..55bb85e 100644 (file)
@@ -4,4 +4,4 @@ ADD_SUBDIRECTORY( susetags )
 # to find the KeyRingTest receiver
 INCLUDE_DIRECTORIES( ${LIBZYPP_SOURCE_DIR}/tests/zypp )
 
-ADD_TESTS(RepoVariables ExtendedMetadata LocalServices)
+ADD_TESTS(RepoVariables ExtendedMetadata PluginServices)
similarity index 85%
rename from tests/repo/LocalServices_test.cc
rename to tests/repo/PluginServices_test.cc
index 6c8c8d1..d999c7c 100644 (file)
@@ -10,7 +10,7 @@
 #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;
@@ -42,11 +42,11 @@ private:
 };
 
 
-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:
index 1e53336..14a17b9 100644 (file)
@@ -62,7 +62,7 @@ BOOST_AUTO_TEST_CASE(refresh_addon_in_subdir)
     BOOST_CHECK( r.info().hasLicense() );
 }
 
-BOOST_AUTO_TEST_CASE(localservices_test)
+BOOST_AUTO_TEST_CASE(pluginservices_test)
 {
   TmpDir tmpCachePath;
   RepoManagerOptions opts( RepoManagerOptions::makeTestSetup( tmpCachePath ) ) ;
@@ -70,22 +70,21 @@ BOOST_AUTO_TEST_CASE(localservices_test)
   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()));
@@ -93,14 +92,14 @@ BOOST_AUTO_TEST_CASE(localservices_test)
   }
   
   // 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());
index 488bc7c..b9d63f6 100644 (file)
@@ -701,7 +701,7 @@ SET( zypp_repo_SRCS
   repo/Downloader.cc
   repo/RepoVariables.cc
   repo/RepoInfoBase.cc
-  repo/LocalServices.cc
+  repo/PluginServices.cc
   repo/ServiceRepos.cc
 )
 
@@ -721,7 +721,7 @@ SET( zypp_repo_HEADERS
   repo/RepoVariables.h
   repo/RepoInfoBase.h
   repo/RepoInfoBaseImpl.h
-  repo/LocalServices.h
+  repo/PluginServices.h
   repo/ServiceRepos.h
 )
 
index d02a58e..589f52c 100644 (file)
@@ -42,7 +42,7 @@
 #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
@@ -145,7 +145,7 @@ namespace zypp
     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;
@@ -160,7 +160,7 @@ namespace zypp
     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;
   }
@@ -544,7 +544,7 @@ namespace zypp
       }
     }
 
-    repo::LocalServices(options.localServicesPath, ServiceCollector(services));    
+    repo::PluginServices(options.pluginServicesPath, ServiceCollector(services));    
   }
 
   void RepoManager::Impl::init_knownRepositories()
index f77c12a..8780669 100644 (file)
@@ -81,7 +81,7 @@ namespace zypp
     Pathname repoPackagesCachePath;
     Pathname knownReposPath;
     Pathname knownServicesPath;
-    Pathname localServicesPath;
+    Pathname pluginServicesPath;
     bool probe;
     /**
      * Target distro ID to be used when refreshing repo index services.
index 1ff2008..6457d0e 100644 (file)
@@ -339,9 +339,9 @@ namespace zypp
                 {
                   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" )
                 {
@@ -497,7 +497,7 @@ namespace zypp
     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;
@@ -682,10 +682,10 @@ namespace zypp
         ? (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
index 87ec47d..6b44a41 100644 (file)
@@ -151,12 +151,12 @@ namespace zypp
       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.
similarity index 84%
rename from zypp/repo/LocalServices.cc
rename to zypp/repo/PluginServices.cc
index 34e66cb..5abb303 100644 (file)
@@ -14,7 +14,7 @@
 #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"
@@ -29,15 +29,15 @@ namespace zypp
   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;
@@ -58,24 +58,24 @@ namespace zypp
           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;
     }
similarity index 88%
rename from zypp/repo/LocalServices.h
rename to zypp/repo/PluginServices.h
index d6c32d0..6c69c52 100644 (file)
@@ -7,8 +7,8 @@
 |                                                                      |
 \---------------------------------------------------------------------*/
 
-#ifndef ZYPP_REPO_LOCALSERVICES_H
-#define ZYPP_REPO_LOCALSERVICES_H
+#ifndef ZYPP_REPO_PLUGINSERVICES_H
+#define ZYPP_REPO_PLUGINSERVICES_H
 
 #include <iosfwd>
 
@@ -25,9 +25,9 @@ namespace zypp
   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:
       
      /**
@@ -43,18 +43,18 @@ namespace zypp
       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
index 59c846c..95069c0 100644 (file)
@@ -57,12 +57,12 @@ public:
     }
 };
 
-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)
@@ -78,7 +78,7 @@ public:
       parser::RepoFileReader parser(buffer, _callback);
     }
     
-    ~LocalServiceRepos()
+    ~PluginServiceRepos()
     {
 
     }
@@ -88,7 +88,7 @@ public:
 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)))
 {
 }
     
index 33077d5..d677936 100644 (file)
@@ -22,7 +22,7 @@ namespace zypp
 
   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))
@@ -37,8 +37,8 @@ namespace zypp
       _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;
     }
 
@@ -60,7 +60,7 @@ namespace zypp
     {
       // initialize it
       _table[RIS_e]  = "ris";
-      _table[LOCAL_e]  = "local";
+      _table[PLUGIN_e]  = "plugin";
       _table[NONE_e] = "NONE";
     }
     return _table[_type];
index 94fb404..51feb1f 100644 (file)
@@ -32,13 +32,21 @@ namespace zypp
     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) {}