- Source::provideResolvables not implemented in yum source type.
authorDuncan Mac-Vicar P <dmacvicar@suse.de>
Wed, 21 Jun 2006 14:11:10 +0000 (14:11 +0000)
committerDuncan Mac-Vicar P <dmacvicar@suse.de>
Wed, 21 Jun 2006 14:11:10 +0000 (14:11 +0000)
  Product not set for packages that are available from update source
  (#186920)
- Strip self provides without edition in Resolvable ctor.
  (#186079)

zypp/PublicKey.cc
zypp/PublicKey.h
zypp/detail/ResolvableImpl.cc
zypp/source/SourceImpl.cc
zypp/source/SourceImpl.h
zypp/source/susetags/SuseTagsImpl.cc
zypp/source/susetags/SuseTagsImpl.h
zypp/source/yum/YUMSourceImpl.cc
zypp/source/yum/YUMSourceImpl.h

index 8a6550b..9e53f18 100644 (file)
 #include "zypp/PublicKey.h"
 #include "zypp/ExternalProgram.h"
 #include "zypp/TmpPath.h"
+#include "zypp/PathInfo.h"
 #include "zypp/base/Exception.h"
+#include "zypp/base/Logger.h"
 
 using std::endl;
 
 ///////////////////////////////////////////////////////////////////
 namespace zypp
 { /////////////////////////////////////////////////////////////////
-
+namespace devel
+{      
   ///////////////////////////////////////////////////////////////////
   //
   //   CLASS NAME : PublicKey::Impl
@@ -36,7 +39,8 @@ namespace zypp
 
     Impl(const Pathname &file)
     {
-    
+      readFromFile(file);
+      MIL << "Done reading key" << std::endl;
     }
     
     Impl(const std::istream &data)
@@ -72,6 +76,9 @@ namespace zypp
       
      void readFromFile( const Pathname &keyfile)
      {
+       if ( !PathInfo(keyfile).isExist() )
+         ZYPP_THROW(Exception("Can't read public key from " + keyfile.asString() + ", file not found"));
+         
        filesystem::TmpDir dir;
   
         const char* argv[] =
@@ -197,3 +204,4 @@ namespace zypp
   /////////////////////////////////////////////////////////////////
 } // namespace zypp
 ///////////////////////////////////////////////////////////////////
+}
\ No newline at end of file
index c8514ea..e3fde7b 100644 (file)
@@ -24,7 +24,8 @@
 ///////////////////////////////////////////////////////////////////
 namespace zypp
 { /////////////////////////////////////////////////////////////////
-
+namespace devel
+{
   ///////////////////////////////////////////////////////////////////
   //
   //   CLASS NAME : PublicKey
@@ -66,5 +67,6 @@ namespace zypp
 
   /////////////////////////////////////////////////////////////////
 } // namespace zypp
+}
 ///////////////////////////////////////////////////////////////////
 #endif // ZYPP_PUBLICKEY_H
index 40957ba..c9a8e6b 100644 (file)
@@ -116,16 +116,21 @@ namespace zypp
     {
       CapSet supplements;
       to[Dep::SUPPLEMENTS].clear();
-      
+
       FilterExtraDependency flp( to );
 
       std::remove_copy_if( from[Dep::SUPPLEMENTS].begin(), from[Dep::SUPPLEMENTS].end(),
                            std::inserter( supplements, supplements.end() ),
                            flp );
       to[Dep::SUPPLEMENTS].insert(supplements.begin(), supplements.end());
-    }      
+    }
   }
 
+  ///////////////////////////////////////////////////////////////////
+  //
+  //   METHOD NAME : Resolvable::Impl::Impl
+  //   METHOD TYPE : Ctor
+  //
   Resolvable::Impl::Impl( const Kind & kind_r,
                           const NVRAD & nvrad_r )
   : _kind( kind_r )
@@ -136,11 +141,20 @@ namespace zypp
   {
     // check if we provide/supplements any extra ('locale(...)', 'modalias(...)', ...) tags
     // and split them up to freshens/supplements (except for SystemResObject)
-      if ( _kind != ResTraits<SystemResObject>::kind ) {
-         filterExtraSupplements( nvrad_r, _deps );
-         filterExtraProvides( nvrad_r, _deps );
+    if ( _kind != ResTraits<SystemResObject>::kind )
+      {
+        filterExtraSupplements( nvrad_r, _deps );
+        filterExtraProvides( nvrad_r, _deps );
       }
 
+    // remove malicious self provides
+    CapSet::iterator it = _deps[Dep::PROVIDES].find( CapFactory().parse( _kind, _name ) );
+      if ( it != _deps[Dep::PROVIDES].end() )
+        {
+          dumpOn( WAR << "Strip self provides without edition in " ) << endl;
+          _deps[Dep::PROVIDES].erase( it );
+        }
+
     // assert self provides
     _deps[Dep::PROVIDES].insert( CapFactory()
                                  .parse( _kind, _name, Rel::EQ, _edition ) );
index abcdfc8..3998beb 100644 (file)
@@ -190,7 +190,7 @@ namespace zypp
     const ResStore SourceImpl::resolvables(zypp::Resolvable::Kind kind) const
     {
       Source_Ref self( const_cast<SourceImpl*>(this)->selfSourceRef() );
-      return const_cast<SourceImpl*>(this)->provideResolvables(self, kind);
+      return const_cast<SourceImpl*>(this)->provideResolvablesByKind(self, kind);
     }
 
     Pathname SourceImpl::tmpMetadataDir() const
@@ -678,11 +678,13 @@ namespace zypp
     }
 
     void SourceImpl::createResolvables(Source_Ref source_r)
-    {}
+    {
+      WAR << "createResolvables not implemented by the source" << endl;
+    }
 
-    ResStore SourceImpl::provideResolvables(Source_Ref source_r, zypp::Resolvable::Kind kind)
+    ResStore SourceImpl::provideResolvablesByKind(Source_Ref source_r, zypp::Resolvable::Kind kind)
     {
-       WAR << "provideResolvables not implemented by the source" << endl;
+      WAR << "provideResolvablesByKind not implemented by the source" << endl;
        return ResStore();
     }
 
index 2408dbe..5e8a742 100644 (file)
@@ -42,7 +42,7 @@ namespace zypp
     //
     /** Base class for concrete Source implementations.
      *
-     * Public access via \ref Source interface.
+     * Public access via \ref Source_Ref interface.
      *
      * Constructed by \ref SourceFactory, via default ctor to
      * create the object, followed by a call to \ref factoryCtor.
@@ -353,7 +353,7 @@ namespace zypp
       virtual void createResolvables(Source_Ref source_r);
 
       /** Provide only resolvable of a certain kind. */
-      virtual ResStore provideResolvables(Source_Ref source_r, zypp::Resolvable::Kind kind);
+      virtual ResStore provideResolvablesByKind(Source_Ref source_r, zypp::Resolvable::Kind kind);
 
       /** Whether the ResStore is initialized. */
       bool _res_store_initialized;
index 22dc273..64645ff 100644 (file)
@@ -456,7 +456,7 @@ namespace zypp
         return paths;
       }
 
-      ResStore SuseTagsImpl::provideResolvables(Source_Ref source_r, Resolvable::Kind kind)
+      ResStore SuseTagsImpl::createResolvablesByKind(Source_Ref source_r, Resolvable::Kind kind)
       {
         callback::SendReport<CreateSourceReport> report;
         report->startData( url() );
index 6f840c5..d2b83e2 100644 (file)
@@ -73,7 +73,7 @@ namespace zypp
         virtual void createResolvables(Source_Ref source_r);
 
        /** Provide only resolvables of a certain kind. */
-        virtual ResStore provideResolvables(Source_Ref source_r, zypp::Resolvable::Kind kind);
+        virtual ResStore createResolvablesByKind(Source_Ref source_r, zypp::Resolvable::Kind kind);
 
         virtual std::string type(void) const
         { return typeString(); }
index e3f53e7..aa0037a 100644 (file)
@@ -345,142 +345,112 @@ namespace zypp
         // download_tmp_dir go out of scope now but it is ok as we already copied the content.
       }
 
-      void YUMSourceImpl::createResolvables(Source_Ref source_r)
+        
+      void YUMSourceImpl::readRepomd()
       {
-       std::list<YUMRepomdData_Ptr> repo_primary;
-       std::list<YUMRepomdData_Ptr> repo_files;
-       //std::list<YUMRepomdData_Ptr> repo_other;
-       std::list<YUMRepomdData_Ptr> repo_group;
-       std::list<YUMRepomdData_Ptr> repo_pattern;
-       std::list<YUMRepomdData_Ptr> repo_product;
-       std::list<YUMRepomdData_Ptr> repo_patches;
-
-       callback::SendReport<CreateSourceReport> report;
-
-       report->startData( url() );
-
-        //---------------------------------
-        // repomd
-
         try
         {
           DBG << "Reading ifgz file " << repomdFile() << endl;
           ifgzstream repo_st(repomdFile().asString().c_str());
-         YUMRepomdParser repomd(repo_st, "");
+          YUMRepomdParser repomd(repo_st, "");
           for(; ! repomd.atEnd(); ++repomd)
-         {
+          {
             // note that we skip adding other.xml to the list of files to provide
-           if ((*repomd)->type == "primary")
-             repo_primary.push_back(*repomd);
-           else if ((*repomd)->type == "filelists")
-             repo_files.push_back(*repomd);
-           else if ((*repomd)->type == "group")
-             repo_group.push_back(*repomd);
-           else if ((*repomd)->type == "pattern")
-             repo_pattern.push_back(*repomd);
-           else if ((*repomd)->type == "product")
-             repo_product.push_back(*repomd);
-           else if ((*repomd)->type == "patches")
-             repo_patches.push_back(*repomd);
-           else if ((*repomd)->type != "other")        // type "other" is ok, anything else not
-             ERR << "Unknown type of repo file: " << (*repomd)->type << endl;
-          }
+            if ((*repomd)->type == "primary")
+              _repo_primary.push_back(*repomd);
+            else if ((*repomd)->type == "filelists")
+              _repo_files.push_back(*repomd);
+            else if ((*repomd)->type == "group")
+              _repo_group.push_back(*repomd);
+            else if ((*repomd)->type == "pattern")
+              _repo_pattern.push_back(*repomd);
+            else if ((*repomd)->type == "product")
+              _repo_product.push_back(*repomd);
+            else if ((*repomd)->type == "patches")
+              _repo_patches.push_back(*repomd);
+            else if ((*repomd)->type != "other")        // type "other" is ok, anything else not
+              ERR << "Unknown type of repo file: " << (*repomd)->type << endl;
+          }
         }
         catch( const Exception &  excpt_r )
         {
-         ZYPP_CAUGHT( excpt_r );       // log the caught exception
-         ZYPP_THROW( Exception("Cannot read repomd file, cannot initialize source") );
+          ZYPP_CAUGHT( excpt_r );       // log the caught exception
+          ZYPP_THROW( Exception("Cannot read repomd file, cannot initialize source") );
         }
-
-        //---------------------------------
-        // files mentioned within repomd
-
+      }
+      
+      void YUMSourceImpl::provideProducts(Source_Ref source_r, ResStore& store)
+      {
         try
         {
-         // now put other and filelist data to structures for easier find
-         map<NVRA, YUMFileListData_Ptr> files_data;
-         map<NVRA, YUMOtherData_Ptr> other_data;
-         for (std::list<YUMRepomdData_Ptr>::const_iterator it
-                 = repo_files.begin();
-             it != repo_files.end();
-             it++)
-         {
+          for (std::list<YUMRepomdData_Ptr>::const_iterator it = _repo_product.begin();
+               it != _repo_product.end();
+               it++)
+          {
             Pathname filename = metadataRoot() + (*it)->location;
-           DBG << "Reading ifgz file " << filename << endl;
-           ifgzstream st( filename.asString().c_str() );
+            ifgzstream st ( filename.asString().c_str() );
+            YUMProductParser product(st, "");
+            for (; !product.atEnd(); ++product)
+            {
+              Product::Ptr p = createProduct( source_r, **product );
+              store.insert (p);
+            }
+            if (product.errorStatus())
+              ZYPP_THROW(Exception(product.errorStatus()->msg()));
+          }
+        }
+        catch (...) {
+          ERR << "Cannot read products information" << endl;
+        }
+      }
+      
+      void YUMSourceImpl::providePackages(Source_Ref source_r, ResStore& store)
+      {
+        try
+        {
+          // now put other and filelist data to structures for easier find
+          map<NVRA, YUMFileListData_Ptr> files_data;
+          map<NVRA, YUMOtherData_Ptr> other_data;
+          for (std::list<YUMRepomdData_Ptr>::const_iterator it
+               = _repo_files.begin();
+               it != _repo_files.end();
+               it++)
+          {
+            Pathname filename = metadataRoot() + (*it)->location;
+            DBG << "Reading ifgz file " << filename << endl;
+            ifgzstream st( filename.asString().c_str() );
 
-           YUMFileListParser filelist ( st, "" );
-           for (; ! filelist.atEnd(); ++filelist)
-           {
-              if (*filelist == NULL) continue; // skip incompatible archs
-               NVRA nvra( (*filelist)->name,
-                          Edition( (*filelist)->ver, (*filelist)->rel, str::strtonum<int>( (*filelist)->epoch ) ),
-                          Arch ( (*filelist)->arch ) );
-               files_data[nvra] = *filelist;
-           }
-           if (filelist.errorStatus())
+            YUMFileListParser filelist ( st, "" );
+            for (; ! filelist.atEnd(); ++filelist)
+            {
+              if (*filelist == NULL) continue;  // skip incompatible archs
+              NVRA nvra( (*filelist)->name,
+                           Edition( (*filelist)->ver, (*filelist)->rel, str::strtonum<int>( (*filelist)->epoch ) ),
+                           Arch ( (*filelist)->arch ) );
+              files_data[nvra] = *filelist;
+            }
+            if (filelist.errorStatus())
               ZYPP_THROW(Exception(filelist.errorStatus()->msg()));
-         }
-
-#if 0  // don't parse 'other.xml' (#159316)
-
-         for (std::list<YUMRepomdData_Ptr>::const_iterator it
-                 = repo_other.begin();
-             it != repo_other.end();
-             it++)
-         {
-            Pathname filename = cacheExists()
-              ? _cache_dir + (*it)->location
-              : provideFile(_path + (*it)->location);
-            if (!cacheExists())
-           {
-             if (! checkCheckSum(filename, (*it)->checksumType, (*it)->checksum))
-             {
-               ZYPP_THROW(Exception(N_("Failed check for the metadata file check sum")));
-             }
-           }
-           _metadata_files.push_back((*it)->location);
-           DBG << "Reading file " << filename << endl;
-
-           ifgzstream st ( filename.asString().c_str() );
-           YUMOtherParser other(st, "");
-           for (;
-                 ! other.atEnd();
-                 ++other)
-           {
-               if (*other == NULL) continue;   // skip incompatible archs
-                Arch arch;
-                if (!(*other)->arch.empty())
-                  arch = Arch((*other)->arch);
-
-               NVRA nvra( (*other)->name,
-                          Edition( (*other)->ver, (*other)->rel, str::strtonum<int>( (*other)->epoch ) ),
-                          arch );
-               other_data[nvra] = *other;
-           }
-           if (other.errorStatus())
-             throw *other.errorStatus();
-       }
-#endif
-
-       // now read primary data, merge them with filelist and changelog
-         for (std::list<YUMRepomdData_Ptr>::const_iterator it = repo_primary.begin(); it != repo_primary.end(); it++)
+          }
+          
+        // now read primary data, merge them with filelist and changelog
+          for (std::list<YUMRepomdData_Ptr>::const_iterator it = _repo_primary.begin(); it != _repo_primary.end(); it++)
           {
             Pathname filename = metadataRoot() + (*it)->location;
             DBG << "Reading file " << filename << endl;
-           ifgzstream st ( filename.asString().c_str() );
-           YUMPrimaryParser prim(st, "");
-           for (; !prim.atEnd(); ++prim)
-           {
-             if (*prim == NULL) continue;      // incompatible arch detected during parsing
+            ifgzstream st ( filename.asString().c_str() );
+            YUMPrimaryParser prim(st, "");
+            for (; !prim.atEnd(); ++prim)
+            {
+              if (*prim == NULL) continue;      // incompatible arch detected during parsing
 
               Arch arch;
               if (!(*prim)->arch.empty())
                 arch = Arch((*prim)->arch);
 
               NVRA nvra( (*prim)->name,
-                          Edition( (*prim)->ver, (*prim)->rel, str::strtonum<int>( (*prim)->epoch ) ),
-                          arch );
+                           Edition( (*prim)->ver, (*prim)->rel, str::strtonum<int>( (*prim)->epoch ) ),
+                           arch );
               map<NVRA, YUMOtherData_Ptr>::iterator found_other = other_data.find( nvra );
               map<NVRA, YUMFileListData_Ptr>::iterator found_files = files_data.find( nvra );
 
@@ -488,45 +458,46 @@ namespace zypp
               YUMOtherData other_empty;
               ResImplTraits<YUMPackageImpl>::Ptr impl;
               Package::Ptr p = createPackage( source_r, **prim, found_files != files_data.end()
-                   ? *(found_files->second)
-                   : filelist_empty,
-                 found_other != other_data.end()
-                   ? *(found_other->second)
-                    : other_empty,
-                 impl
-               );
-               ImplAndPackage iap = { impl, p };
-               _package_impl[nvra] = iap;
+                  ? *(found_files->second)
+                : filelist_empty,
+                  found_other != other_data.end()
+                      ? *(found_other->second)
+                : other_empty,
+                  impl
+                                            );
+              ImplAndPackage iap = { impl, p };
+              _package_impl[nvra] = iap;
 //                MIL << "inserting package "<< p->name() << std::endl;
-               _store.insert (p);
-            }
-            if (prim.errorStatus())
+              store.insert (p);
+            }
+            if (prim.errorStatus())
               ZYPP_THROW(Exception(prim.errorStatus()->msg()));
-          }
+          }
         }
         catch (...)
         {
-        ERR << "Cannot read package information" << endl;
+          ERR << "Cannot read package information" << endl;
         }
