From 46b38975882a20055c6a7fbcd2084c2fcd8f6230 Mon Sep 17 00:00:00 2001 From: Duncan Mac-Vicar P Date: Tue, 18 Apr 2006 14:24:10 +0000 Subject: [PATCH] read content file on construction, and make provideProduct only insert the already read product object into the store, this should fix https://bugzilla.novell.com/show_bug.cgi?id=165826 --- zypp/source/susetags/SuseTagsImpl.cc | 16 ++++++++++++---- zypp/source/susetags/SuseTagsImpl.h | 4 ++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/zypp/source/susetags/SuseTagsImpl.cc b/zypp/source/susetags/SuseTagsImpl.cc index e7c1815..7d7f2da 100644 --- a/zypp/source/susetags/SuseTagsImpl.cc +++ b/zypp/source/susetags/SuseTagsImpl.cc @@ -241,6 +241,8 @@ namespace zypp ZYPP_CAUGHT(excpt_r); WAR << "Verifier not found" << endl; } + + readContentFile(); } void SuseTagsImpl::createResolvables(Source_Ref source_r) @@ -339,7 +341,7 @@ namespace zypp std::string SuseTagsImpl::unique_id (void) const { return _media_id; } - void SuseTagsImpl::provideProducts(Source_Ref source_r, ResStore &store) + void SuseTagsImpl::readContentFile() { Pathname p; bool cache = cacheExists(); @@ -427,7 +429,7 @@ namespace zypp ProductMetadataParser p; p.parse( _content_file, factory.createFrom(this) ); - Product::Ptr product = p.result; + _product = p.result; // data dir is the same, it is determined by the content file _data_dir = _path + p.prodImpl->_data_dir; @@ -440,8 +442,8 @@ namespace zypp else _descr_dir = _orig_descr_dir; - MIL << "Product: " << product->summary() << endl; - store.insert( product ); + MIL << "Read product: " << _product->summary() << endl; + _prodImpl = p.prodImpl; _autorefresh = p.volatile_content && media::MediaAccess::canBeVolatile( _url ); } @@ -450,6 +452,12 @@ namespace zypp } } + void SuseTagsImpl::provideProducts(Source_Ref source_r, ResStore &store) + { + MIL << "Adding product: " << _product->summary() << " to the store" << endl; + store.insert( _product ); + } + void SuseTagsImpl::verifyFile( const Pathname &path, const std::string &key) { // for old products, we dont check anything. diff --git a/zypp/source/susetags/SuseTagsImpl.h b/zypp/source/susetags/SuseTagsImpl.h index e75ade7..5cde655 100644 --- a/zypp/source/susetags/SuseTagsImpl.h +++ b/zypp/source/susetags/SuseTagsImpl.h @@ -17,6 +17,7 @@ #include "zypp/Pathname.h" #include "zypp/source/SourceImpl.h" +#include "zypp/Product.h" #include "zypp/source/susetags/SuseTagsProductImpl.h" /////////////////////////////////////////////////////////////////// @@ -90,6 +91,8 @@ namespace zypp */ virtual void factoryInit(); + void readContentFile(); + void provideProducts(Source_Ref source_r, ResStore& store); void providePackages(Source_Ref source_r, ResStore& store); void provideSelections(Source_Ref source_r, ResStore& store); @@ -131,6 +134,7 @@ namespace zypp * we need it to access the checksums if we are in verify mode */ detail::ResImplTraits::Ptr _prodImpl; + Product::Ptr _product; }; /////////////////////////////////////////////////////////////////// -- 2.7.4