zypp::source::susetags::SuseTagsImpl Class Reference

#include <SuseTagsImpl.h>

Inheritance diagram for zypp::source::susetags::SuseTagsImpl:

zypp::source::SourceImpl zypp::base::ReferenceCounted zypp::base::ProvideNumericId< SourceImpl, Source_Ref::NumericId > NonCopyable List of all members.

Public Types

typedef intrusive_ptr< SuseTagsImplPtr
typedef intrusive_ptr< const
SuseTagsImpl
constPtr

Public Member Functions

 SuseTagsImpl ()
 Default Ctor.
 ~SuseTagsImpl ()
 Dtor.
virtual void createResolvables (Source_Ref source_r)
 Late initialize the ResStore.
virtual ResStore provideResolvables (Source_Ref source_r, zypp::Resolvable::Kind kind)
 Provide only resolvables of a certain kind.
virtual std::string type (void) const
virtual Date timestamp () const
 default implementation returns now() so the source is always reread when in doubt
virtual unsigned numberOfMedia (void) const
virtual std::string vendor (void) const
virtual const std::list< PathnamepublicKeys ()
virtual std::string unique_id (void) const
Pathname sourceDir (const std::string &dir)
virtual void storeMetadata (const Pathname &cache_dir_r)
virtual media::MediaVerifierRef verifier (media::MediaNr media_nr)
 Get media verifier for the specified media.

Static Public Member Functions

static std::string typeString (void)
 Text used for identifying the type of the source.

Public Attributes

std::map< NVRA, SuseTagsPackageImplData_package_data
std::map< NVRA, DefaultFalseBool_is_shared
std::map< NVRA, DefaultFalseBool_provides_shared_data
std::list< std::string > _pkg_translations

Protected Member Functions

virtual std::ostream & dumpOn (std::ostream &str) const
 Stream output.
void initCacheDir (const Pathname &cache_dir_r)
bool cacheExists () const

Private Member Functions

virtual void factoryInit ()
 Ctor substitute.
const Pathname metadataRoot () const
const Pathname contentFile () const
const Pathname contentFileKey () const
const Pathname contentFileSignature () const
const Pathname descrDir () const
const Pathname mediaFile () const
void saveMetadataTo (const Pathname &dir_r)
const Pathname mediaDescrDir () const
 description dir in original media it is not always the same so it requires the content file to be parsed
const Pathname dataDir () const
 data dir in original media it is not always the same so it requires the content file to be parsed
void readContentFile (const Pathname &p)
 reads content file, initializes the data and media descr dir and saves the product object but it does not add it to the store yet
void checkMetadataChecksums (const Pathname &dir) const
 checks metadata against it checksums requires reading content file first
void readMediaFile (const Pathname &p)
 reads a media file and installs a media verifier if available
TmpDir downloadMetadata ()
bool downloadNeeded (const Pathname &localdir)
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 provideSelection (Source_Ref source_r, ResStore &store)
void providePatterns (Source_Ref source_r, ResStore &store)
bool verifyChecksumsMode () const
 verify media mode (use the new META tags)
void verifyFile (const Pathname &path, const std::string &key) const
 Verify file checksum.

Private Attributes

unsigned _media_count
Pathname _data_dir
Pathname _media_descr_dir
std::string _vendor
std::string _media_id
detail::ResImplTraits< SuseTagsProductImpl
>::Ptr 
_prodImpl
 pointer to the product implementation we need it to access the checksums if we are in verify mode
Product::Ptr _product

Detailed Description

Definition at line 57 of file SuseTagsImpl.h.


Member Typedef Documentation

typedef intrusive_ptr<SuseTagsImpl> zypp::source::susetags::SuseTagsImpl::Ptr
 

Definition at line 60 of file SuseTagsImpl.h.

typedef intrusive_ptr<const SuseTagsImpl> zypp::source::susetags::SuseTagsImpl::constPtr
 

Definition at line 61 of file SuseTagsImpl.h.


Constructor & Destructor Documentation