-
-        //---------------------------------
-        // groups
+      }
+      
+      void YUMSourceImpl::provideSelections(Source_Ref source_r, ResStore& store)
+      {
         try
         {
-          for (std::list<YUMRepomdData_Ptr>::const_iterator it = repo_group.begin();
-               it != repo_group.end();
-               it++)
+          for (std::list<YUMRepomdData_Ptr>::const_iterator it = _repo_group.begin();
+               it != _repo_group.end();
+               it++)
           {
             Pathname filename = metadataRoot() + (*it)->location;
             DBG << "Reading file " << filename << endl;
-           ifgzstream st ( filename.asString().c_str() );
-           YUMGroupParser group(st, "");
-           for (; !group.atEnd(); ++group)
-           {
+            ifgzstream st ( filename.asString().c_str() );
+            YUMGroupParser group(st, "");
+            for (; !group.atEnd(); ++group)
+            {
               Selection::Ptr p = createGroup( source_r, **group );
-              _store.insert (p);
-           }
-           if (group.errorStatus())
+              store.insert (p);
+            }
+            if (group.errorStatus())
               ZYPP_THROW(Exception(group.errorStatus()->msg()));
           }
         }
@@ -535,64 +506,43 @@ namespace zypp
           ERR << "Cannot read package groups information" << endl;
         }
 
