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
)
CREATE TABLE db_info (
version INTEGER
);
-
+--INSERT INTO db_info (version) VALUES ('
------------------------------------------------
-- Basic types like archs, attributes, languages
------------------------------------------------
, baseversion_checksum TEXT
, baseversion_build_time INTEGER
, baseversion_sequence_info TEXT
-
+ , repository_id INTEGER REFERENCES repositories(id)
);
CREATE TABLE patch_packages (
, checksum TEXT
, download_size INTEGER
, build_time INTEGER
-
+ , repository_id INTEGER REFERENCES repositories(id)
);
CREATE TABLE patch_packages_baseversions (
, version TEXT
, release TEXT
, epoch INTEGER
-
);
------------------------------------------------
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/source/PackageProvider.cc
+ *
+*/
+#include <iostream>
+#include <sstream>
+#include "zypp/base/Logger.h"
+#include "zypp/base/Gettext.h"
+
+#include "zypp/Source.h"
+#include "zypp/source/PackageProvider.h"
+#include "zypp/source/SourceProvideFile.h"
+#include "zypp/source/Applydeltarpm.h"
+#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
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace source
+ { /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : PackageProviderPolicy
+ //
+ ///////////////////////////////////////////////////////////////////
+
+ bool PackageProviderPolicy::queryInstalled( const std::string & name_r,
+ const Edition & ed_r,
+ const Arch & arch_r ) const
+ {
+ if ( _queryInstalledCB )
+ return _queryInstalledCB( name_r, ed_r, arch_r );
+ return false;
+ }
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : PackageProvider
+ //
+ ///////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ namespace
+ { /////////////////////////////////////////////////////////////////
+
+ inline std::string defRpmFileName( const Package::constPtr & package )
+ {
+ std::ostringstream ret;
+ ret << package->name() << '-' << package->edition() << '.' << package->arch() << ".rpm";
+ return ret.str();
+ }
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace source
+ ///////////////////////////////////////////////////////////////////
+ PackageProvider::PackageProvider( const Package::constPtr & package,
+ const PackageProviderPolicy & policy_r )
+ : _policy( policy_r )
+ , _package( package )
+ , _implPtr( detail::ImplConnect::resimpl( _package ) )
+ {}
+
+ PackageProvider::~PackageProvider()
+ {}
+
+ 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, url );
+ try // ELIMINATE try/catch by providing a log-guard
+ {
+ ret = doProvidePackage();
+ }
+ catch ( const Exception & excpt )
+ {
+ ERR << "Failed to provide Package " << _package << endl;
+ if ( ! _retry )
+ {
+ ZYPP_RETHROW( excpt );
+ }
+ }
+ } while ( _retry );
+
+ report()->finish( _package, source::DownloadResolvableReport::NO_ERROR, std::string() );
+ MIL << "provided Package " << _package << " at " << ret << endl;
+ return ret;
+ }
+
+ 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 ( MediaManager::downloads(url) )
+ {
+ std::list<DeltaRpm> deltaRpms( _implPtr->deltaRpms() );
+ std::list<PatchRpm> patchRpms( _implPtr->patchRpms() );
+
+ if ( ! ( deltaRpms.empty() && patchRpms.empty() )
+ && queryInstalled() )
+ {
+ if ( ! deltaRpms.empty() && applydeltarpm::haveApplydeltarpm() )
+ {
+ for( std::list<DeltaRpm>::const_iterator it = deltaRpms.begin();
+ it != deltaRpms.end(); ++it )
+ {
+ DBG << "tryDelta " << *it << endl;
+ ManagedFile ret( tryDelta( *it ) );
+ if ( ! ret->empty() )
+ return ret;
+ }
+ }
+
+ if ( ! patchRpms.empty() )
+ {
+ for( std::list<PatchRpm>::const_iterator it = patchRpms.begin();
+ it != patchRpms.end(); ++it )
+ {
+ DBG << "tryPatch " << *it << endl;
+ ManagedFile ret( tryPatch( *it ) );
+ if ( ! ret->empty() )
+ return ret;
+ }
+ }
+ }
+ }
+ else
+ {
+ // allow patch rpm from local source
+ std::list<PatchRpm> patchRpms( _implPtr->patchRpms() );
+ if ( ! patchRpms.empty() && queryInstalled() )
+ {
+ for( std::list<PatchRpm>::const_iterator it = patchRpms.begin();
+ it != patchRpms.end(); ++it )
+ {
+ DBG << "tryPatch " << *it << endl;
+ ManagedFile ret( tryPatch( *it ) );
+ if ( ! ret->empty() )
+ return ret;
+ }
+ }
+ }
+
+ // no patch/delta -> provide full package
+ ManagedFile ret;
+ OnMediaLocation loc;
+ loc.medianr( _package->mediaNr() )
+ .filename( _package->location() )
+ .checksum( _package->checksum() )
+ .downloadsize( _package->archivesize() );
+
+ ProvideFilePolicy policy;
+ policy.progressCB( bind( &PackageProvider::progressPackageDownload, this, _1 ) );
+ policy.failOnChecksumErrorCB( bind( &PackageProvider::failOnChecksumError, this ) );
+
+ return source::provideFile( url, loc, policy );
+ }
+
+ ManagedFile PackageProvider::tryDelta( const DeltaRpm & delta_r ) const
+ {
+ if ( delta_r.baseversion().edition() != Edition::noedition
+ && ! queryInstalled( delta_r.baseversion().edition() ) )
+ return ManagedFile();
+
+ if ( ! applydeltarpm::quickcheck( delta_r.baseversion().sequenceinfo() ) )
+ return ManagedFile();
+
+ report()->startDeltaDownload( delta_r.location().filename(),
+ delta_r.location().downloadsize() );
+ ManagedFile delta;
+ try
+ {
+ ProvideFilePolicy policy;
+ policy.progressCB( bind( &PackageProvider::progressDeltaDownload, this, _1 ) );
+ delta = source::provideFile( Url(), delta_r.location(), policy );
+ }
+ catch ( const Exception & excpt )
+ {
+ report()->problemDeltaDownload( excpt.asUserString() );
+ return ManagedFile();
+ }
+ report()->finishDeltaDownload();
+
+ report()->startDeltaApply( delta );
+ if ( ! applydeltarpm::check( delta_r.baseversion().sequenceinfo() ) )
+ {
+ report()->problemDeltaApply( _("applydeltarpm check failed.") );
+ return ManagedFile();
+ }
+
+ Pathname destination( Pathname::dirname( delta ) / defRpmFileName( _package ) );
+ /* just to ease testing with non remote sources */
+ if ( ! _package->source().remote() )
+ destination = Pathname("/tmp") / defRpmFileName( _package );
+ /**/
+
+ if ( ! applydeltarpm::provide( delta, destination,
+ bind( &PackageProvider::progressDeltaApply, this, _1 ) ) )
+ {
+ report()->problemDeltaApply( _("applydeltarpm failed.") );
+ return ManagedFile();
+ }
+ report()->finishDeltaApply();
+
+ return ManagedFile( destination, filesystem::unlink );
+ }
+
+ ManagedFile PackageProvider::tryPatch( const PatchRpm & patch_r ) const
+ {
+ // installed edition is in baseversions?
+ const PatchRpm::BaseVersions & baseversions( patch_r.baseversions() );
+
+ if ( std::find_if( baseversions.begin(), baseversions.end(),
+ bind( &PackageProvider::queryInstalled, this, _1 ) )
+ == baseversions.end() )
+ return ManagedFile();
+
+ report()->startPatchDownload( patch_r.location().filename(),
+ patch_r.location().downloadsize() );
+ ManagedFile patch;
+ try
+ {
+ ProvideFilePolicy policy;
+ policy.progressCB( bind( &PackageProvider::progressPatchDownload, this, _1 ) );
+ patch = source::provideFile( Url(), patch_r.location(), policy );
+ }
+ catch ( const Exception & excpt )
+ {
+ report()->problemPatchDownload( excpt.asUserString() );
+ return ManagedFile();
+ }
+ report()->finishPatchDownload();
+
+ return patch;
+ }
+
+ PackageProvider::ScopedGuard PackageProvider::newReport() const
+ {
+ _report.reset( new Report );
+ return shared_ptr<void>( static_cast<void*>(0),
+ // custom deleter calling _report.reset()
+ // (cast required as reset is overloaded)
+ bind( mem_fun_ref( static_cast<void (shared_ptr<Report>::*)()>(&shared_ptr<Report>::reset) ),
+ ref(_report) ) );
+ }
+
+ PackageProvider::Report & PackageProvider::report() const
+ { return *_report; }
+
+ bool PackageProvider::progressDeltaDownload( int value ) const
+ { return report()->progressDeltaDownload( value ); }
+
+ void PackageProvider::progressDeltaApply( int value ) const
+ { return report()->progressDeltaApply( value ); }
+
+ bool PackageProvider::progressPatchDownload( int value ) const
+ { return report()->progressPatchDownload( value ); }
+
+ bool PackageProvider::progressPackageDownload( int value ) const
+ { return report()->progress( value, _package ); }
+
+ bool PackageProvider::failOnChecksumError() const
+ {
+ std::string package_str = _package->name() + "-" + _package->edition().asString();
+
+ // TranslatorExplanation %s = package being checked for integrity
+ switch ( report()->problem( _package, source::DownloadResolvableReport::INVALID, str::form(_("Package %s fails integrity check. Do you want to retry?"), package_str.c_str() ) ) )
+ {
+ case source::DownloadResolvableReport::RETRY:
+ _retry = true;
+ break;
+ case source::DownloadResolvableReport::IGNORE:
+ ZYPP_THROW(source::SkipRequestedException("User requested skip of corrupted file"));
+ break;
+ default:
+ break;
+ }
+ return true; // anyway a failure
+ }
+
+ bool PackageProvider::queryInstalled( const Edition & ed_r ) const
+ { return _policy.queryInstalled( _package->name(), ed_r, _package->arch() ); }
+
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace source
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/source/PackageProvider.h
+ *
+*/
+#ifndef ZYPP_SOURCE_PACKAGEPROVIDER_H
+#define ZYPP_SOURCE_PACKAGEPROVIDER_H
+
+#include <iosfwd>
+
+#include "zypp/base/NonCopyable.h"
+
+#include "zypp/ZYppCallbacks.h"
+#include "zypp/Source.h"
+#include "zypp/Package.h"
+#include "zypp/ManagedFile.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace source
+ { /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : PackageProviderPolicy
+ //
+ /** */
+ class PackageProviderPolicy
+ {
+ public:
+ /** Get installed Editions callback signature. */
+ typedef function<bool ( const std::string &, const Edition &, const Arch & )> QueryInstalledCB;
+
+ /** Set callback. */
+ PackageProviderPolicy & queryInstalledCB( QueryInstalledCB queryInstalledCB_r )
+ { _queryInstalledCB = queryInstalledCB_r; return *this; }
+
+ /** Evaluate callback. */
+ bool queryInstalled( const std::string & name_r,
+ const Edition & ed_r,
+ const Arch & arch_r ) const;
+
+ private:
+ QueryInstalledCB _queryInstalledCB;
+ };
+ ///////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : PackageProvider
+ //
+ /** Provide a package from a Source.
+ * Use available delta/patch-rpm if apropriate.
+ */
+ class PackageProvider : private base::NonCopyable
+ {
+ typedef shared_ptr<void> ScopedGuard;
+ typedef callback::SendReport<source::DownloadResolvableReport> Report;
+
+ typedef detail::ResImplTraits<Package::Impl>::constPtr PackageImpl_constPtr;
+ typedef packagedelta::DeltaRpm DeltaRpm;
+ typedef packagedelta::PatchRpm PatchRpm;
+
+
+ public:
+ /** Ctor taking the Package to provide. */
+ PackageProvider( const Package::constPtr & package,
+ const PackageProviderPolicy & policy_r = PackageProviderPolicy() );
+ ~PackageProvider();
+
+ public:
+ /** Provide the package.
+ * \throws Exception.
+ */
+ ManagedFile providePackage() const;
+
+ private:
+ ManagedFile doProvidePackage() const;
+ ManagedFile tryDelta( const DeltaRpm & delta_r ) const;
+ ManagedFile tryPatch( const PatchRpm & patch_r ) const;
+
+ private:
+ ScopedGuard newReport() const;
+ Report & report() const;
+ bool progressDeltaDownload( int value ) const;
+ void progressDeltaApply( int value ) const;
+ bool progressPatchDownload( int value ) const;
+ bool progressPackageDownload( int value ) const;
+ bool failOnChecksumError() const;
+ bool queryInstalled( const Edition & ed_r = Edition() ) const;
+
+ private:
+ PackageProviderPolicy _policy;
+ Package::constPtr _package;
+ PackageImpl_constPtr _implPtr;
+ mutable bool _retry;
+ mutable shared_ptr<Report> _report;
+
+ };
+ ///////////////////////////////////////////////////////////////////
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace source
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_SOURCE_PACKAGEPROVIDER_H
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ 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
+///////////////////////////////////////////////////////////////////
+
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ 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
+
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ 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
+///////////////////////////////////////////////////////////////////
+
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ 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
+
// 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)
{
}
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
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;
return list<string>();
}
-list<detail::PackageImplIf::DeltaRpm> PackageImpl::deltaRpms() const
-{
- return detail::PackageImplIf::deltaRpms();
-}
-
-list<detail::PackageImplIf::PatchRpm> PackageImpl::patchRpms() const
-{
- return detail::PackageImplIf::patchRpms();
-}
-
-bool PackageImpl::installOnly() const
-{
- return false;
-}
-
/////////////////////////////////////////////////////////////////
} // namespace memory
///////////////////////////////////////////////////////////////////
#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
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;
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::list<std::string> authors() const;
virtual std::list<std::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::list<std::string> _authors;
- ByteCount _size;
- ByteCount _archivesize;
- Vendor _vendor;
Label _license;
- Date _buildtime;
- unsigned _media_number;
Pathname _location;
DiskUsage _diskusage;
CheckSum _checksum;
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ 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
+///////////////////////////////////////////////////////////////////
+
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ 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
+
// 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)
+{
+
+}
///////////////////////////////////////////////////////////////////
//
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;
}
*/
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;
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ 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
+///////////////////////////////////////////////////////////////////
+
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ 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
+
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ 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
+///////////////////////////////////////////////////////////////////
+
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ 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
+