remove some interfaces, cleanup
authorDuncan Mac-Vicar P <dmacvicar@suse.de>
Sat, 2 Feb 2008 03:32:33 +0000 (03:32 +0000)
committerDuncan Mac-Vicar P <dmacvicar@suse.de>
Sat, 2 Feb 2008 03:32:33 +0000 (03:32 +0000)
tests/zypp/RepoStatus_test.cc
zypp/RepoManager.cc
zypp/Target.cc
zypp/Target.h
zypp/target/TargetImpl.cc
zypp/target/TargetImpl.h
zypp/zypp_detail/ZYppImpl.cc

index c9883d0..e7138a7 100644 (file)
@@ -16,7 +16,6 @@ using namespace boost::unit_test::log;
 using namespace std;
 using namespace zypp;
 using namespace zypp::filesystem;
-using namespace zypp::repo;
 
 void repostatus_test()
 {
index 32bb1d1..a4ad715 100644 (file)
@@ -740,11 +740,6 @@ namespace zypp
       case RepoType::RPMMD_e :
       case RepoType::YAST2_e :
       {
-//         string cmd = "repo2solv.sh \"";
-//     cmd += rawpath.asString() + "\" > " + solvfile.asString();
-//     int ret = system (cmd.c_str());
-//         if (WIFEXITED (ret) && WEXITSTATUS (ret) != 0)
-//       ZYPP_THROW(RepoUnknownTypeException());
         MIL << "Executing solv converter" << endl;
         string cmd( str::form( "/usr/bin/repo2solv.sh \"%s\" > %s", rawpath.asString().c_str(), solvfile.asString().c_str() ) );
         ExternalProgram prog( cmd, ExternalProgram::Stderr_To_Stdout );
@@ -752,6 +747,8 @@ namespace zypp
           MIL << "  " << output;
         }
         int ret = prog.close();
+        if ( ret != 0 )
+          ZYPP_THROW(RepoUnknownTypeException());
       }
       break;
       default:
index 12d8057..3d61bec 100644 (file)
@@ -67,9 +67,6 @@ namespace zypp
   void Target::load()
   { _pimpl->load(); }
 
-  const ResStore & Target::resolvables()
-  { return _pimpl->resolvables(); }
-
   ResStore::resfilter_const_iterator Target::byKindBegin( const ResObject::Kind & kind_r  ) const
   { return _pimpl->byKindBegin( kind_r ); }
   
@@ -79,15 +76,6 @@ namespace zypp
   target::rpm::RpmDb & Target::rpmDb()
   { return _pimpl->rpm(); }
 
-#ifndef STORAGE_DISABLED
-      /** enables the storage target */
-  bool Target::isStorageEnabled() const
-  { return _pimpl->isStorageEnabled(); }
-
-  void Target::enableStorage(const Pathname &root_r)
-  { _pimpl->enableStorage(root_r); }
-#endif
-
   Pathname Target::root() const
   { return _pimpl->root(); }
 
index 15acdef..baa23e8 100644 (file)
@@ -55,9 +55,6 @@ namespace zypp
 
   public:
 
-    /** All resolvables provided by the target. */
-    const ResStore & resolvables();
-    
     /**
      * load resolvables into the pool
      */
@@ -92,12 +89,6 @@ namespace zypp
 
     ResObject::constPtr whoOwnsFile (const std::string & path_str) const;
 
-#ifndef STORAGE_DISABLED
-    /** enables the storage target */
-    bool isStorageEnabled() const;
-    void enableStorage(const Pathname &root_r);
-#endif
-
     /** Set the log file for target */
     bool setInstallationLogfile(const Pathname & path_r);
 
index 51f0c8b..5e062df 100644 (file)
@@ -281,7 +281,7 @@ namespace zypp
     // METHOD TYPE : Ctor
     //
     TargetImpl::TargetImpl(const Pathname & root_r)
-    : _root(root_r), _storage_enabled(false)
+    : _root(root_r)
     {
       _rpm.initDatabase(root_r);
       MIL << "Initialized target on " << _root << endl;
@@ -298,11 +298,6 @@ namespace zypp
       MIL << "Targets closed" << endl;
     }
 
-    bool TargetImpl::isStorageEnabled() const
-    {
-      return _storage_enabled;
-    }
-
     void TargetImpl::load()
     {
       Pathname rpmsolv = _root + ZConfig::instance().repoCachePath() + "_rpm.solv";
@@ -344,24 +339,14 @@ namespace zypp
       MIL << "Target loaded: " << system.solvablesSize() << " resolvables" << endl;
     }
 
-    void TargetImpl::enableStorage(const Pathname &root_r)
-    {
-    }
-
     Pathname TargetImpl::root() const
     {
       return _root;
     }
 
-    void TargetImpl::loadKindResolvables( const Resolvable::Kind kind )
-    {
-      // FIXME remove this
-    }
-
     ResStore::resfilter_const_iterator TargetImpl::byKindBegin( const ResObject::Kind & kind_r ) const
     {
       TargetImpl *ptr = const_cast<TargetImpl *>(this);
-      ptr->loadKindResolvables(kind_r);
       resfilter::ResFilter filter = ByKind(kind_r);
       return make_filter_iterator( filter, _store.begin(), _store.end() );
     }
@@ -369,16 +354,10 @@ namespace zypp
     ResStore::resfilter_const_iterator TargetImpl::byKindEnd( const ResObject::Kind & kind_r  ) const
     {
       TargetImpl *ptr = const_cast<TargetImpl *>(this);
-      ptr->loadKindResolvables(kind_r);
       resfilter::ResFilter filter = ByKind(kind_r);
       return make_filter_iterator( filter, _store.end(), _store.end() );
     }
 
-    const ResStore & TargetImpl::resolvables()
-    {
-      return _store;
-    }
-
     void TargetImpl::reset()
     {
       // FIXME remove
index e504e3d..e0cae34 100644 (file)
@@ -73,9 +73,6 @@ namespace zypp
 
     public:
 
-      /** All resolvables in the target. */
-      const ResStore & resolvables();
-
       /**
        * load resolvables of certain kind in the internal store
        * and return a iterator
@@ -105,10 +102,6 @@ namespace zypp
         return res._result;
       }
 
-      /** enables the storage target */
-      bool isStorageEnabled() const;
-      void enableStorage(const Pathname &root_r);
-
       /** Commit ordered changes
        *  @param pool_r only needed for #160792
        *  @return uncommitted ones (due to error)
@@ -151,18 +144,12 @@ namespace zypp
      void reset();
 
     protected:
-      void loadKindResolvables( const Resolvable::Kind kind );
       /** All resolvables provided by the target. */
       ResStore _store;
       /** Path to the target */
       Pathname _root;
       /** RPM database */
       rpm::RpmDb _rpm;
-#ifndef STORAGE_DISABLED
-      zypp::storage::PersistentStorage _storage;
-      bool _storage_enabled;
-      std::map< const Resolvable::Kind, DefaultFalseBool> _resstore_loaded;
-#endif
     private:
       /** Null implementation */
       static TargetImpl_Ptr _nullimpl;
index 89f5a58..ac113ae 100644 (file)
@@ -216,7 +216,6 @@ namespace zypp
 #endif
       }
       _target = new Target( root );
-      _target->enableStorage( root );
     }
 
     void ZYppImpl::finishTarget()