-        //---------------------------------
-        // patterns
-
+      }
+      
+      void YUMSourceImpl::providePatterns(Source_Ref source_r, ResStore& store)
+      {
         try
         {
-          for (std::list<YUMRepomdData_Ptr>::const_iterator it = repo_pattern.begin();
-               it != repo_pattern.end(); it++)
+          for (std::list<YUMRepomdData_Ptr>::const_iterator it = _repo_pattern.begin();
+               it != _repo_pattern.end(); it++)
           {
             Pathname filename = metadataRoot() + (*it)->location;
 
-           DBG << "Reading file " << filename << endl;
-           ifgzstream st ( filename.asString().c_str() );
-           YUMPatternParser pattern(st, "");
-           for (; !pattern.atEnd(); ++pattern)
-           {
-              Pattern::Ptr p = createPattern( source_r, **pattern );
-              _store.insert (p);
-           }
-           if (pattern.errorStatus())
-              ZYPP_THROW(Exception(pattern.errorStatus()->msg()));
-          }
-        }
-        catch (...) {
-         ERR << "Cannot read installation patterns information" << endl;
-        }
-
-        //---------------------------------
-        // products
-        try
-        {
-          for (std::list<YUMRepomdData_Ptr>::const_iterator it = repo_product.begin();
-            it != repo_product.end();
-            it++)
-          {
-            Pathname filename = metadataRoot() + (*it)->location;
+            DBG << "Reading file " << filename << endl;
             ifgzstream st ( filename.asString().c_str() );
-            YUMProductParser product(st, "");
-            for (; !product.atEnd(); ++product)
+            YUMPatternParser pattern(st, "");
+            for (; !pattern.atEnd(); ++pattern)
             {
-              Product::Ptr p = createProduct( source_r, **product );
-              _store.insert (p);
+              Pattern::Ptr p = createPattern( source_r, **pattern );
+              store.insert (p);
             }
-            if (product.errorStatus())
-              ZYPP_THROW(Exception(product.errorStatus()->msg()));
+            if (pattern.errorStatus())
+              ZYPP_THROW(Exception(pattern.errorStatus()->msg()));
           }
         }
         catch (...) {
-        ERR << "Cannot read products information" << endl;
+          ERR << "Cannot read installation patterns information" << endl;
         }
 
-        //---------------------------------
-        // patches, first the patches.xml index
+      }
+      
+      void YUMSourceImpl::providePatches(Source_Ref source_r, ResStore& store)
+      {
         try
         {
           std::list<std::string> patch_files;
-          for (std::list<YUMRepomdData_Ptr>::const_iterator it = repo_patches.begin();
-              it != repo_patches.end();
-              it++)
+          for (std::list<YUMRepomdData_Ptr>::const_iterator it = _repo_patches.begin();
+               it != _repo_patches.end();
+               it++)
           {
             Pathname filename = metadataRoot() + (*it)->location;
 
@@ -608,45 +558,84 @@ namespace zypp
 
             if (patch.errorStatus())
               ZYPP_THROW(Exception(patch.errorStatus()->msg()));
-           }
+          }
 
             //---------------------------------
             // now the individual patch files
 
-           for (std::list<std::string>::const_iterator it = patch_files.begin();
-              it != patch_files.end();
-              it++)
-           {
-             Pathname filename = metadataRoot() + *it;
-                DBG << "Reading file " << filename << endl;
-                ifgzstream st ( filename.asString().c_str() );
-                YUMPatchParser ptch(st, "");
-                for(;
-                        !ptch.atEnd();
-                        ++ptch)
-                {
-                      Patch::Ptr p = createPatch(
-                        source_r,
-                        **ptch
-                      );
-                      _store.insert (p);
-                      Patch::AtomList atoms = p->atoms();
-                      for (Patch::AtomList::iterator at = atoms.begin();
-                          at != atoms.end();
-                          at++)
-                      {
-                        _store.insert (*at);
-                      }
-                }
-                if (ptch.errorStatus())
-                  ZYPP_THROW(Exception(ptch.errorStatus()->msg()));
-           }
-         }
+          for (std::list<std::string>::const_iterator it = patch_files.begin();
+               it != patch_files.end();
+               it++)
+          {
+            Pathname filename = metadataRoot() + *it;
+            DBG << "Reading file " << filename << endl;
+            ifgzstream st ( filename.asString().c_str() );
+            YUMPatchParser ptch(st, "");
+            for(;
+                 !ptch.atEnd();
+                 ++ptch)
+            {
+              Patch::Ptr p = createPatch(
+                  source_r,
+              **ptch
+                                        );
+              store.insert (p);
+              Patch::AtomList atoms = p->atoms();
+              for (Patch::AtomList::iterator at = atoms.begin();
+                   at != atoms.end();
+                   at++)
+              {
+                _store.insert (*at);
+              }
+            }
+            if (ptch.errorStatus())
+              ZYPP_THROW(Exception(ptch.errorStatus()->msg()));
+          }
+        }
         catch (...)
         {
-            ERR << "Cannot read patch metadata" << endl;
+          ERR << "Cannot read patch metadata" << endl;
         }
