Author: dmacvicar Date: Thu Jul 5 15:28:20 2007 New Revision: 5888 URL: http://svn.opensuse.org/viewcvs/zypp?rev=5888&view=rev Log: Package::location is now a OnMediaLocation archivesize -> downloadSize Package overloads it Modified: branches/REFACTORING-10_3/libzypp/zypp/OnMediaLocation.cc branches/REFACTORING-10_3/libzypp/zypp/OnMediaLocation.h branches/REFACTORING-10_3/libzypp/zypp/Package.cc branches/REFACTORING-10_3/libzypp/zypp/Package.h branches/REFACTORING-10_3/libzypp/zypp/ResObject.cc branches/REFACTORING-10_3/libzypp/zypp/ResObject.h branches/REFACTORING-10_3/libzypp/zypp/SrcPackage.cc branches/REFACTORING-10_3/libzypp/zypp/SrcPackage.h branches/REFACTORING-10_3/libzypp/zypp/cache/CacheAttributes.h branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.cc branches/REFACTORING-10_3/libzypp/zypp/data/ResolvableData.h branches/REFACTORING-10_3/libzypp/zypp/detail/PackageImplIf.cc branches/REFACTORING-10_3/libzypp/zypp/detail/PackageImplIf.h branches/REFACTORING-10_3/libzypp/zypp/detail/ResObjectImplIf.cc branches/REFACTORING-10_3/libzypp/zypp/detail/ResObjectImplIf.h branches/REFACTORING-10_3/libzypp/zypp/detail/SrcPackageImplIf.cc branches/REFACTORING-10_3/libzypp/zypp/detail/SrcPackageImplIf.h branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/PackagesFileReader.cc branches/REFACTORING-10_3/libzypp/zypp/parser/yum/FileReaderBaseImpl.cc branches/REFACTORING-10_3/libzypp/zypp/parser/yum/PatchFileReader.cc branches/REFACTORING-10_3/libzypp/zypp/repo/PackageProvider.cc branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.cc branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.h branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.cc branches/REFACTORING-10_3/libzypp/zypp/repo/memory/PackageImpl.cc branches/REFACTORING-10_3/libzypp/zypp/repo/memory/PackageImpl.h branches/REFACTORING-10_3/libzypp/zypp/repo/memory/SrcPackageImpl.cc branches/REFACTORING-10_3/libzypp/zypp/repo/memory/SrcPackageImpl.h branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmDb.cc branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmPackageImpl.cc branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmPackageImpl.h Modified: branches/REFACTORING-10_3/libzypp/zypp/OnMediaLocation.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/OnMediaLocation.cc?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/OnMediaLocation.cc (original) +++ branches/REFACTORING-10_3/libzypp/zypp/OnMediaLocation.cc Thu Jul 5 15:28:20 2007 @@ -28,7 +28,7 @@ std::ostream & operator<<( std::ostream & str, const OnMediaLocation & obj ) { return str << "[" << obj.medianr() << "]" << obj.filename() - << "{" << obj.downloadsize() << "|" << obj.checksum() << "}"; + << "{" << obj.downloadSize() << "|" << obj.checksum() << "}"; } ///////////////////////////////////////////////////////////////// Modified: branches/REFACTORING-10_3/libzypp/zypp/OnMediaLocation.h URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/OnMediaLocation.h?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/OnMediaLocation.h (original) +++ branches/REFACTORING-10_3/libzypp/zypp/OnMediaLocation.h Thu Jul 5 15:28:20 2007 @@ -43,22 +43,27 @@ {} public: - unsigned medianr() const { return _medianr; } - const Pathname & filename() const { return _filename; } - const CheckSum & checksum() const { return _checksum; } - const ByteCount & downloadsize() const { return _downloadsize; } + unsigned medianr() const { return _medianr; } + const Pathname & filename() const { return _filename; } + const CheckSum & checksum() const { return _checksum; } + const ByteCount & downloadSize() const { return _downloadsize; } + const ByteCount & gzDownloadSize() const { return _gzdownloadsize; } + const CheckSum & gzChecksum() const { return _gzchecksum; } public: - OnMediaLocation & setMedianr( unsigned val_r ) { _medianr = val_r; return *this; } - OnMediaLocation & setFilename( const Pathname & val_r ) { _filename = val_r; return *this; } - OnMediaLocation & setChecksum( const CheckSum & val_r ) { _checksum = val_r; return *this; } - OnMediaLocation & setDownloadsize( const ByteCount & val_r ) { _downloadsize = val_r; return *this; } - + OnMediaLocation & setMedianr( unsigned val_r ) { _medianr = val_r; return *this; } + OnMediaLocation & setFilename( const Pathname & val_r ) { _filename = val_r; return *this; } + OnMediaLocation & setChecksum( const CheckSum & val_r ) { _checksum = val_r; return *this; } + OnMediaLocation & setDownloadSize( const ByteCount & val_r ) { _downloadsize = val_r; return *this; } + OnMediaLocation & setGzChecksum( const CheckSum & val_r ) { _gzchecksum = val_r; return *this; } + OnMediaLocation & setGzDownloadSize( const ByteCount & val_r ) { _gzdownloadsize = val_r; return *this; } private: unsigned _medianr; Pathname _filename; CheckSum _checksum; ByteCount _downloadsize; + ByteCount _gzdownloadsize; + CheckSum _gzchecksum; }; /////////////////////////////////////////////////////////////////// Modified: branches/REFACTORING-10_3/libzypp/zypp/Package.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/Package.cc?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/Package.cc (original) +++ branches/REFACTORING-10_3/libzypp/zypp/Package.cc Thu Jul 5 15:28:20 2007 @@ -50,9 +50,6 @@ std::string Package::buildhost() const { return pimpl().buildhost(); } - CheckSum Package::checksum() const - { return pimpl().checksum(); } - /** */ std::string Package::distribution() const { return pimpl().distribution(); } @@ -112,9 +109,9 @@ std::liststd::string Package::filenames() const { return pimpl().filenames(); } - Pathname Package::location() const + OnMediaLocation Package::location() const { return pimpl().location(); } - + ///////////////////////////////////////////////////////////////// } // namespace zypp /////////////////////////////////////////////////////////////////// Modified: branches/REFACTORING-10_3/libzypp/zypp/Package.h URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/Package.h?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/Package.h (original) +++ branches/REFACTORING-10_3/libzypp/zypp/Package.h Thu Jul 5 15:28:20 2007 @@ -40,10 +40,7 @@ typedef std::set<PackageKeyword> Keywords; public: - /** - * Checksum the source says this package should have - */ - CheckSum checksum() const; + /** Get the package change log */ Changelog changelog() const; /** */ @@ -80,10 +77,19 @@ /** Disk usage per directory */ DiskUsage diskusage() const; - - /** location in source */ - Pathname location() const; - + + /** + * Checksum the source says this package should have + * \deprecated Use location().checksum() + */ + ZYPP_DEPRECATED CheckSum checksum() const + { return location().checksum(); } + + /** + * \short Location of the resolvable in the repository + */ + OnMediaLocation location() const; + protected: Package( const NVRAD & nvrad_r ); /** Dtor */ Modified: branches/REFACTORING-10_3/libzypp/zypp/ResObject.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/ResObject.cc?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/ResObject.cc (original) +++ branches/REFACTORING-10_3/libzypp/zypp/ResObject.cc Thu Jul 5 15:28:20 2007 @@ -75,12 +75,12 @@ ByteCount ResObject::size() const { return pimpl().size(); } - ByteCount ResObject::archivesize() const - { return pimpl().archivesize(); } - Repository ResObject::repository() const { return pimpl().repository(); } + ByteCount ResObject::downloadSize() const + { return pimpl().downloadSize(); } + unsigned ResObject::mediaNr() const { return pimpl().mediaNr(); } @@ -92,7 +92,7 @@ Date ResObject::installtime() const { return pimpl().installtime(); } - + ///////////////////////////////////////////////////////////////// } // namespace zypp /////////////////////////////////////////////////////////////////// Modified: branches/REFACTORING-10_3/libzypp/zypp/ResObject.h URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/ResObject.h?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/ResObject.h (original) +++ branches/REFACTORING-10_3/libzypp/zypp/ResObject.h Thu Jul 5 15:28:20 2007 @@ -20,6 +20,7 @@ #include "zypp/TranslatedText.h" #include "zypp/NeedAType.h" #include "zypp/Date.h" +#include "zypp/OnMediaLocation.h" /////////////////////////////////////////////////////////////////// namespace zypp @@ -97,9 +98,16 @@ ByteCount size() const; /** Size of the rpm package. */ - ByteCount archivesize() const; + ByteCount downloadSize() const; /** + * \short Download size + * \deprecated Use downloadSize() + */ + ZYPP_DEPRECATED ByteCount archivesize() const + { return downloadSize(); } + + /** * Source providing this resolvable */ Repository repository() const; Modified: branches/REFACTORING-10_3/libzypp/zypp/SrcPackage.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/SrcPackage.cc?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/SrcPackage.cc (original) +++ branches/REFACTORING-10_3/libzypp/zypp/SrcPackage.cc Thu Jul 5 15:28:20 2007 @@ -43,15 +43,13 @@ // /////////////////////////////////////////////////////////////////// - ByteCount SrcPackage::archivesize() const - { return pimpl().archivesize(); } - DiskUsage SrcPackage::diskusage() const { return pimpl().diskusage(); } - Pathname SrcPackage::location() const + OnMediaLocation SrcPackage::location() const { return pimpl().location(); } + ///////////////////////////////////////////////////////////////// } // namespace zypp /////////////////////////////////////////////////////////////////// Modified: branches/REFACTORING-10_3/libzypp/zypp/SrcPackage.h URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/SrcPackage.h?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/SrcPackage.h (original) +++ branches/REFACTORING-10_3/libzypp/zypp/SrcPackage.h Thu Jul 5 15:28:20 2007 @@ -38,13 +38,12 @@ typedef TraitsType::constPtrType constPtr; public: - /** */ - ByteCount archivesize() const; /** Disk usage per directory */ DiskUsage diskusage() const; - /** location in source */ - Pathname location() const; - + + /** location of resolvable in repo */ + OnMediaLocation location() const; + protected: SrcPackage( const NVRAD & nvrad_r ); /** Dtor */ Modified: branches/REFACTORING-10_3/libzypp/zypp/cache/CacheAttributes.h URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/cache/CacheAttributes.h?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/cache/CacheAttributes.h (original) +++ branches/REFACTORING-10_3/libzypp/zypp/cache/CacheAttributes.h Thu Jul 5 15:28:20 2007 @@ -31,19 +31,23 @@ /////////////////////////////////////////////////////////////////// inline const Attribute & attrPackageAuthors() { static Attribute a("Package","authors"); return a; } inline const Attribute & attrPackageBuildhost() { static Attribute a("Package","buildhost"); return a; } - inline const Attribute & attrPackageChecksum() { static Attribute a("Package","checksum"); return a; } inline const Attribute & attrPackageChecksumType() { static Attribute a("Package","checksumType"); return a; } inline const Attribute & attrPackageDistribution() { static Attribute a("Package","distribution"); return a; } inline const Attribute & attrPackageGroup() { static Attribute a("Package","group"); return a; } inline const Attribute & attrPackageKeywords() { static Attribute a("Package","keywords"); return a; } inline const Attribute & attrPackageLicense() { static Attribute a("Package","license"); return a; } - inline const Attribute & attrPackageLocation() { static Attribute a("Package","location"); return a; } inline const Attribute & attrPackageOperatingSystem() { static Attribute a("Package","operatingSystem"); return a; } inline const Attribute & attrPackagePostin() { static Attribute a("Package","postin"); return a; } inline const Attribute & attrPackagePostun() { static Attribute a("Package","postun"); return a; } inline const Attribute & attrPackagePrein() { static Attribute a("Package","prein"); return a; } inline const Attribute & attrPackagePreun() { static Attribute a("Package","preun"); return a; } inline const Attribute & attrPackageUrl() { static Attribute a("Package","url"); return a; } + inline const Attribute & attrPackageLocationFilename() { static Attribute a("Package","locationFilename"); return a; } + inline const Attribute & attrPackageLocationDownloadSize() { static Attribute a("Package","locationDownloadSize"); return a; } + inline const Attribute & attrPackageLocationChecksum() { static Attribute a("Package","locationChecksum"); return a; } + inline const Attribute & attrPackageLocationChecksumType() { static Attribute a("Package","locationChecksumType"); return a; } + inline const Attribute & attrPackageLocationMediaNr() { static Attribute a("Package","locationMediaNr"); return a; } + /////////////////////////////////////////////////////////////////// inline const Attribute & attrPatchAffectsPkgManager() { static Attribute a("Patch","affectsPkgManager"); return a; } inline const Attribute & attrPatchCategory() { static Attribute a("Patch","category"); return a; } @@ -76,6 +80,7 @@ inline const Attribute & attrResObjectLicenseToConfirm() { static Attribute a("ResObject","licenseToConfirm"); return a; } inline const Attribute & attrResObjectSummary() { static Attribute a("ResObject","summary"); return a; } inline const Attribute & attrResObjectVendor() { static Attribute a("ResObject","vendor"); return a; } + /////////////////////////////////////////////////////////////////// inline const Attribute & attrScriptDoScript() { static Attribute a("Script","doScript"); return a; } inline const Attribute & attrScriptDoScriptChecksum() { static Attribute a("Script","doScriptChecksum"); return a; } Modified: branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.cc?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.cc (original) +++ branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.cc Thu Jul 5 15:28:20 2007 @@ -217,8 +217,6 @@ void CacheStore::appendPackageBaseAttributes( const RecordId & pkgid, const data::Packagebase_Ptr & package ) { - appendStringAttribute( pkgid, attrPackageChecksum(), package->repositoryLocation.fileChecksum.checksum() ); - appendStringAttribute( pkgid, attrPackageChecksumType(), package->repositoryLocation.fileChecksum.type() ); appendStringAttribute( pkgid, attrPackageBuildhost(), package->buildhost ); appendStringAttribute( pkgid, attrPackageDistribution(), package->distribution ); appendStringAttribute( pkgid, attrPackageLicense(), package->license ); @@ -231,7 +229,12 @@ appendStringAttribute( pkgid, attrPackagePostun(), package->postun ); appendStringContainerAttribute( pkgid, attrPackageKeywords(), package->keywords.begin(), package->keywords.end() ); appendStringContainerAttribute( pkgid, attrPackageAuthors(), package->authors.begin(), package->authors.end() ); - appendStringAttribute( pkgid, attrPackageLocation(), package->repositoryLocation.filePath.asString() ); + + appendStringAttribute( pkgid, attrPackageLocationFilename(), package->repositoryLocation.filename().asString() ); + appendNumericAttribute( pkgid, attrPackageLocationMediaNr(), package->repositoryLocation.medianr() ); + appendNumericAttribute( pkgid, attrPackageLocationDownloadSize(), package->repositoryLocation.downloadSize() ); + appendStringAttribute( pkgid, attrPackageLocationChecksumType(), package->repositoryLocation.checksum().type() ); + appendStringAttribute( pkgid, attrPackageLocationChecksum(), package->repositoryLocation.checksum().checksum() ); } RecordId CacheStore::consumePackage( const RecordId & repository_id, @@ -346,13 +349,13 @@ appendResObjectAttributes( id, script ); appendStringAttribute( id, attrScriptDoScript(), script->doScript ); - appendStringAttribute( id, attrScriptDoScriptLocation(), script->doScriptLocation.filePath.asString() ); - appendStringAttribute( id, attrScriptDoScriptChecksum(), script->doScriptLocation.fileChecksum.checksum() ); - appendStringAttribute( id, attrScriptDoScriptChecksumType(), script->doScriptLocation.fileChecksum.type() ); + appendStringAttribute( id, attrScriptDoScriptLocation(), script->doScriptLocation.filename().asString() ); + appendStringAttribute( id, attrScriptDoScriptChecksum(), script->doScriptLocation.checksum().checksum() ); + appendStringAttribute( id, attrScriptDoScriptChecksumType(), script->doScriptLocation.checksum().type() ); appendStringAttribute( id, attrScriptUndoScript(), script->undoScript ); - appendStringAttribute( id, attrScriptUndoScriptLocation(), script->undoScriptLocation.filePath.asString() ); - appendStringAttribute( id, attrScriptUndoScriptChecksum(), script->undoScriptLocation.fileChecksum.checksum() ); - appendStringAttribute( id, attrScriptUndoScriptChecksumType(), script->undoScriptLocation.fileChecksum.type() ); + appendStringAttribute( id, attrScriptUndoScriptLocation(), script->undoScriptLocation.filename().asString() ); + appendStringAttribute( id, attrScriptUndoScriptChecksum(), script->undoScriptLocation.checksum().checksum() ); + appendStringAttribute( id, attrScriptUndoScriptChecksumType(), script->undoScriptLocation.checksum().type() ); return id; } @@ -615,10 +618,10 @@ //! \todo what's this? _pimpl->insert_patchrpm_cmd->bind(":media_nr", ???); _pimpl->insert_patchrpm_cmd->bind(":repository_id", repository_id); - _pimpl->insert_patchrpm_cmd->bind(":location", prpm->location.filePath.asString()); - _pimpl->insert_patchrpm_cmd->bind(":checksum", prpm->location.fileChecksum.checksum()); + _pimpl->insert_patchrpm_cmd->bind(":location", prpm->location.filename().asString()); + _pimpl->insert_patchrpm_cmd->bind(":checksum", prpm->location.checksum().checksum()); //! \todo checksum type - _pimpl->insert_patchrpm_cmd->bind(":download_size", static_castByteCount::SizeType(prpm->location.fileSize)); + _pimpl->insert_patchrpm_cmd->bind(":download_size", static_castByteCount::SizeType(prpm->location.downloadSize())); _pimpl->insert_patchrpm_cmd->bind(":build_time", prpm->buildTime.asSeconds()); _pimpl->insert_patchrpm_cmd->executenonquery(); @@ -645,10 +648,10 @@ //! \todo what's this? _pimpl->insert_deltarpm_cmd->bind(":media_nr", ???); _pimpl->insert_deltarpm_cmd->bind(":repository_id", repository_id); - _pimpl->insert_deltarpm_cmd->bind(":location", drpm->location.filePath.asString()); - _pimpl->insert_deltarpm_cmd->bind(":checksum", drpm->location.fileChecksum.checksum()); + _pimpl->insert_deltarpm_cmd->bind(":location", drpm->location.filename().asString()); + _pimpl->insert_deltarpm_cmd->bind(":checksum", drpm->location.checksum().checksum()); //! \todo checksum type - _pimpl->insert_deltarpm_cmd->bind(":download_size", static_castByteCount::SizeType(drpm->location.fileSize)); + _pimpl->insert_deltarpm_cmd->bind(":download_size", static_castByteCount::SizeType(drpm->location.downloadSize())); _pimpl->insert_deltarpm_cmd->bind(":build_time", drpm->buildTime.asSeconds()); _pimpl->insert_deltarpm_cmd->bind(":baseversion_version", drpm->baseVersion.edition.version()); Modified: branches/REFACTORING-10_3/libzypp/zypp/data/ResolvableData.h URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/data/ResolvableData.h?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/data/ResolvableData.h (original) +++ branches/REFACTORING-10_3/libzypp/zypp/data/ResolvableData.h Thu Jul 5 15:28:20 2007 @@ -31,6 +31,7 @@ #include "zypp/Url.h" #include "zypp/Date.h" #include "zypp/TranslatedText.h" +#include "zypp/OnMediaLocation.h" namespace zypp { @@ -44,29 +45,7 @@ /** List of files contained in a package (info for UI) */ typedef std::liststd::string Filenames; - - - /** Data to retrieve a file from some media. */ - struct Location - { - Location() - : fileSize( -1 ), gzSize( -1 ) - {} - - /** Media number (0==no media access required). */ - MediaNr mediaNr; - /** Path on the media. */ - Pathname filePath; - /** The uncompressed files size. */ - ByteCount fileSize; - /** The uncompressed files checksum. */ - CheckSum fileChecksum; - /** The compressed (gz) files size. */ - ByteCount gzSize; - /** The compressed (gz) files checksum. */ - CheckSum gzChecksum; - }; - + /////////////////////////////////////////////////////////////////// DEFINE_PTR_TYPE(Resolvable); @@ -129,7 +108,6 @@ // Repository related: /** Repository providing this resolvable. */ RecordId repository; - protected: /** Overload to realize std::ostream & operator\<\<. */ virtual std::ostream & dumpOn( std::ostream & str ) const; @@ -161,12 +139,12 @@ /** Inlined doScript. */ std::string doScript; /** Location of doScript on the repositories media. */ - Location doScriptLocation; + OnMediaLocation doScriptLocation; /** Inlined undoScript. */ std::string undoScript; /** Location of undoScript on the repositories media. */ - Location undoScriptLocation; + OnMediaLocation undoScriptLocation; }; /////////////////////////////////////////////////////////////////// @@ -182,8 +160,6 @@ /** Inlined Text. */ TranslatedText text; - /** Location od textfile on the repositories media. */ - //Location repositoryLoaction; }; /////////////////////////////////////////////////////////////////// @@ -306,9 +282,6 @@ virtual PackageType packageType() const = 0; public: - /** Location on the repositories media. */ - Location repositoryLocation; - /** Rpm group.*/ std::string group; /** PackageDb keywors (tags). */ @@ -342,6 +315,8 @@ std::string preun; /** Post uninstall script. */ std::string postun; + + OnMediaLocation repositoryLocation; }; DEFINE_PTR_TYPE(Package); @@ -391,7 +366,7 @@ // Shared RPM data - Location location; + OnMediaLocation location; Date buildTime; Date fileTime; ByteCount archiveSize; // ?? Modified: branches/REFACTORING-10_3/libzypp/zypp/detail/PackageImplIf.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/detail/PackageImplIf.cc?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/detail/PackageImplIf.cc (original) +++ branches/REFACTORING-10_3/libzypp/zypp/detail/PackageImplIf.cc Thu Jul 5 15:28:20 2007 @@ -26,9 +26,6 @@ // as far as resonable. ///////////////////////////////////////////////////////////////// - CheckSum PackageImplIf::checksum() const - { return CheckSum(); } - std::string PackageImplIf::buildhost() const { return std::string(); } @@ -50,9 +47,6 @@ Changelog PackageImplIf::changelog() const { return Changelog(); } - Pathname PackageImplIf::location() const - { return Pathname(); } - std::string PackageImplIf::url() const { return std::string(); } @@ -73,7 +67,13 @@ ByteCount PackageImplIf::sourcesize() const { return ByteCount(); } - + + ByteCount PackageImplIf::downloadSize() const + { return location().downloadSize(); } + + OnMediaLocation PackageImplIf::location() const + { return OnMediaLocation(); } + DiskUsage PackageImplIf::diskusage() const { return DiskUsage(); } Modified: branches/REFACTORING-10_3/libzypp/zypp/detail/PackageImplIf.h URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/detail/PackageImplIf.h?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/detail/PackageImplIf.h (original) +++ branches/REFACTORING-10_3/libzypp/zypp/detail/PackageImplIf.h Thu Jul 5 15:28:20 2007 @@ -53,8 +53,6 @@ /** \name Rpm Package Attributes. */ //@{ - virtual CheckSum checksum() const PURE_VIRTUAL; - /** */ virtual std::string buildhost() const PURE_VIRTUAL; /** */ virtual std::string distribution() const PURE_VIRTUAL; @@ -69,7 +67,6 @@ /** */ virtual Changelog changelog() const PURE_VIRTUAL; /** */ - virtual Pathname location() const PURE_VIRTUAL; /** Don't ship it as class Url, because it might be * in fact anything but a legal Url. */ virtual std::string url() const PURE_VIRTUAL; @@ -95,6 +92,10 @@ virtual std::list<DeltaRpm> deltaRpms() const PURE_VIRTUAL; /** */ virtual std::list<PatchRpm> patchRpms() const PURE_VIRTUAL; + + virtual ByteCount downloadSize() const PURE_VIRTUAL; + + virtual OnMediaLocation location() const PURE_VIRTUAL; //@} Modified: branches/REFACTORING-10_3/libzypp/zypp/detail/ResObjectImplIf.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/detail/ResObjectImplIf.cc?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/detail/ResObjectImplIf.cc (original) +++ branches/REFACTORING-10_3/libzypp/zypp/detail/ResObjectImplIf.cc Thu Jul 5 15:28:20 2007 @@ -42,18 +42,9 @@ Vendor ResObjectImplIf::vendor() const { return Vendor(); } - ByteCount ResObjectImplIf::size() const - { return ByteCount(); } - - ByteCount ResObjectImplIf::archivesize() const - { return ByteCount(); } - Repository ResObjectImplIf::repository() const { return Repository::noRepository; } - unsigned ResObjectImplIf::mediaNr() const - { return 0; } - bool ResObjectImplIf::installOnly() const { return false; } @@ -62,7 +53,16 @@ Date ResObjectImplIf::installtime() const { return Date(); } + + unsigned ResObjectImplIf::mediaNr() const + { return 0; } + + ByteCount ResObjectImplIf::size() const + { return ByteCount(); } + ByteCount ResObjectImplIf::downloadSize() const + { return ByteCount(); } + ///////////////////////////////////////////////////////////////// } // namespace detail /////////////////////////////////////////////////////////////////// Modified: branches/REFACTORING-10_3/libzypp/zypp/detail/ResObjectImplIf.h URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/detail/ResObjectImplIf.h?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/detail/ResObjectImplIf.h (original) +++ branches/REFACTORING-10_3/libzypp/zypp/detail/ResObjectImplIf.h Thu Jul 5 15:28:20 2007 @@ -81,7 +81,7 @@ virtual ByteCount size() const PURE_VIRTUAL; /** */ - virtual ByteCount archivesize() const PURE_VIRTUAL; + virtual ByteCount downloadSize() const PURE_VIRTUAL; /** Backlink to the source providing this. */ virtual Repository repository() const PURE_VIRTUAL; @@ -100,6 +100,7 @@ /** Time of installation, or \c 0 */ virtual Date installtime() const; + //@} public: Modified: branches/REFACTORING-10_3/libzypp/zypp/detail/SrcPackageImplIf.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/detail/SrcPackageImplIf.cc?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/detail/SrcPackageImplIf.cc (original) +++ branches/REFACTORING-10_3/libzypp/zypp/detail/SrcPackageImplIf.cc Thu Jul 5 15:28:20 2007 @@ -26,15 +26,15 @@ // as far as resonable. ///////////////////////////////////////////////////////////////// - ByteCount SrcPackageImplIf::archivesize() const - { return ByteCount(); } + OnMediaLocation SrcPackageImplIf::location() const + { return OnMediaLocation(); } + + ByteCount SrcPackageImplIf::downloadSize() const + { return location().downloadSize(); } DiskUsage SrcPackageImplIf::diskusage() const { return DiskUsage(); } - Pathname SrcPackageImplIf::location() const - { return Pathname(); } - ///////////////////////////////////////////////////////////////// } // namespace detail /////////////////////////////////////////////////////////////////// Modified: branches/REFACTORING-10_3/libzypp/zypp/detail/SrcPackageImplIf.h URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/detail/SrcPackageImplIf.h?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/detail/SrcPackageImplIf.h (original) +++ branches/REFACTORING-10_3/libzypp/zypp/detail/SrcPackageImplIf.h Thu Jul 5 15:28:20 2007 @@ -40,12 +40,12 @@ typedef SrcPackage ResType; public: + virtual OnMediaLocation location() const PURE_VIRTUAL; /** */ - virtual ByteCount archivesize() const PURE_VIRTUAL; + virtual ByteCount downloadSize() const PURE_VIRTUAL; /** */ virtual DiskUsage diskusage() const PURE_VIRTUAL; - /** */ - virtual Pathname location() const PURE_VIRTUAL; + }; /////////////////////////////////////////////////////////////////// Modified: branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/PackagesFileReader.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/PackagesFileReader.cc?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/PackagesFileReader.cc (original) +++ branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/PackagesFileReader.cc Thu Jul 5 15:28:20 2007 @@ -106,7 +106,7 @@ { ZYPP_THROW( error( tag_r, "Expected [type checksum]") ); } - _data->repositoryLocation.fileChecksum = CheckSum( words[0], words[1] ); + _data->repositoryLocation.setChecksum(CheckSum( words[0], words[1] )); } /** Consume =Grp:. */ @@ -157,16 +157,14 @@ switch ( str::split( tag_r->value, std::back_inserter(words) ) ) { case 2: // [medianr filename] - str::strtonum( words[0], _data->repositoryLocation.mediaNr.get() ); - _data->repositoryLocation.filePath = _data->arch.asString(); - _data->repositoryLocation.filePath /= words[1]; + _data->repositoryLocation.setMedianr( str::strtonum<unsigned>(words[0]) ); + _data->repositoryLocation.setFilename(_data->arch.asString() + words[1] ); break; case 3: // [medianr filename dir] - str::strtonum( words[0], _data->repositoryLocation.mediaNr.get() ); - _data->repositoryLocation.filePath = words[2]; - _data->repositoryLocation.filePath /= words[1]; - break; + _data->repositoryLocation.setMedianr( str::strtonum<unsigned>(words[0]) ); + _data->repositoryLocation.setFilename(words[2] + words[1] ); + break; default: ZYPP_THROW( error( tag_r, "Expected [medianr filename dir]") ); @@ -182,7 +180,7 @@ { ZYPP_THROW( error( tag_r, "Expected [archivesize size]") ); } - _data->repositoryLocation.fileSize = str::strtonumByteCount::SizeType( words[0] ); + _data->repositoryLocation.setDownloadSize(str::strtonumByteCount::SizeType( words[0] )); _data->installedSize = str::strtonumByteCount::SizeType( words[1] ); } Modified: branches/REFACTORING-10_3/libzypp/zypp/parser/yum/FileReaderBaseImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/parser/yum/FileReaderBaseImpl.cc?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/parser/yum/FileReaderBaseImpl.cc (original) +++ branches/REFACTORING-10_3/libzypp/zypp/parser/yum/FileReaderBaseImpl.cc Thu Jul 5 15:28:20 2007 @@ -87,9 +87,9 @@ // xpath: //package/checksum if (reader_r->name() == "checksum") { - package_ptr->repositoryLocation.fileChecksum = CheckSum( + package_ptr->repositoryLocation.setChecksum(CheckSum( reader_r->getAttribute("type").asString(), - reader_r.nodeText().asString()); + reader_r.nodeText().asString())); // ignoring pkgid attribute return true; } @@ -144,7 +144,7 @@ package_ptr->installedSize = str::strtonumByteCount::SizeType( reader_r->getAttribute("installed").asString() ); // rpm package size - package_ptr->repositoryLocation.fileSize = str::strtonumByteCount::SizeType( reader_r->getAttribute("package").asString() ); + package_ptr->repositoryLocation.setDownloadSize(str::strtonumByteCount::SizeType( reader_r->getAttribute("package").asString() )); return true; } @@ -152,7 +152,7 @@ // xpath: //package/location if (reader_r->name() == "location") { - package_ptr->repositoryLocation.filePath = reader_r->getAttribute("href").asString(); + package_ptr->repositoryLocation.setFilename(reader_r->getAttribute("href").asString()); return true; } Modified: branches/REFACTORING-10_3/libzypp/zypp/parser/yum/PatchFileReader.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/parser/yum/PatchFileReader.cc?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/parser/yum/PatchFileReader.cc (original) +++ branches/REFACTORING-10_3/libzypp/zypp/parser/yum/PatchFileReader.cc Thu Jul 5 15:28:20 2007 @@ -510,7 +510,7 @@ // xpath: /patch/atoms/package/patchrpm/location if (reader_r->name() == "location") { - _patchrpm->location.filePath = reader_r->getAttribute("href").asString(); + _patchrpm->location.setFilename(reader_r->getAttribute("href").asString()); // ignoring attribute 'base' return true; } @@ -518,9 +518,9 @@ // xpath: /patch/atoms/package/patchrpm/checksum if (reader_r->name() == "checksum") { - _patchrpm->location.fileChecksum = CheckSum( + _patchrpm->location.setChecksum(CheckSum( reader_r->getAttribute("type").asString(), - reader_r.nodeText().asString()); + reader_r.nodeText().asString())); return true; } @@ -540,8 +540,8 @@ if (reader_r->name() == "size") { // size of the rpm file - _patchrpm->location.fileSize = str::strtonumByteCount::SizeType( - reader_r->getAttribute("package").asString()); + _patchrpm->location.setDownloadSize(str::strtonumByteCount::SizeType( + reader_r->getAttribute("package").asString())); // size of ?? _patchrpm->archiveSize = str::strtonumByteCount::SizeType( @@ -586,7 +586,7 @@ // xpath: /patch/atoms/package/deltarpm/location if (reader_r->name() == "location") { - _deltarpm->location.filePath = reader_r->getAttribute("href").asString(); + _deltarpm->location.setFilename(reader_r->getAttribute("href").asString()); // ignoring attribute 'base' return true; } @@ -594,9 +594,9 @@ // xpath: /patch/atoms/package/deltarpm/checksum if (reader_r->name() == "checksum") { - _deltarpm->location.fileChecksum = CheckSum( + _deltarpm->location.setChecksum(CheckSum( reader_r->getAttribute("type").asString(), - reader_r.nodeText().asString()); + reader_r.nodeText().asString())); return true; } @@ -616,8 +616,8 @@ if (reader_r->name() == "size") { // size of the rpm file - _deltarpm->location.fileSize = str::strtonumByteCount::SizeType( - reader_r->getAttribute("package").asString()); + _deltarpm->location.setDownloadSize(str::strtonumByteCount::SizeType( + reader_r->getAttribute("package").asString())); // size of ?? _deltarpm->archiveSize = str::strtonumByteCount::SizeType( @@ -763,16 +763,16 @@ // ignoring reader_r->getAttribute("xml:base").asString(); // xsd:anyURI do script file path - script->doScriptLocation.filePath = reader_r->getAttribute("href").asString(); + script->doScriptLocation.setFilename(reader_r->getAttribute("href").asString()); return true; } // xpath: /patch/atoms/script/do-checksum if (reader_r->name() == "do-checksum") { - script->doScriptLocation.fileChecksum = CheckSum( + script->doScriptLocation.setChecksum(CheckSum( reader_r->getAttribute("type").asString(), - reader_r.nodeText().asString()); + reader_r.nodeText().asString())); return true; } @@ -783,16 +783,16 @@ // ignoring reader_r->getAttribute("xml:base").asString(); // xsd:anyURI undo script file path - script->undoScriptLocation.filePath = reader_r->getAttribute("href").asString(); + script->undoScriptLocation.setFilename(reader_r->getAttribute("href").asString()); return true; } // xpath: /patch/atoms/script/undo-checksum if (reader_r->name() == "undo-checksum") { - script->undoScriptLocation.fileChecksum = CheckSum( + script->undoScriptLocation.setChecksum(CheckSum( reader_r->getAttribute("type").asString(), - reader_r.nodeText().asString()); + reader_r.nodeText().asString())); return true; } } Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/PackageProvider.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/repo/PackageProvider.cc?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/repo/PackageProvider.cc (original) +++ branches/REFACTORING-10_3/libzypp/zypp/repo/PackageProvider.cc Thu Jul 5 15:28:20 2007 @@ -181,12 +181,8 @@ // no patch/delta -> provide full package ManagedFile ret; - OnMediaLocation loc; - loc.setMedianr( _package->mediaNr() ) - .setFilename( _package->location() ) - .setChecksum( _package->checksum() ) - .setDownloadsize( _package->archivesize() ); - + OnMediaLocation loc = _package->location(); + ProvideFilePolicy policy; policy.progressCB( bind( &PackageProvider::progressPackageDownload, this, _1 ) ); policy.failOnChecksumErrorCB( bind( &PackageProvider::failOnChecksumError, this ) ); @@ -204,7 +200,7 @@ return ManagedFile(); report()->startDeltaDownload( delta_r.location().filename(), - delta_r.location().downloadsize() ); + delta_r.location().downloadSize() ); ManagedFile delta; try { @@ -255,7 +251,7 @@ return ManagedFile(); report()->startPatchDownload( patch_r.location().filename(), - patch_r.location().downloadsize() ); + patch_r.location().downloadSize() ); ManagedFile patch; try { Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.cc?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.cc (original) +++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.cc Thu Jul 5 15:28:20 2007 @@ -105,16 +105,6 @@ return Date(); } -unsigned PackageImpl::mediaNr() const -{ - return 1; -} - -CheckSum PackageImpl::checksum() const -{ - return CheckSum(); -} - std::string PackageImpl::buildhost() const { return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageBuildhost() ); @@ -154,9 +144,16 @@ return Changelog(); } -Pathname PackageImpl::location() const +OnMediaLocation PackageImpl::location() const { - return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageLocation() ); + OnMediaLocation loc; + string chktype = _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageLocationChecksumType() ); + string chkvalue = _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageLocationChecksum() ); + loc.setChecksum(CheckSum(chktype, chkvalue)); + loc.setFilename( _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageLocationFilename() ) ); + loc.setDownloadSize( _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrPackageLocationDownloadSize() ) ); + loc.setMedianr( _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrPackageLocationMediaNr() ) ); + return loc; } std::string PackageImpl::url() const Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.h URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.h?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.h (original) +++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.h Thu Jul 5 15:28:20 2007 @@ -42,9 +42,9 @@ virtual bool installOnly() const; virtual Date buildtime() const; virtual Date installtime() const; - + virtual OnMediaLocation location() const; + // PACKAGE - virtual CheckSum checksum() const; virtual std::string buildhost() const; virtual std::string distribution() const; virtual Label license() const; @@ -52,7 +52,6 @@ virtual PackageGroup group() const; virtual Keywords keywords() const; virtual Changelog changelog() const; - virtual Pathname location() const; virtual std::string url() const; virtual std::string os() const; virtual Text prein() const; @@ -66,8 +65,6 @@ /*virtual std::list<DeltaRpm> deltaRpms() const; virtual std::list<PatchRpm> patchRpms() const; */ - virtual unsigned mediaNr() const; - virtual Repository repository() const; Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.cc?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.cc (original) +++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.cc Thu Jul 5 15:28:20 2007 @@ -222,7 +222,7 @@ continue; } on_media.setChecksum(checksum); - on_media.setDownloadsize(reader.getint(4)); + on_media.setDownloadSize(reader.getint(4)); packagedelta::DeltaRpm::BaseVersion baseversion; baseversion.setEdition( Edition(reader.getstring(6), reader.getstring(7), reader.getstring(8) ) ); @@ -270,7 +270,7 @@ continue; } on_media.setChecksum(checksum); - on_media.setDownloadsize(reader.getint(4)); + on_media.setDownloadSize(reader.getint(4)); zypp::packagedelta::PatchRpm patch; patch.setLocation( on_media ); Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/memory/PackageImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/repo/memory/PackageImpl.cc?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/repo/memory/PackageImpl.cc (original) +++ branches/REFACTORING-10_3/libzypp/zypp/repo/memory/PackageImpl.cc Thu Jul 5 15:28:20 2007 @@ -38,18 +38,15 @@ _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), + _location(ptr->repositoryLocation), _group(ptr->group), _keywords(), _authors(ptr->authors), _license(ptr->license), - _location(ptr->repositoryLocation.filePath), - _diskusage(), - _checksum(ptr->repositoryLocation.fileChecksum) + _diskusage() { } @@ -106,11 +103,6 @@ return _size; } -ByteCount PackageImpl::archivesize() const -{ - return _archivesize; -} - bool PackageImpl::installOnly() const { return _install_only; @@ -126,19 +118,14 @@ return _installtime; } -unsigned PackageImpl::mediaNr() const +OnMediaLocation PackageImpl::location() const { - return _media_nr; + return _location; } //////////////////////////////////////////////////// -CheckSum PackageImpl::checksum() const -{ - return _checksum; -} - string PackageImpl::buildhost() const { return string(); @@ -174,11 +161,6 @@ return Changelog(); } -Pathname PackageImpl::location() const -{ - return _location; -} - string PackageImpl::url() const { return string(); Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/memory/PackageImpl.h URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/repo/memory/PackageImpl.h?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/repo/memory/PackageImpl.h (original) +++ branches/REFACTORING-10_3/libzypp/zypp/repo/memory/PackageImpl.h Thu Jul 5 15:28:20 2007 @@ -44,13 +44,10 @@ 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 CheckSum checksum() const; + virtual std::string buildhost() const; virtual std::string distribution() const; virtual Label license() const; @@ -58,7 +55,7 @@ virtual PackageGroup group() const; virtual Keywords keywords() const; virtual Changelog changelog() const; - virtual Pathname location() const; + virtual OnMediaLocation location() const; virtual std::string url() const; virtual std::string os() const; virtual Text prein() const; @@ -84,15 +81,13 @@ bool _install_only; Date _buildtime; Date _installtime; - unsigned _media_nr; + OnMediaLocation _location; PackageGroup _group; Keywords _keywords; std::liststd::string _authors; Label _license; - Pathname _location; DiskUsage _diskusage; - CheckSum _checksum; private: }; /////////////////////////////////////////////////////////////////// Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/memory/SrcPackageImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/repo/memory/SrcPackageImpl.cc?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/repo/memory/SrcPackageImpl.cc (original) +++ branches/REFACTORING-10_3/libzypp/zypp/repo/memory/SrcPackageImpl.cc Thu Jul 5 15:28:20 2007 @@ -28,7 +28,6 @@ // METHOD TYPE : Ctor // SrcPackageImpl::SrcPackageImpl(data::SrcPackage_Ptr ptr) - : _media_number( 1 ) {} /////////////////////////////////////////////////////////////////// @@ -39,27 +38,11 @@ SrcPackageImpl::~SrcPackageImpl() {} - -Pathname SrcPackageImpl::location() const -{ - return _location; -} - -ByteCount SrcPackageImpl::archivesize() const -{ - return _archivesize; -} - DiskUsage SrcPackageImpl::diskusage() const { return _diskusage; } -unsigned SrcPackageImpl::sourceMediaNr() const -{ - return _media_number; -} - ///////////////////////////////////////////////////////////////// } // namespace memory /////////////////////////////////////////////////////////////////// Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/memory/SrcPackageImpl.h URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/repo/memory/SrcPackageImpl.h?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/repo/memory/SrcPackageImpl.h (original) +++ branches/REFACTORING-10_3/libzypp/zypp/repo/memory/SrcPackageImpl.h Thu Jul 5 15:28:20 2007 @@ -36,19 +36,9 @@ SrcPackageImpl(data::SrcPackage_Ptr ptr); virtual ~SrcPackageImpl(); - /** */ - virtual Pathname location() const; - /** */ - virtual ByteCount archivesize() const; - /** */ virtual DiskUsage diskusage() const; - /** */ - virtual unsigned sourceMediaNr() const; - private: - ByteCount _archivesize; - unsigned _media_number; - Pathname _location; + OnMediaLocation _location; DiskUsage _diskusage; }; /////////////////////////////////////////////////////////////////// Modified: branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmDb.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmDb.cc?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmDb.cc (original) +++ branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmDb.cc Thu Jul 5 15:28:20 2007 @@ -1140,7 +1140,7 @@ impl->setRepository( repo ); if (!location.empty()) - impl->setLocation( location ); + impl->setLocation( OnMediaLocation().setFilename(location) ); Edition edition; try Modified: branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmPackageImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmPackageImpl.cc?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmPackageImpl.cc (original) +++ branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmPackageImpl.cc Thu Jul 5 15:28:20 2007 @@ -52,12 +52,12 @@ _type("rpm"), // FIXME in the future _filenames(data->tag_filenames()), // _disk_usage(data->diskusage), - _size(data->tag_size()), - _archivesize(data->tag_archivesize()) + _size(data->tag_size()) { // we know we are reading english. _description.setText(data->tag_description(), Locale("en")); data->tag_du(_disk_usage); + _location.setDownloadSize(data->tag_archivesize()); } /** Package summary */ @@ -133,7 +133,7 @@ } /** */ -Pathname RPMPackageImpl::location() const +OnMediaLocation RPMPackageImpl::location() const { return _location; } @@ -188,12 +188,6 @@ } /** */ -ByteCount RPMPackageImpl::archivesize() const -{ - return _archivesize; -} - -/** */ std::liststd::string RPMPackageImpl::filenames() const { return _filenames; Modified: branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmPackageImpl.h URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmPackageImpl.h?rev=5888&r1=5887&r2=5888&view=diff ============================================================================== --- branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmPackageImpl.h (original) +++ branches/REFACTORING-10_3/libzypp/zypp/target/rpm/RpmPackageImpl.h Thu Jul 5 15:28:20 2007 @@ -64,8 +64,7 @@ virtual PackageGroup group() const; /** */ virtual Changelog changelog() const; - /** */ - virtual Pathname location() const; + /** Don't ship it as class Url, because it might be * in fact anything but a legal Url. */ virtual std::string url() const; @@ -82,8 +81,6 @@ /** */ virtual ByteCount sourcesize() const; /** */ - virtual ByteCount archivesize() const; - /** */ virtual std::liststd::string filenames() const; /** */ virtual std::string type() const; @@ -93,10 +90,13 @@ virtual Repository repository() const; /** for 'local' RPMs */ - void setLocation (const Pathname & pathname) + void setLocation (const OnMediaLocation &loc) { - _location = pathname; + _location = loc; } + + OnMediaLocation location() const; + void setRepository (Repository repo) { _repository = repo; @@ -114,13 +114,12 @@ std::string _packager; PackageGroup _group; Changelog _changelog; - Pathname _location; // for 'local' rpms std::string _type; std::liststd::string _filenames; DiskUsage _disk_usage; ByteCount _size; - ByteCount _archivesize; Repository _repository; + OnMediaLocation _location; }; /////////////////////////////////////////////////////////////////// } // namespace rpm -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org