Author: dmacvicar Date: Wed Jun 13 18:24:34 2007 New Revision: 5744 URL: http://svn.opensuse.org/viewcvs/zypp?rev=5744&view=rev Log: backup Added: trunk/libzypp/zypp/repo/PackageProvider.cc - copied, changed from r5739, trunk/libzypp/zypp/source/PackageProvider.cc trunk/libzypp/zypp/repo/PackageProvider.h - copied unchanged from r5739, trunk/libzypp/zypp/source/PackageProvider.h trunk/libzypp/zypp/repo/memory/AtomImpl.cc trunk/libzypp/zypp/repo/memory/AtomImpl.h trunk/libzypp/zypp/repo/memory/MessageImpl.cc trunk/libzypp/zypp/repo/memory/MessageImpl.h trunk/libzypp/zypp/repo/memory/PatchImpl.cc trunk/libzypp/zypp/repo/memory/PatchImpl.h trunk/libzypp/zypp/repo/memory/RepoImpl.cc trunk/libzypp/zypp/repo/memory/RepoImpl.h trunk/libzypp/zypp/repo/memory/ScriptImpl.cc trunk/libzypp/zypp/repo/memory/ScriptImpl.h Modified: trunk/libzypp/zypp/CMakeLists.txt trunk/libzypp/zypp/cache/schema/schema.sql trunk/libzypp/zypp/repo/memory/PackageImpl.cc trunk/libzypp/zypp/repo/memory/PackageImpl.h trunk/libzypp/zypp/repo/memory/PatternImpl.cc trunk/libzypp/zypp/repo/memory/PatternImpl.h Modified: trunk/libzypp/zypp/CMakeLists.txt URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/CMakeLists.txt?rev=5744&r1=5743&r2=5744&view=diff ============================================================================== --- trunk/libzypp/zypp/CMakeLists.txt (original) +++ trunk/libzypp/zypp/CMakeLists.txt Wed Jun 13 18:24:34 2007 @@ -1115,15 +1115,19 @@ SET( zypp_repo_data_SRCS repo/memory/PackageImpl.cc - repo/memory/PatternImpl.cc - repo/memory/ProductImpl.cc +# repo/memory/PatternImpl.cc +# repo/memory/ProductImpl.cc +# repo/memory/PatchImpl.cc +# repo/memory/RepoImpl.cc repo/memory/SrcPackageImpl.cc ) SET( zypp_repo_data_HEADERS repo/memory/PackageImpl.h - repo/memory/PatternImpl.h - repo/memory/ProductImpl.h +# repo/memory/PatternImpl.h +# repo/memory/ProductImpl.h +# repo/memory/PatchImpl.h +# repo/memory/RepoImpl.h repo/memory/SrcPackageImpl.h ) Modified: trunk/libzypp/zypp/cache/schema/schema.sql URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/cache/schema/schema.sql?rev=5744&r1=5743&r2=5744&view=diff ============================================================================== --- trunk/libzypp/zypp/cache/schema/schema.sql (original) +++ trunk/libzypp/zypp/cache/schema/schema.sql Wed Jun 13 18:24:34 2007 @@ -40,7 +40,7 @@ CREATE TABLE db_info ( version INTEGER ); - +--INSERT INTO db_info (version) VALUES (' ------------------------------------------------ -- Basic types like archs, attributes, languages ------------------------------------------------ @@ -168,7 +168,7 @@ , baseversion_checksum TEXT , baseversion_build_time INTEGER , baseversion_sequence_info TEXT - + , repository_id INTEGER REFERENCES repositories(id) ); CREATE TABLE patch_packages ( @@ -178,7 +178,7 @@ , checksum TEXT , download_size INTEGER , build_time INTEGER - + , repository_id INTEGER REFERENCES repositories(id) ); CREATE TABLE patch_packages_baseversions ( @@ -187,7 +187,6 @@ , version TEXT , release TEXT , epoch INTEGER - ); ------------------------------------------------ Copied: trunk/libzypp/zypp/repo/PackageProvider.cc (from r5739, trunk/libzypp/zypp/source/PackageProvider.cc) URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/PackageProvider.cc?p2=trunk/libzypp/zypp/repo/PackageProvider.cc&p1=trunk/libzypp/zypp/source/PackageProvider.cc&r1=5739&r2=5744&rev=5744&view=diff ============================================================================== --- trunk/libzypp/zypp/source/PackageProvider.cc (original) +++ trunk/libzypp/zypp/repo/PackageProvider.cc Wed Jun 13 18:24:34 2007 @@ -21,7 +21,12 @@ #include "zypp/source/PackageDelta.h" #include "zypp/detail/ImplConnect.h" +#include "zypp/RepoInfo.h" +#include "zypp/Repository.h" +#include "zypp/media/MediaManager.h" + using std::endl; +using zypp::media::MediaManager; /////////////////////////////////////////////////////////////////// namespace zypp @@ -77,12 +82,20 @@ ManagedFile PackageProvider::providePackage() const { + Url url; + RepoInfo info = _package->repository().info(); + // FIXME we only support the first url for now. + if ( info.baseUrls().empty() ) + ZYPP_THROW(Exception("No url in repository.")); + else + url = * info.baseUrls().begin(); + MIL << "provide Package " << _package << endl; ScopedGuard guardReport( newReport() ); ManagedFile ret; do { _retry = false; - report()->start( _package, _package->source().url() ); + report()->start( _package, url ); try // ELIMINATE try/catch by providing a log-guard { ret = doProvidePackage(); @@ -104,8 +117,16 @@ ManagedFile PackageProvider::doProvidePackage() const { + Url url; + RepoInfo info = _package->repository().info(); + // FIXME we only support the first url for now. + if ( info.baseUrls().empty() ) + ZYPP_THROW(Exception("No url in repository.")); + else + url = * info.baseUrls().begin(); + // check whether to process patch/delta rpms - if ( _package->source().remote() ) + if ( MediaManager::downloads(url) ) { std::list<DeltaRpm> deltaRpms( _implPtr->deltaRpms() ); std::list<PatchRpm> patchRpms( _implPtr->patchRpms() ); @@ -158,7 +179,7 @@ // no patch/delta -> provide full package ManagedFile ret; OnMediaLocation loc; - loc.medianr( _package->sourceMediaNr() ) + loc.medianr( _package->mediaNr() ) .filename( _package->location() ) .checksum( _package->checksum() ) .downloadsize( _package->archivesize() ); @@ -167,7 +188,7 @@ policy.progressCB( bind( &PackageProvider::progressPackageDownload, this, _1 ) ); policy.failOnChecksumErrorCB( bind( &PackageProvider::failOnChecksumError, this ) ); - return source::provideFile( _package->source(), loc, policy ); + return source::provideFile( url, loc, policy ); } ManagedFile PackageProvider::tryDelta( const DeltaRpm & delta_r ) const @@ -186,7 +207,7 @@ { ProvideFilePolicy policy; policy.progressCB( bind( &PackageProvider::progressDeltaDownload, this, _1 ) ); - delta = source::provideFile( _package->source(), delta_r.location(), policy ); + delta = source::provideFile( Url(), delta_r.location(), policy ); } catch ( const Exception & excpt ) { @@ -236,7 +257,7 @@ { ProvideFilePolicy policy; policy.progressCB( bind( &PackageProvider::progressPatchDownload, this, _1 ) ); - patch = source::provideFile( _package->source(), patch_r.location(), policy ); + patch = source::provideFile( Url(), patch_r.location(), policy ); } catch ( const Exception & excpt ) { Added: trunk/libzypp/zypp/repo/memory/AtomImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/memory/AtomImpl.cc?rev=5744&view=auto ============================================================================== --- trunk/libzypp/zypp/repo/memory/AtomImpl.cc (added) +++ trunk/libzypp/zypp/repo/memory/AtomImpl.cc Wed Jun 13 18:24:34 2007 @@ -0,0 +1,124 @@ +/*---------------------------------------------------------------------\ +| ____ _ __ __ ___ | +| |__ / \ / / . \ . \ | +| / / \ V /| _/ _/ | +| / /__ | | | | | | | +| /_____||_| |_| |_| | +| | +\---------------------------------------------------------------------*/ + +#include "zypp/TranslatedText.h" +#include "zypp/base/String.h" +#include "zypp/base/Logger.h" +#include "zypp/repo/RepositoryImpl.h" +#include "AtomImpl.h" + + +using namespace std; +using namespace zypp::detail; +using namespace::zypp::repo; + +/////////////////////////////////////////////////////////////////// +namespace zypp { namespace repo { namespace memory { + +/////////////////////////////////////////////////////////////////// +// +// CLASS NAME : AtomImpl +// +/////////////////////////////////////////////////////////////////// + +/** Default ctor +*/ +AtomImpl::AtomImpl (const data::RecordId &id, memory::RepoImpl::Ptr repository_r) + : _repository (repository_r), + _id(id) +{} + +Repository +AtomImpl::repository() const +{ + return _repository->selfRepository(); +} + +/////////////////////////////////////////////////// +// ResObject Attributes +/////////////////////////////////////////////////// + +TranslatedText AtomImpl::summary() +{ + return _summary; +} + +TranslatedText AtomImpl::description() +{ + return _description; +} + +TranslatedText AtomImpl::insnotify() +{ + return _insnotify; +} + +TranslatedText AtomImpl::delnotify() +{ + return _delnotify; +} + +TranslatedText AtomImpl::licenseToConfirm() +{ + return _license_to_confirm; +} + +Vendor AtomImpl::vendor() +{ + return _vendor; +} + +ByteCount AtomImpl::size() +{ + return _size; +} + +ByteCount AtomImpl::archivesize() +{ + return _archivesize; +} + +bool AtomImpl::installOnly() +{ + return _install_only; +} + +Date AtomImpl::buildtime() +{ + return _buildtime; +} + +Date AtomImpl::installtime() +{ + return _installtime; +} + +unsigned AtomImpl::mediaNr() +{ + return _media_nr; +} + +////////////////////////////////////////// +// DEPRECATED +////////////////////////////////////////// + +Source_Ref AtomImpl::source() const +{ + return Source_Ref::noSource; +} + +unsigned AtomImpl::mediaNr() const +{ + return 1; +} + +///////////////////////////////////////////////////////////////// +} } } // namespace zypp::repo::memory +/////////////////////////////////////////////////////////////////// + Added: trunk/libzypp/zypp/repo/memory/AtomImpl.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/memory/AtomImpl.h?rev=5744&view=auto ============================================================================== --- trunk/libzypp/zypp/repo/memory/AtomImpl.h (added) +++ trunk/libzypp/zypp/repo/memory/AtomImpl.h Wed Jun 13 18:24:34 2007 @@ -0,0 +1,74 @@ +/*---------------------------------------------------------------------\ +| ____ _ __ __ ___ | +| |__ / \ / / . \ . \ | +| / / \ V /| _/ _/ | +| / /__ | | | | | | | +| /_____||_| |_| |_| | +| | +\---------------------------------------------------------------------*/ + +#ifndef zypp_repo_memory_AtomImpl_H +#define zypp_repo_memory_AtomImpl_H + +#include "zypp/detail/AtomImpl.h" +#include "zypp/repo/memory/RepoImpl.h" + +/////////////////////////////////////////////////////////////////// +namespace zypp +{ ///////////////////////////////////////////////////////////////// +namespace repo +{ ///////////////////////////////////////////////////////////////// +namespace memory +{ ///////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////// + // + // CLASS NAME : AtomImpl + // + class AtomImpl : public detail::AtomImplIf + { + public: + + AtomImpl( const data::RecordId &id, repo::memory::RepoImpl::Ptr repository_r ); + + virtual TranslatedText summary() const; + virtual TranslatedText description() const; + virtual TranslatedText insnotify() const; + virtual TranslatedText delnotify() const; + virtual TranslatedText licenseToConfirm() const; + virtual Vendor vendor() const; + virtual ByteCount size() const; + virtual ByteCount archivesize() const; + virtual bool installOnly() const; + virtual Date buildtime() const; + virtual Date installtime() const; + + virtual Source_Ref source() const; + virtual unsigned mediaNr() const; + + virtual Repository repository() const; + + protected: + repo::memory::RepoImpl::Ptr _repository; + + //ResObject + TranslatedText _summary; + TranslatedText _description; + TranslatedText _insnotify; + TranslatedText _delnotify; + TranslatedText _license_to_confirm; + Vendor _vendor; + ByteCount _size; + ByteCount _archivesize; + bool _install_only; + Date _buildtime; + Date _installtime; + unsigned _media_nr; + }; + ///////////////////////////////////////////////////////////////// +} // namespace memory +} // namespace repository +} // namespace zypp +/////////////////////////////////////////////////////////////////// +#endif // ZMD_BACKEND_DBSOURCE_DBPACKAGEIMPL_H + Added: trunk/libzypp/zypp/repo/memory/MessageImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/memory/MessageImpl.cc?rev=5744&view=auto ============================================================================== --- trunk/libzypp/zypp/repo/memory/MessageImpl.cc (added) +++ trunk/libzypp/zypp/repo/memory/MessageImpl.cc Wed Jun 13 18:24:34 2007 @@ -0,0 +1,139 @@ +/*---------------------------------------------------------------------\ +| ____ _ __ __ ___ | +| |__ / \ / / . \ . \ | +| / / \ V /| _/ _/ | +| / /__ | | | | | | | +| /_____||_| |_| |_| | +| | +\---------------------------------------------------------------------*/ + +#include "zypp/TranslatedText.h" +#include "zypp/base/String.h" +#include "zypp/base/Logger.h" +#include "zypp/repo/RepositoryImpl.h" +#include "MessageImpl.h" + + +using namespace std; +using namespace zypp::detail; +using namespace::zypp::repo; + +/////////////////////////////////////////////////////////////////// +namespace zypp { namespace repo { namespace memory { + +/////////////////////////////////////////////////////////////////// +// +// CLASS NAME : MessageImpl +// +/////////////////////////////////////////////////////////////////// + +/** Default ctor +*/ +MessageImpl::MessageImpl (const data::RecordId &id, memory::RepoImpl::Ptr repository_r) + : _repository (repository_r), + _id(id) +{} + +Repository +MessageImpl::repository() const +{ + return _repository->selfRepository(); +} + +/////////////////////////////////////////////////// +// ResObject Attributes +/////////////////////////////////////////////////// + +TranslatedText MessageImpl::summary() +{ + return _summary; +} + +TranslatedText MessageImpl::description() +{ + return _description; +} + +TranslatedText MessageImpl::insnotify() +{ + return _insnotify; +} + +TranslatedText MessageImpl::delnotify() +{ + return _delnotify; +} + +TranslatedText MessageImpl::licenseToConfirm() +{ + return _license_to_confirm; +} + +Vendor MessageImpl::vendor() +{ + return _vendor; +} + +ByteCount MessageImpl::size() +{ + return _size; +} + +ByteCount MessageImpl::archivesize() +{ + return _archivesize; +} + +bool MessageImpl::installOnly() +{ + return _install_only; +} + +Date MessageImpl::buildtime() +{ + return _buildtime; +} + +Date MessageImpl::installtime() +{ + return _installtime; +} + +unsigned MessageImpl::mediaNr() +{ + return _media_nr; +} +} + +////////////////////////////////////////// +// DEPRECATED +////////////////////////////////////////// + +Source_Ref MessageImpl::source() const +{ + return Source_Ref::noSource; +} + +unsigned MessageImpl::mediaNr() const +{ + return 1; +} + +////////////////////////////////////////// +// MESSAGE +///////////////////////////////////////// + +TranslatedText MessageImpl::text() const +{ + return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "Message", "text" ); +} + +Patch::constPtr MessageImpl::patch() const +{ + return 0; +} + +///////////////////////////////////////////////////////////////// +} } } // namespace zypp::repo::memory +/////////////////////////////////////////////////////////////////// + Added: trunk/libzypp/zypp/repo/memory/MessageImpl.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/memory/MessageImpl.h?rev=5744&view=auto ============================================================================== --- trunk/libzypp/zypp/repo/memory/MessageImpl.h (added) +++ trunk/libzypp/zypp/repo/memory/MessageImpl.h Wed Jun 13 18:24:34 2007 @@ -0,0 +1,78 @@ +/*---------------------------------------------------------------------\ +| ____ _ __ __ ___ | +| |__ / \ / / . \ . \ | +| / / \ V /| _/ _/ | +| / /__ | | | | | | | +| /_____||_| |_| |_| | +| | +\---------------------------------------------------------------------*/ + +#ifndef zypp_repo_memory_MessageImpl_H +#define zypp_repo_memory_MessageImpl_H + +#include "zypp/detail/MessageImpl.h" +#include "zypp/repo/memory/RepoImpl.h" + +/////////////////////////////////////////////////////////////////// +namespace zypp +{ ///////////////////////////////////////////////////////////////// +namespace repo +{ ///////////////////////////////////////////////////////////////// +namespace memory +{ ///////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////// + // + // CLASS NAME : MessageImpl + // + class MessageImpl : public detail::MessageImplIf + { + public: + + MessageImpl( const data::RecordId &id, repo::memory::RepoImpl::Ptr repository_r ); + + virtual TranslatedText summary() const; + virtual TranslatedText description() const; + virtual TranslatedText insnotify() const; + virtual TranslatedText delnotify() const; + virtual TranslatedText licenseToConfirm() const; + virtual Vendor vendor() const; + virtual ByteCount size() const; + virtual ByteCount archivesize() const; + virtual bool installOnly() const; + virtual Date buildtime() const; + virtual Date installtime() const; + + virtual Source_Ref source() const; + virtual unsigned mediaNr() const; + + // MESSAGE + virtual TranslatedText text() const; + virtual Patch::constPtr patch() const; + + virtual Repository repository() const; + + protected: + repo::memory::RepoImpl::Ptr _repository; + + //ResObject + TranslatedText _summary; + TranslatedText _description; + TranslatedText _insnotify; + TranslatedText _delnotify; + TranslatedText _license_to_confirm; + Vendor _vendor; + ByteCount _size; + ByteCount _archivesize; + bool _install_only; + Date _buildtime; + Date _installtime; + unsigned _media_nr; + }; + ///////////////////////////////////////////////////////////////// +} // namespace memory +} // namespace repository +} // namespace zypp +/////////////////////////////////////////////////////////////////// +#endif // ZMD_BACKEND_DBSOURCE_DBPACKAGEIMPL_H + Modified: trunk/libzypp/zypp/repo/memory/PackageImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/memory/PackageImpl.cc?rev=5744&r1=5743&r2=5744&view=diff ============================================================================== --- trunk/libzypp/zypp/repo/memory/PackageImpl.cc (original) +++ trunk/libzypp/zypp/repo/memory/PackageImpl.cc Wed Jun 13 18:24:34 2007 @@ -28,25 +28,29 @@ // METHOD NAME : PackageImpl::PackageImpl // METHOD TYPE : Ctor // -PackageImpl::PackageImpl(data::Package_Ptr ptr) - : - _summary(ptr->summary), - _description(ptr->description), - _insnotify(ptr->insnotify), - _delnotify(ptr->delnotify), - _license_to_confirm(ptr->licenseToConfirm), - _group(ptr->group), - _keywords(), - _authors(ptr->authors), - _size(ptr->installedSize), - _archivesize(ptr->repositoryLocation.fileSize), - _vendor(ptr->vendor), - _license(ptr->license), - _buildtime(ptr->buildTime), - _media_number(ptr->repositoryLocation.mediaNr), - _location(ptr->repositoryLocation.filePath), - _diskusage(), - _checksum(ptr->repositoryLocation.fileChecksum) +PackageImpl::PackageImpl( repo::memory::RepoImpl::Ptr repo, data::Package_Ptr ptr) + : _repository(repo), + + _summary(ptr->summary), + _description(ptr->description), + _insnotify(ptr->insnotify), + _delnotify(ptr->delnotify), + _license_to_confirm(ptr->licenseToConfirm), + _vendor(ptr->vendor), + _size(ptr->installedSize), + _archivesize(ptr->repositoryLocation.fileSize), + _install_only(false), + _buildtime(ptr->buildTime), + _media_nr(ptr->repositoryLocation.mediaNr), + + _group(ptr->group), + _keywords(), + _authors(ptr->authors), + _license(ptr->license), + _buildtime(ptr->buildTime), + _location(ptr->repositoryLocation.filePath), + _diskusage(), + _checksum(ptr->repositoryLocation.fileChecksum) { } @@ -58,39 +62,81 @@ PackageImpl::~PackageImpl() {} -TranslatedText PackageImpl::summary() const +Repository +PackageImpl::repository() const +{ + return _repository->selfRepository(); +} + +/////////////////////////////////////////////////// +// ResObject Attributes +/////////////////////////////////////////////////// + +TranslatedText PackageImpl::summary() { return _summary; } -TranslatedText PackageImpl::description() const +TranslatedText PackageImpl::description() { return _description; } -TranslatedText PackageImpl::insnotify() const +TranslatedText PackageImpl::insnotify() { return _insnotify; } -TranslatedText PackageImpl::delnotify() const +TranslatedText PackageImpl::delnotify() { return _delnotify; } -TranslatedText PackageImpl::licenseToConfirm() const +TranslatedText PackageImpl::licenseToConfirm() { return _license_to_confirm; } -Source_Ref PackageImpl::source() const +Vendor PackageImpl::vendor() { - return Source_Ref::noSource; + return _vendor; +} + +ByteCount PackageImpl::size() +{ + return _size; +} + +ByteCount PackageImpl::archivesize() +{ + return _archivesize; +} + +bool PackageImpl::installOnly() +{ + return _install_only; +} + +Date PackageImpl::buildtime() +{ + return _buildtime; +} + +Date PackageImpl::installtime() +{ + return _installtime; } -unsigned PackageImpl::sourceMediaNr() const +unsigned PackageImpl::mediaNr() { - return _media_number; + return _media_nr; +} + +//////////////////////////////////////////////////// + +Source_Ref PackageImpl::source() const +{ + return Source_Ref::noSource; } CheckSum PackageImpl::checksum() const @@ -183,22 +229,12 @@ return Text(); } -ByteCount PackageImpl::size() const -{ - return _size; -} - ByteCount PackageImpl::sourcesize() const // FIXME { return 0; } -ByteCount PackageImpl::archivesize() const -{ - return _archivesize; -} - DiskUsage PackageImpl::diskusage() const { return _diskusage; @@ -214,21 +250,6 @@ return list<string>(); } -listdetail::PackageImplIf::DeltaRpm PackageImpl::deltaRpms() const -{ - return detail::PackageImplIf::deltaRpms(); -} - -listdetail::PackageImplIf::PatchRpm PackageImpl::patchRpms() const -{ - return detail::PackageImplIf::patchRpms(); -} - -bool PackageImpl::installOnly() const -{ - return false; -} - ///////////////////////////////////////////////////////////////// } // namespace memory /////////////////////////////////////////////////////////////////// Modified: trunk/libzypp/zypp/repo/memory/PackageImpl.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/memory/PackageImpl.h?rev=5744&r1=5743&r2=5744&view=diff ============================================================================== --- trunk/libzypp/zypp/repo/memory/PackageImpl.h (original) +++ trunk/libzypp/zypp/repo/memory/PackageImpl.h Wed Jun 13 18:24:34 2007 @@ -17,6 +17,8 @@ #include "zypp/data/ResolvableData.h" #include "zypp/DiskUsage.h" #include "zypp/CheckSum.h" +#include "zypp/Repository.h" +#include "zypp/repo/memory/RepoImpl.h" /////////////////////////////////////////////////////////////////// namespace zypp @@ -29,34 +31,29 @@ DEFINE_PTR_TYPE(DImpl); - /////////////////////////////////////////////////////////////////// - // - // CLASS NAME : PackageImpl - // - /** - */ struct PackageImpl : public zypp::detail::PackageImplIf { - PackageImpl( data::Package_Ptr ptr ); + PackageImpl( repo::memory::RepoImpl::Ptr repo, data::Package_Ptr ptr ); virtual ~PackageImpl(); - /** \name ResObject attributes. */ - //@{ + virtual Repository repository() const; + virtual TranslatedText summary() const; virtual TranslatedText description() const; virtual TranslatedText insnotify() const; virtual TranslatedText delnotify() const; virtual TranslatedText licenseToConfirm() const; - virtual Source_Ref source() const; - virtual unsigned sourceMediaNr() const; - //@} + virtual Vendor vendor() const; + virtual ByteCount size() const; + virtual ByteCount archivesize() const; + virtual bool installOnly() const; + virtual Date buildtime() const; + virtual Date installtime() const; + virtual unsigned mediaNr() const; virtual CheckSum checksum() const; - virtual Date buildtime() const; virtual std::string buildhost() const; - virtual Date installtime() const; virtual std::string distribution() const; - virtual Vendor vendor() const; virtual Label license() const; virtual std::string packager() const; virtual PackageGroup group() const; @@ -69,31 +66,31 @@ virtual Text postin() const; virtual Text preun() const; virtual Text postun() const; - virtual ByteCount size() const; virtual ByteCount sourcesize() const; - virtual ByteCount archivesize() const; virtual DiskUsage diskusage() const; virtual std::liststd::string authors() const; virtual std::liststd::string filenames() const; - virtual std::list<DeltaRpm> deltaRpms() const; - virtual std::list<PatchRpm> patchRpms() const; - virtual bool installOnly() const; - + + repo::memory::RepoImpl::Ptr _repository; + + //ResObject TranslatedText _summary; TranslatedText _description; TranslatedText _insnotify; TranslatedText _delnotify; TranslatedText _license_to_confirm; + Vendor _vendor; + ByteCount _size; + ByteCount _archivesize; + bool _install_only; + Date _buildtime; + Date _installtime; + unsigned _media_nr; PackageGroup _group; Keywords _keywords; std::liststd::string _authors; - ByteCount _size; - ByteCount _archivesize; - Vendor _vendor; Label _license; - Date _buildtime; - unsigned _media_number; Pathname _location; DiskUsage _diskusage; CheckSum _checksum; Added: trunk/libzypp/zypp/repo/memory/PatchImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/memory/PatchImpl.cc?rev=5744&view=auto ============================================================================== --- trunk/libzypp/zypp/repo/memory/PatchImpl.cc (added) +++ trunk/libzypp/zypp/repo/memory/PatchImpl.cc Wed Jun 13 18:24:34 2007 @@ -0,0 +1,143 @@ +/*---------------------------------------------------------------------\ +| ____ _ __ __ ___ | +| |__ / \ / / . \ . \ | +| / / \ V /| _/ _/ | +| / /__ | | | | | | | +| /_____||_| |_| |_| | +| | +\---------------------------------------------------------------------*/ + +#include "zypp/TranslatedText.h" +#include "zypp/base/String.h" +#include "zypp/base/Logger.h" +#include "zypp/repo/RepositoryImpl.h" +#include "PatchImpl.h" + + +using namespace std; +using namespace zypp::detail; +using namespace::zypp::repo; + +/////////////////////////////////////////////////////////////////// +namespace zypp { namespace repo { namespace memory { + +/////////////////////////////////////////////////////////////////// +// +// CLASS NAME : PatchImpl +// +/////////////////////////////////////////////////////////////////// + +/** Default ctor +*/ +PatchImpl::PatchImpl ( repo::memory::RepoImpl::Ptr repo, data::Patch_Ptr ptr) + : _repository(repo) +{} + +Repository +PatchImpl::repository() const +{ + return _repository->selfRepository(); +} + +/////////////////////////////////////////////////// +// ResObject Attributes +/////////////////////////////////////////////////// + +TranslatedText PatchImpl::summary() +{ + return _summary; +} + +TranslatedText PatchImpl::description() +{ + return _description; +} + +TranslatedText PatchImpl::insnotify() +{ + return _insnotify; +} + +TranslatedText PatchImpl::delnotify() +{ + return _delnotify; +} + +TranslatedText PatchImpl::licenseToConfirm() +{ + return _license_to_confirm; +} + +Vendor PatchImpl::vendor() +{ + return _vendor; +} + +ByteCount PatchImpl::size() +{ + return _size; +} + +ByteCount PatchImpl::archivesize() +{ + return _archivesize; +} + +bool PatchImpl::installOnly() +{ + return _install_only; +} + +Date PatchImpl::buildtime() +{ + return _buildtime; +} + +Date PatchImpl::installtime() +{ + return _installtime; +} + +unsigned PatchImpl::mediaNr() +{ + return _media_nr; +} + +////////////////////////////////////////// +// PATCH +///////////////////////////////////////// + +std::string PatchImpl::id() const +{ + return _repository->resolvableQuery().queryStringAttribute( _id, "Patch", "id" ); +} + +Date PatchImpl::timestamp() const +{ + return _patch_id; +} + +std::string PatchImpl::category() const +{ + return _category; +} + +bool PatchImpl::reboot_needed() const +{ + return _reboot_nedeed; +} + +bool PatchImpl::affects_pkg_manager() const +{ + return _affects_pkg_manager; +} + +PatchImpl::AtomList PatchImpl::all_atoms() const +{ + return _atoms; +} + +///////////////////////////////////////////////////////////////// +} } } // namespace zypp::repo::memory +/////////////////////////////////////////////////////////////////// + Added: trunk/libzypp/zypp/repo/memory/PatchImpl.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/memory/PatchImpl.h?rev=5744&view=auto ============================================================================== --- trunk/libzypp/zypp/repo/memory/PatchImpl.h (added) +++ trunk/libzypp/zypp/repo/memory/PatchImpl.h Wed Jun 13 18:24:34 2007 @@ -0,0 +1,89 @@ +/*---------------------------------------------------------------------\ +| ____ _ __ __ ___ | +| |__ / \ / / . \ . \ | +| / / \ V /| _/ _/ | +| / /__ | | | | | | | +| /_____||_| |_| |_| | +| | +\---------------------------------------------------------------------*/ + +#ifndef zypp_repo_memory_PatchImpl_H +#define zypp_repo_memory_PatchImpl_H + +#include "zypp/detail/PatchImpl.h" +#include "zypp/data/ResolvableData.h" +#include "zypp/repo/memory/RepoImpl.h" +#include "zypp/Repository.h" +/////////////////////////////////////////////////////////////////// +namespace zypp +{ ///////////////////////////////////////////////////////////////// +namespace repo +{ ///////////////////////////////////////////////////////////////// +namespace memory +{ ///////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////// + // + // CLASS NAME : PatchImpl + // + class PatchImpl : public detail::PatchImplIf + { + public: + + PatchImpl( repo::memory::RepoImpl::Ptr repo, data::Patch_Ptr ptr); + + virtual TranslatedText summary() const; + virtual TranslatedText description() const; + virtual TranslatedText insnotify() const; + virtual TranslatedText delnotify() const; + virtual TranslatedText licenseToConfirm() const; + virtual Vendor vendor() const; + virtual ByteCount size() const; + virtual ByteCount archivesize() const; + virtual bool installOnly() const; + virtual Date buildtime() const; + virtual Date installtime() const; + virtual unsigned mediaNr() const; + + // PATCH + virtual std::string id() const; + virtual Date timestamp() const; + virtual std::string category() const; + virtual bool reboot_needed() const; + virtual bool affects_pkg_manager() const; + virtual AtomList all_atoms() const; + + virtual Repository repository() const; + + protected: + repo::memory::RepoImpl::Ptr _repository; + + //ResObject + TranslatedText _summary; + TranslatedText _description; + TranslatedText _insnotify; + TranslatedText _delnotify; + TranslatedText _license_to_confirm; + Vendor _vendor; + ByteCount _size; + ByteCount _archivesize; + bool _install_only; + Date _buildtime; + Date _installtime; + unsigned _media_nr; + + // patch + std::string _patch_id; + Date _timestamp; + std::string _category; + bool _reboot_needed; + bool _affects_pkg_manager; + AtomList _atoms; + }; + ///////////////////////////////////////////////////////////////// +} // namespace memory +} // namespace repository +} // namespace zypp +/////////////////////////////////////////////////////////////////// +#endif // ZMD_BACKEND_DBSOURCE_DBPACKAGEIMPL_H + Modified: trunk/libzypp/zypp/repo/memory/PatternImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/memory/PatternImpl.cc?rev=5744&r1=5743&r2=5744&view=diff ============================================================================== --- trunk/libzypp/zypp/repo/memory/PatternImpl.cc (original) +++ trunk/libzypp/zypp/repo/memory/PatternImpl.cc Wed Jun 13 18:24:34 2007 @@ -26,8 +26,11 @@ // METHOD NAME : PatternImpl::PatternImpl // METHOD TYPE : Ctor // -PatternImpl::PatternImpl(data::Pattern_Ptr ptr) -{} +PatternImpl::PatternImpl( repo::memory::RepoImpl::Ptr repo, data::Pattern_Ptr ptr) + : _repository(repo) +{ + +} /////////////////////////////////////////////////////////////////// // @@ -37,37 +40,84 @@ PatternImpl::~PatternImpl() {} -Source_Ref PatternImpl::source() const +TranslatedText PatternImpl::summary() { - return Source_Ref::noSource; + return _summary; } -TranslatedText PatternImpl::summary() const +TranslatedText PatternImpl::description() { - return _summary; + return _description; } -TranslatedText PatternImpl::description() const +TranslatedText PatternImpl::insnotify() { - return _description; + return _insnotify; +} + +TranslatedText PatternImpl::delnotify() +{ + return _delnotify; +} + +TranslatedText PatternImpl::licenseToConfirm() +{ + return _license_to_confirm; +} + +Vendor PatternImpl::vendor() +{ + return _vendor; +} + +ByteCount PatternImpl::size() +{ + return _size; +} + +ByteCount PatternImpl::archivesize() +{ + return _archivesize; +} + +bool PatternImpl::installOnly() +{ + return _install_only; +} + +Date PatternImpl::buildtime() +{ + return _buildtime; +} + +Date PatternImpl::installtime() +{ + return _installtime; } -TranslatedText PatternImpl::category() const +unsigned PatternImpl::mediaNr() +{ + return _media_nr; +} + +/////////////////////////////////////// + +TranslatedText PatternImpl::category() { return _category; } -bool PatternImpl::userVisible() const +bool PatternImpl::userVisible() { return _visible; } -Label PatternImpl::order() const +Label PatternImpl::order() { return _order; } -Pathname PatternImpl::icon() const +Pathname PatternImpl::icon() { return _icon; } Modified: trunk/libzypp/zypp/repo/memory/PatternImpl.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/memory/PatternImpl.h?rev=5744&r1=5743&r2=5744&view=diff ============================================================================== --- trunk/libzypp/zypp/repo/memory/PatternImpl.h (original) +++ trunk/libzypp/zypp/repo/memory/PatternImpl.h Wed Jun 13 18:24:34 2007 @@ -33,20 +33,43 @@ */ struct PatternImpl : public zypp::detail::PatternImplIf { -public: - PatternImpl(data::Pattern_Ptr ptr); + public: + PatternImpl( repo::memory::RepoImpl::Ptr repo, data::Pattern_Ptr ptr); virtual ~PatternImpl(); virtual TranslatedText summary() const; virtual TranslatedText description() const; - virtual TranslatedText category() const; + virtual TranslatedText insnotify() const; + virtual TranslatedText delnotify() const; + virtual TranslatedText licenseToConfirm() const; + virtual Vendor vendor() const; + virtual ByteCount size() const; + virtual ByteCount archivesize() const; + virtual bool installOnly() const; + virtual Date buildtime() const; + virtual Date installtime() const; + virtual unsigned mediaNr() const; + virtual bool userVisible() const; virtual Label order() const; virtual Pathname icon() const; - virtual Source_Ref source() const; + private: + //ResObject TranslatedText _summary; TranslatedText _description; + TranslatedText _insnotify; + TranslatedText _delnotify; + TranslatedText _license_to_confirm; + Vendor _vendor; + ByteCount _size; + ByteCount _archivesize; + bool _install_only; + Date _buildtime; + Date _installtime; + unsigned _media_nr; + + // Pattern TranslatedText _category; bool _visible; std::string _order; Added: trunk/libzypp/zypp/repo/memory/RepoImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/memory/RepoImpl.cc?rev=5744&view=auto ============================================================================== --- trunk/libzypp/zypp/repo/memory/RepoImpl.cc (added) +++ trunk/libzypp/zypp/repo/memory/RepoImpl.cc Wed Jun 13 18:24:34 2007 @@ -0,0 +1,83 @@ +/*---------------------------------------------------------------------\ +| ____ _ __ __ ___ | +| |__ / \ / / . \ . \ | +| / / \ V /| _/ _/ | +| / /__ | | | | | | | +| /_____||_| |_| |_| | +| | +\---------------------------------------------------------------------*/ + +#include <iostream> +#include <map> + +#include "zypp/base/Logger.h" +#include "zypp/base/Measure.h" +#include "zypp/capability/Capabilities.h" +#include "zypp/cache/ResolvableQuery.h" +#include "zypp/detail/ResImplTraits.h" +#include "zypp/CapFactory.h" + +#include "zypp/Package.h" +#include "zypp/Pattern.h" +#include "zypp/Patch.h" +#include "zypp/Message.h" +#include "zypp/Script.h" +#include "zypp/Atom.h" + +#include "zypp/repo/memory/RepoImpl.h" + +#include "zypp/repo/memory/PackageImpl.h" +#include "zypp/repo/memory/PatternImpl.h" +#include "zypp/repo/memory/PatchImpl.h" +#include "zypp/repo/memory/MessageImpl.h" +#include "zypp/repo/memory/ScriptImpl.h" +#include "zypp/repo/memory/AtomImpl.h" + +using namespace zypp::detail; +using namespace std; + +/////////////////////////////////////////////////////////////////// +namespace zypp +{ ///////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////// +namespace repo +{ ///////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////// +namespace memory +{ ///////////////////////////////////////////////////////////////// + +RepoImpl::RepoImpl( const RepoInfo &repoinfo ) + : RepositoryImpl(repoinfo) +{ + +} + +RepoImpl::~RepoImpl() +{ + +} + + +void RepoImpl::factoryInit() +{ + MIL << "in-memory repository initialized." << std::endl; +} + +void RepoImpl::createResolvables() +{ +} + +void RepoImpl::createPatchAndDeltas() +{ +} + +///////////////////////////////////////////////////////////////// +} // namespace memory +/////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////// +} // namespace repository +/////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////// +} // namespace zypp +/////////////////////////////////////////////////////////////////// + Added: trunk/libzypp/zypp/repo/memory/RepoImpl.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/memory/RepoImpl.h?rev=5744&view=auto ============================================================================== --- trunk/libzypp/zypp/repo/memory/RepoImpl.h (added) +++ trunk/libzypp/zypp/repo/memory/RepoImpl.h Wed Jun 13 18:24:34 2007 @@ -0,0 +1,70 @@ +/*---------------------------------------------------------------------\ +| ____ _ __ __ ___ | +| |__ / \ / / . \ . \ | +| / / \ V /| _/ _/ | +| / /__ | | | | | | | +| /_____||_| |_| |_| | +| | +\---------------------------------------------------------------------*/ + +#ifndef ZYPP_RepoImpl_H +#define ZYPP_RepoImpl_H + +#include <iosfwd> +#include <map> +#include <utility> +#include "zypp/Arch.h" +#include "zypp/Rel.h" +#include "zypp/Pathname.h" +#include "zypp/data/RecordId.h" +#include "zypp/repo/RepositoryImpl.h" +#include "zypp/ResStore.h" +#include "zypp/cache/sqlite3x/sqlite3x.hpp" +#include "zypp/cache/CacheTypes.h" +#include "zypp/cache/ResolvableQuery.h" +#include "zypp/RepoInfo.h" + +/////////////////////////////////////////////////////////////////// +namespace zypp +{ ///////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////// + namespace repo + { ///////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////// + namespace memory + { ///////////////////////////////////////////////////////////////// + + class RepoImpl : public repo::RepositoryImpl + { + public: + typedef intrusive_ptr<RepoImpl> Ptr; + typedef intrusive_ptr<const RepoImpl> constPtr; + + public: + /** Default ctor */ + RepoImpl( const RepoInfo &repoinfo); + /** Dtor */ + ~RepoImpl(); + void factoryInit(); + public: + + void createResolvables(); + void createPatchAndDeltas(); + protected: + }; + /////////////////////////////////////////////////////////////////// + + ///////////////////////////////////////////////////////////////// + } // namespace memory + /////////////////////////////////////////////////////////////////// + + using memory::RepoImpl; + + ///////////////////////////////////////////////////////////////// + } // namespace source + /////////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////// +} // namespace zypp +/////////////////////////////////////////////////////////////////// +#endif + Added: trunk/libzypp/zypp/repo/memory/ScriptImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/memory/ScriptImpl.cc?rev=5744&view=auto ============================================================================== --- trunk/libzypp/zypp/repo/memory/ScriptImpl.cc (added) +++ trunk/libzypp/zypp/repo/memory/ScriptImpl.cc Wed Jun 13 18:24:34 2007 @@ -0,0 +1,130 @@ +/*---------------------------------------------------------------------\ +| ____ _ __ __ ___ | +| |__ / \ / / . \ . \ | +| / / \ V /| _/ _/ | +| / /__ | | | | | | | +| /_____||_| |_| |_| | +| | +\---------------------------------------------------------------------*/ + +#include "zypp/TranslatedText.h" +#include "zypp/base/String.h" +#include "zypp/base/Logger.h" +#include "zypp/repo/RepositoryImpl.h" +#include "ScriptImpl.h" + + +using namespace std; +using namespace zypp::detail; +using namespace::zypp::repo; + +/////////////////////////////////////////////////////////////////// +namespace zypp { namespace repo { namespace memory { + +/////////////////////////////////////////////////////////////////// +// +// CLASS NAME : ScriptImpl +// +/////////////////////////////////////////////////////////////////// + +/** Default ctor +*/ +ScriptImpl::ScriptImpl (const data::RecordId &id, memory::RepoImpl::Ptr repository_r) + : _repository (repository_r), + _id(id) +{} + +Repository +ScriptImpl::repository() const +{ + return _repository->selfRepository(); +} + +/////////////////////////////////////////////////// +// ResObject Attributes +/////////////////////////////////////////////////// + +TranslatedText ScriptImpl::summary() +{ + return _summary; +} + +TranslatedText ScriptImpl::description() +{ + return _description; +} + +TranslatedText ScriptImpl::insnotify() +{ + return _insnotify; +} + +TranslatedText ScriptImpl::delnotify() +{ + return _delnotify; +} + +TranslatedText ScriptImpl::licenseToConfirm() +{ + return _license_to_confirm; +} + +Vendor ScriptImpl::vendor() +{ + return _vendor; +} + +ByteCount ScriptImpl::size() +{ + return _size; +} + +ByteCount ScriptImpl::archivesize() +{ + return _archivesize; +} + +bool ScriptImpl::installOnly() +{ + return _install_only; +} + +Date ScriptImpl::buildtime() +{ + return _buildtime; +} + +Date ScriptImpl::installtime() +{ + return _installtime; +} + +unsigned ScriptImpl::mediaNr() +{ + return _media_nr; +} + +////////////////////////////////////////// +// MESSAGE +///////////////////////////////////////// + +Pathname ScriptImpl::do_script() const +{ + return Pathname(); +} + +Pathname ScriptImpl::undo_script() const +{ + return Pathname(); +} + +bool ScriptImpl::undo_available() const +{ + return false; +} + + +///////////////////////////////////////////////////////////////// +} } } // namespace zypp::repo::memory +/////////////////////////////////////////////////////////////////// + Added: trunk/libzypp/zypp/repo/memory/ScriptImpl.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/repo/memory/ScriptImpl.h?rev=5744&view=auto ============================================================================== --- trunk/libzypp/zypp/repo/memory/ScriptImpl.h (added) +++ trunk/libzypp/zypp/repo/memory/ScriptImpl.h Wed Jun 13 18:24:34 2007 @@ -0,0 +1,79 @@ +/*---------------------------------------------------------------------\ +| ____ _ __ __ ___ | +| |__ / \ / / . \ . \ | +| / / \ V /| _/ _/ | +| / /__ | | | | | | | +| /_____||_| |_| |_| | +| | +\---------------------------------------------------------------------*/ + +#ifndef zypp_repo_memory_ScriptImpl_H +#define zypp_repo_memory_ScriptImpl_H + +#include "zypp/detail/ScriptImpl.h" +#include "zypp/repo/memory/RepoImpl.h" + +/////////////////////////////////////////////////////////////////// +namespace zypp +{ ///////////////////////////////////////////////////////////////// +namespace repo +{ ///////////////////////////////////////////////////////////////// +namespace memory +{ ///////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////// + // + // CLASS NAME : ScriptImpl + // + class ScriptImpl : public detail::ScriptImplIf + { + public: + + ScriptImpl( const data::RecordId &id, repo::memory::RepoImpl::Ptr repository_r ); + + virtual TranslatedText summary() const; + virtual TranslatedText description() const; + virtual TranslatedText insnotify() const; + virtual TranslatedText delnotify() const; + virtual TranslatedText licenseToConfirm() const; + virtual Vendor vendor() const; + virtual ByteCount size() const; + virtual ByteCount archivesize() const; + virtual bool installOnly() const; + virtual Date buildtime() const; + virtual Date installtime() const; + + virtual Source_Ref source() const; + virtual unsigned mediaNr() const; + + // SCRIPT + virtual Pathname do_script() const; + virtual Pathname undo_script() const; + virtual bool undo_available() const; + + virtual Repository repository() const; + + protected: + repo::memory::RepoImpl::Ptr _repository; + + //ResObject + TranslatedText _summary; + TranslatedText _description; + TranslatedText _insnotify; + TranslatedText _delnotify; + TranslatedText _license_to_confirm; + Vendor _vendor; + ByteCount _size; + ByteCount _archivesize; + bool _install_only; + Date _buildtime; + Date _installtime; + unsigned _media_nr; + }; + ///////////////////////////////////////////////////////////////// +} // namespace memory +} // namespace repository +} // namespace zypp +/////////////////////////////////////////////////////////////////// +#endif // ZMD_BACKEND_DBSOURCE_DBPACKAGEIMPL_H + -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org