zypp::source::susetags::SuseTagsImpl::SuseTagsImpl  ) 
 

Default Ctor.

Just initilizes data members. Metadata retrieval is delayed untill factoryInit.

Definition at line 50 of file SuseTagsImpl.cc.

zypp::source::susetags::SuseTagsImpl::~SuseTagsImpl  ) 
 

Dtor.

Definition at line 463 of file SuseTagsImpl.cc.


Member Function Documentation

void zypp::source::susetags::SuseTagsImpl::createResolvables Source_Ref  source_r  )  [virtual]
 

Late initialize the ResStore.

Reimplemented from zypp::source::SourceImpl.

Definition at line 410 of file SuseTagsImpl.cc.

References zypp::source::SourceImpl::_store, zypp::source::CreateSourceReport::NO_ERROR, providePackages(), providePatterns(), provideProducts(), provideSelections(), report, and zypp::source::SourceImpl::url().

ResStore zypp::source::susetags::SuseTagsImpl::provideResolvables Source_Ref  source_r,
zypp::Resolvable::Kind  kind
[virtual]
 

Provide only resolvables of a certain kind.

Reimplemented from zypp::source::SourceImpl.

Definition at line 437 of file SuseTagsImpl.cc.

References zypp::source::CreateSourceReport::NO_ERROR, providePackages(), providePatterns(), provideProducts(), provideSelections(), report, and zypp::source::SourceImpl::url().

virtual std::string zypp::source::susetags::SuseTagsImpl::type void   )  const [inline, virtual]
 

Reimplemented from zypp::source::SourceImpl.

Definition at line 78 of file SuseTagsImpl.h.

References typeString().

static std::string zypp::source::susetags::SuseTagsImpl::typeString void   )  [inline, static]
 

Text used for identifying the type of the source.

Used by the SourceFactory when creating a source of a given type only.

Definition at line 85 of file SuseTagsImpl.h.

Referenced by type().

Date zypp::source::susetags::SuseTagsImpl::timestamp  )  const [virtual]
 

default implementation returns now() so the source is always reread when in doubt

Reimplemented from zypp::source::SourceImpl.

Definition at line 486 of file SuseTagsImpl.cc.

References contentFile().

unsigned zypp::source::susetags::SuseTagsImpl::numberOfMedia void   )  const [virtual]
 

Reimplemented from zypp::source::SourceImpl.

Definition at line 477 of file SuseTagsImpl.cc.

References _media_count.

std::string zypp::source::susetags::SuseTagsImpl::vendor void   )  const [virtual]
 

Reimplemented from zypp::source::SourceImpl.

Definition at line 480 of file SuseTagsImpl.cc.

References _vendor.

const std::list< Pathname > zypp::source::susetags::SuseTagsImpl::publicKeys  )  [virtual]
 

Reimplemented from zypp::source::SourceImpl.

Definition at line 423 of file SuseTagsImpl.cc.

References metadataRoot(), MIL, and zypp::filesystem::readdir().

std::string zypp::source::susetags::SuseTagsImpl::unique_id void   )  const [virtual]
 

Reimplemented from zypp::source::SourceImpl.

Definition at line 483 of file SuseTagsImpl.cc.

References _media_id.

Pathname zypp::source::susetags::SuseTagsImpl::sourceDir const std::string &  dir  ) 
 

Definition at line 466 of file SuseTagsImpl.cc.

References _data_dir.

void zypp::source::susetags::SuseTagsImpl::storeMetadata const Pathname cache_dir_r  )  [virtual]
 

Reimplemented from zypp::source::SourceImpl.

Definition at line 297 of file SuseTagsImpl.cc.

References zypp::source::SourceImpl::_cache_dir, zypp::filesystem::Pathname::empty(), and saveMetadataTo().

Referenced by factoryInit().

media::MediaVerifierRef zypp::source::susetags::SuseTagsImpl::verifier media::MediaNr  media_nr  )  [virtual]
 

Get media verifier for the specified media.