+      }
+      
+      ResStore YUMSourceImpl::provideResolvablesByKind(Source_Ref source_r, zypp::Resolvable::Kind kind)
+      {
+        ResStore store;
+        callback::SendReport<CreateSourceReport> report;
+
+        report->startData( url() );
+
+        readRepomd();
+        
+        if ( kind == ResTraits<Product>::kind )
+          provideProducts ( selfSourceRef(), store );
+        else if ( kind == ResTraits<Package>::kind )
+          providePackages (selfSourceRef(), store );
+        else if ( kind == ResTraits<Selection>::kind )
+          provideSelections ( selfSourceRef(), store );
+        else if ( kind == ResTraits<Pattern>::kind )
+          providePatterns ( selfSourceRef(), store );
+        else if ( kind == ResTraits<Pattern>::kind )
+          providePatches ( selfSourceRef(), store );
+        
+        report->finishData( url(), CreateSourceReport::NO_ERROR, "" );
+        
+        return store;
+      }  
+      
+      void YUMSourceImpl::createResolvables(Source_Ref source_r)
+      {
+        callback::SendReport<CreateSourceReport> report;
+
+        report->startData( url() );
 
+        readRepomd();
+        provideProducts(selfSourceRef(), _store);
+        providePackages(selfSourceRef(), _store);
+        provideSelections(selfSourceRef(), _store);
+        providePatterns(selfSourceRef(), _store);
+        providePatches(selfSourceRef(), _store);
+        
         report->finishData( url(), CreateSourceReport::NO_ERROR, "" );
       }
 