Definition at line 471 of file SuseTagsImpl.cc.

References _media_id, and _vendor.

std::ostream & zypp::source::susetags::SuseTagsImpl::dumpOn std::ostream &  str  )  const [protected, virtual]
 

Stream output.

Reimplemented from zypp::source::SourceImpl.

Definition at line 788 of file SuseTagsImpl.cc.

References zypp::source::SourceImpl::dumpOn().

void zypp::source::susetags::SuseTagsImpl::initCacheDir const Pathname cache_dir_r  )  [protected]
 

Definition at line 281 of file SuseTagsImpl.cc.

References zypp::filesystem::assert_dir(), zypp::filesystem::Pathname::asString(), zypp::filesystem::clean_dir(), zypp::filesystem::Pathname::dirname(), zypp::filesystem::mkdir(), and ZYPP_THROW.

bool zypp::source::susetags::SuseTagsImpl::cacheExists  )  const [protected]
 

Definition at line 347 of file SuseTagsImpl.cc.

References zypp::source::SourceImpl::_cache_dir, and MIL.

Referenced by downloadNeeded(), and factoryInit().

void zypp::source::susetags::SuseTagsImpl::factoryInit  )  [private, virtual]
 

Ctor substitute.

Actually get the metadata.

Exceptions:
EXCEPTION on fail

Reimplemented from zypp::source::SourceImpl.

Definition at line 373 of file SuseTagsImpl.cc.

References zypp::source::SourceImpl::_cache_dir, zypp::source::SourceImpl::autorefresh(), cacheExists(), contentFile(), zypp::filesystem::Pathname::empty(), mediaFile(), MIL, readContentFile(), readMediaFile(), saveMetadataTo(), storeMetadata(), and zypp::source::SourceImpl::tmpMetadataDir().

const Pathname zypp::source::susetags::SuseTagsImpl::metadataRoot  )  const [private]
 

Definition at line 53 of file SuseTagsImpl.cc.

References zypp::source::SourceImpl::_cache_dir, zypp::filesystem::Pathname::empty(), and zypp::source::SourceImpl::tmpMetadataDir().

Referenced by contentFile(), contentFileKey(), contentFileSignature(), descrDir(), mediaFile(), and publicKeys().

const Pathname zypp::source::susetags::SuseTagsImpl::contentFile  )  const [private]
 

Definition at line 58 of file SuseTagsImpl.cc.

References metadataRoot().

Referenced by factoryInit(), and timestamp().

const Pathname zypp::source::susetags::SuseTagsImpl::contentFileKey  )  const [private]
 

Definition at line 68 of file SuseTagsImpl.cc.

References metadataRoot().

const Pathname zypp::source::susetags::SuseTagsImpl::contentFileSignature  )  const [private]
 

Definition at line 63 of file SuseTagsImpl.cc.

References metadataRoot().

const Pathname zypp::source::susetags::SuseTagsImpl::descrDir  )  const [private]
 

Definition at line 78 of file SuseTagsImpl.cc.

References metadataRoot().

Referenced by providePackages(), providePatterns(), and provideSelections().

const Pathname zypp::source::susetags::SuseTagsImpl::mediaFile  )  const [private]
 

Definition at line 73 of file SuseTagsImpl.cc.

References metadataRoot().

Referenced by factoryInit().

void zypp::source::susetags::SuseTagsImpl::saveMetadataTo const Pathname dir_r  )  [private]
 

Definition at line 313 of file SuseTagsImpl.cc.

References zypp::source::SourceImpl::alias(), zypp::source::SourceImpl::copyLocalMetadata(), downloadMetadata(), downloadNeeded(), MIL, and ZYPP_THROW.

Referenced by factoryInit(), and storeMetadata().

const Pathname zypp::source::susetags::SuseTagsImpl::mediaDescrDir  )  const [private]
 

description dir in original media it is not always the same so it requires the content file to be parsed

Definition at line 88 of file SuseTagsImpl.cc.

References _media_descr_dir.

const Pathname zypp::source::susetags::SuseTagsImpl::dataDir  )  const [private]
 

data dir in original media it is not always the same so it requires the content file to be parsed

Definition at line 83 of file SuseTagsImpl.cc.

References _data_dir.

void zypp::source::susetags::SuseTagsImpl::readContentFile const Pathname p  )  [private]
 

reads content file, initializes the data and media descr dir and saves the product object but it does not add it to the store yet

Definition at line 491 of file SuseTagsImpl.cc.

References zypp::source::SourceImpl::_autorefresh, _data_dir, _media_descr_dir, zypp::source::SourceImpl::_path, _prodImpl, _product, zypp::source::SourceImpl::_url, zypp::media::MediaAccess::canBeVolatile(), zypp::SourceFactory::createFrom(), DBG, MIL, zypp::source::susetags::ProductMetadataParser::parse(), zypp::source::susetags::ProductMetadataParser::prodImpl, zypp::source::susetags::ProductMetadataParser::result, zypp::source::susetags::ProductMetadataParser::volatile_content, and ZYPP_THROW.

Referenced by factoryInit().

void zypp::source::susetags::SuseTagsImpl::checkMetadataChecksums const Pathname dir  )  const [private]
 

checks metadata against it checksums requires reading content file first

Parameters:
dir Download directory
Exceptions:
EXCEPTION on fail

Definition at line 522 of file SuseTagsImpl.cc.

References _prodImpl, and verifyFile().

void zypp::source::susetags::SuseTagsImpl::readMediaFile const Pathname p  )  [private]
 

reads a media file and installs a media verifier if available

Definition at line 113 of file SuseTagsImpl.cc.

References zypp::filesystem::Pathname::asString(), zypp::source::SourceImpl::media_mgr, and ZYPP_THROW.

Referenced by downloadMetadata(), and factoryInit().

TmpDir zypp::source::susetags::SuseTagsImpl::downloadMetadata  )  [private]
 

Definition at line 154 of file SuseTagsImpl.cc.

References zypp::source::SourceImpl::_path, zypp::filesystem::assert_dir(), zypp::bit::asString(), zypp::Url::asString(), zypp::filesystem::Pathname::asString(), zypp::filesystem::copy(), zypp::filesystem::copy_dir(), zypp::source::SourceImpl::dirInfo(), MIL, zypp::filesystem::TmpPath::path(), zypp::source::SourceImpl::provideDirTree(), zypp::source::SourceImpl::provideFile(), readMediaFile(), zypp::source::SourceImpl::resetMediaVerifier(), zypp::source::SourceImpl::url(), and ZYPP_THROW.

Referenced by saveMetadataTo().

bool zypp::source::susetags::SuseTagsImpl::downloadNeeded const Pathname localdir  )  [private]
 

Definition at line 93 of file SuseTagsImpl.cc.

References zypp::source::SourceImpl::alias(), cacheExists(), zypp::CheckSum::checksum(), zypp::CheckSum::empty(), MIL, zypp::source::SourceImpl::provideFile(), and zypp::filesystem::sha1sum().

Referenced by saveMetadataTo().

void zypp::source::susetags::SuseTagsImpl::provideProducts Source_Ref  source_r,
ResStore store
[private]
 

Definition at line 516 of file SuseTagsImpl.cc.

References _product, zypp::ResStore::insert(), and MIL.

Referenced by createResolvables(), and provideResolvables().

void zypp::source::susetags::SuseTagsImpl::providePackages Source_Ref  source_r,
ResStore store
[private]
 

Definition at line 575 of file SuseTagsImpl.cc.

References _pkg_translations, DBG, descrDir(), MIL, zypp::source::susetags::parsePackages(), and zypp::filesystem::readdir().

Referenced by createResolvables(), and provideResolvables().

void zypp::source::susetags::SuseTagsImpl::provideSelections Source_Ref  source_r,
ResStore store
[private]
 

Definition at line 687 of file SuseTagsImpl.cc.