index 76dd556..f66b12f 100644 (file)
@@ -72,8 +72,6 @@ namespace zypp
        static std::string typeString(void)
        { return "YUM"; }
 
-       virtual void createResolvables(Source_Ref source_r);
-
         /**
          * is the download of metadata from the url needed
          * \param localdir
@@ -140,6 +138,26 @@ namespace zypp
          * \throw EXCEPTION on fail
          */
         void checkMetadataChecksums() const;
+        
+        void readRepomd();
+        
+        virtual void createResolvables(Source_Ref source_r);
+        virtual ResStore provideResolvablesByKind(Source_Ref source_r, zypp::Resolvable::Kind kind);
+        
+        void provideProducts(Source_Ref source_r, ResStore& store);
+        void providePackages(Source_Ref source_r, ResStore& store);
+        void provideSelections(Source_Ref source_r, ResStore& store);
+        void providePatterns(Source_Ref source_r, ResStore& store);
+        void providePatches(Source_Ref source_r, ResStore& store);
+        
+        std::list<YUMRepomdData_Ptr> _repo_primary;
+        std::list<YUMRepomdData_Ptr> _repo_files;
+        std::list<YUMRepomdData_Ptr> _repo_group;
+        std::list<YUMRepomdData_Ptr> _repo_pattern;
+        std::list<YUMRepomdData_Ptr> _repo_product;
+        std::list<YUMRepomdData_Ptr> _repo_patches;
+        
+        
       private:
         
         const Pathname metadataRoot() const;