References zypp::filesystem::Pathname::asString(), DBG, descrDir(), zypp::iostr::getline(), zypp::ResStore::insert(), MIL, and zypp::source::susetags::parseSelection().

Referenced by createResolvables(), and provideResolvables().

void zypp::source::susetags::SuseTagsImpl::provideSelection Source_Ref  source_r,
ResStore store
[private]
 

void zypp::source::susetags::SuseTagsImpl::providePatterns Source_Ref  source_r,
ResStore store
[private]
 

Definition at line 736 of file SuseTagsImpl.cc.

References zypp::source::SourceImpl::_store, zypp::filesystem::Pathname::asString(), DBG, descrDir(), zypp::iostr::getline(), zypp::ResStore::insert(), MIL, and zypp::source::susetags::parsePattern().

Referenced by createResolvables(), and provideResolvables().

bool zypp::source::susetags::SuseTagsImpl::verifyChecksumsMode  )  const [private]
 

verify media mode (use the new META tags)

Definition at line 368 of file SuseTagsImpl.cc.

References _prodImpl.

Referenced by verifyFile().

void zypp::source::susetags::SuseTagsImpl::verifyFile const Pathname path,
const std::string &  key
const [private]
 

Verify file checksum.

Exceptions:
EXCEPTION on verification file

Definition at line 534 of file SuseTagsImpl.cc.

References _prodImpl, zypp::filesystem::Pathname::asString(), zypp::CheckSum::empty(), MIL, zypp::source::SourceImpl::path(), report, verifyChecksumsMode(), and ZYPP_THROW.

Referenced by checkMetadataChecksums().


Member Data Documentation

unsigned zypp::source::susetags::SuseTagsImpl::_media_count [private]
 

Definition at line 179 of file SuseTagsImpl.h.

Referenced by numberOfMedia().

Pathname zypp::source::susetags::SuseTagsImpl::_data_dir [private]
 

Definition at line 184 of file SuseTagsImpl.h.

Referenced by dataDir(), readContentFile(), and sourceDir().

Pathname zypp::source::susetags::SuseTagsImpl::_media_descr_dir [private]
 

Definition at line 189 of file SuseTagsImpl.h.

Referenced by mediaDescrDir(), and readContentFile().

std::string zypp::source::susetags::SuseTagsImpl::_vendor [private]
 

Definition at line 191 of file SuseTagsImpl.h.

Referenced by vendor(), and verifier().

std::string zypp::source::susetags::SuseTagsImpl::_media_id [private]
 

Definition at line 192 of file SuseTagsImpl.h.

Referenced by unique_id(), and verifier().

detail::ResImplTraits<SuseTagsProductImpl>::Ptr zypp::source::susetags::SuseTagsImpl::_prodImpl [private]
 

pointer to the product implementation we need it to access the checksums if we are in verify mode

Definition at line 197 of file SuseTagsImpl.h.

Referenced by checkMetadataChecksums(), readContentFile(), verifyChecksumsMode(), and verifyFile().

Product::Ptr zypp::source::susetags::SuseTagsImpl::_product [private]
 

Definition at line 198 of file SuseTagsImpl.h.

Referenced by provideProducts(), and readContentFile().

std::map<NVRA, SuseTagsPackageImplData> zypp::source::susetags::SuseTagsImpl::_package_data
 

Definition at line 202 of file SuseTagsImpl.h.

std::map<NVRA, DefaultFalseBool> zypp::source::susetags::SuseTagsImpl::_is_shared
 

Definition at line 204 of file SuseTagsImpl.h.

std::map<NVRA, DefaultFalseBool> zypp::source::susetags::SuseTagsImpl::_provides_shared_data
 

Definition at line 206 of file SuseTagsImpl.h.

std::list<std::string> zypp::source::susetags::SuseTagsImpl::_pkg_translations
 

Definition at line 209 of file SuseTagsImpl.h.

Referenced by providePackages().


The documentation for this class was generated from the following files:
Generated on Thu Jul 6 00:07:34 2006 for zypp by  doxygen 1.4.6