From 88352cd46937e2354392a585ac3abad1cb1322ba Mon Sep 17 00:00:00 2001 From: Michael Andres Date: Thu, 20 Mar 2008 17:58:21 +0000 Subject: [PATCH] backup while cleaning up --- zypp/CMakeLists.txt | 2 +- zypp/NeedAType.h | 80 ------------------------------ zypp/Package.cc | 28 ++--------- zypp/Package.h | 39 ++++++++------- zypp/Pattern.cc | 14 +++--- zypp/Pattern.h | 7 +-- zypp/Product.cc | 23 +++++---- zypp/Product.h | 11 ++-- zypp/Repository.h | 19 +++---- zypp/ResObject.cc | 30 ++++++----- zypp/ResObject.h | 21 +++++--- zypp/Vendor.h | 29 +++++++++++ zypp/VendorAttr.h | 4 +- zypp/sat/SolvAttr.cc | 64 ++++++++++++++---------- zypp/sat/SolvAttr.h | 26 ++++++---- zypp/sat/Solvable.cc | 8 ++- zypp/sat/Solvable.h | 18 +++++-- zypp/target/CommitPackageCacheReadAhead.cc | 2 +- zypp/ui/PatternContentsImpl.cc | 4 +- zypp/ui/UserWantedPackages.cc | 3 +- 20 files changed, 204 insertions(+), 228 deletions(-) delete mode 100644 zypp/NeedAType.h create mode 100644 zypp/Vendor.h diff --git a/zypp/CMakeLists.txt b/zypp/CMakeLists.txt index 1a05660..4396b1e 100644 --- a/zypp/CMakeLists.txt +++ b/zypp/CMakeLists.txt @@ -121,7 +121,7 @@ SET( zypp_HEADERS MediaSetAccess.h Message.h NameKindProxy.h - NeedAType.h + Vendor.h NVRAD.h NVRA.h NVR.h diff --git a/zypp/NeedAType.h b/zypp/NeedAType.h deleted file mode 100644 index bbb6aee..0000000 --- a/zypp/NeedAType.h +++ /dev/null @@ -1,80 +0,0 @@ -/*---------------------------------------------------------------------\ -| ____ _ __ __ ___ | -| |__ / \ / / . \ . \ | -| / / \ V /| _/ _/ | -| / /__ | | | | | | | -| /_____||_| |_| |_| | -| | -\---------------------------------------------------------------------*/ -/** \file zypp/NeedAType.h - * -*/ -#ifndef ZYPP_NEEDATYPE_H -#define ZYPP_NEEDATYPE_H - -#include -#include -#include -#include -#include "zypp/Locale.h" - -/////////////////////////////////////////////////////////////////// -namespace zypp -{ ///////////////////////////////////////////////////////////////// - /** \defgroup NEEDATYPE Wishlist of types - - Whenever you find something that might be worth being a - type, and not just an \c unsigned or \c string. Keep it here. - - Start with a reasonable \c typedef or \c class draft, so you - can start using the type within the implementation. If you're - in need for interface methods, add them to the draft. Think about - the interface and expected behaviour, but implement \b here just - as much as you actually need. - - Goal is to provide a real class for it, or to find out that a - typedef is sufficient, or the type is not needed anyway. - - If you already implemented something which would fit into this - group, but don't want to move it here, put doxygens - \code \ingroup NEEDATYPE \endcode tag in it's comment. So it will - at least appear in the doc. - - \note Don't put stuff here, that's (almost) ready to use. This is - not meant to be a convenience include. Goal is to have this file empty. - */ - //@{ - - - /** Single line of (human readable) text. - probably sufficient as typedef. we may use it to classify the - various strings and string lists within resolvable and other classes. - More a hint to the UI describing the purpose of the string. */ - typedef std::string Label; - - /** Single line of (human readable) text. See Label. A description would - Text, while a a packages file list would be list */ - typedef std::string Text; - - /** Offer a License text and methods to remember confirmation. */ - typedef std::string License; - - /** An rpm package group value. Also provide access to a - * (singleton) tree like group hierarchy which contains - * all existing groups. No more need to fiddle with YStringTreeItem - * classes and forgetting to add parsed groups there for use in the UI. - * PackageGroup can be selforganizing. - */ - typedef std::string PackageGroup; - - /** Candidate for string unification? */ - typedef std::list PackageKeywords; - - /** Vendor. Worth a typedef. Maybe a class unifying the strings. */ - typedef std::string Vendor; - - //@} - ///////////////////////////////////////////////////////////////// -} // namespace zypp -/////////////////////////////////////////////////////////////////// -#endif // ZYPP_NEEDATYPE_H diff --git a/zypp/Package.cc b/zypp/Package.cc index 2bd0966..0674ead 100644 --- a/zypp/Package.cc +++ b/zypp/Package.cc @@ -55,15 +55,15 @@ namespace zypp { return lookupStrAttribute( sat::SolvAttr::distribution ); } /** */ - Label Package::license() const - { return lookupStrAttribute( sat::SolvAttr::eula ); } + std::string Package::license() const + { return lookupStrAttribute( sat::SolvAttr::license ); } /** */ std::string Package::packager() const { return lookupStrAttribute( sat::SolvAttr::packager ); } /** */ - PackageGroup Package::group() const + std::string Package::group() const { return lookupStrAttribute( sat::SolvAttr::group ); } #warning DUMMY keywords @@ -77,28 +77,8 @@ namespace zypp { return string(); } /** */ - std::string Package::os() const - { return lookupStrAttribute( sat::SolvAttr::os ); } - - /** */ - Text Package::prein() const - { return lookupStrAttribute( sat::SolvAttr::prein); } - - /** */ - Text Package::postin() const - { return lookupStrAttribute( sat::SolvAttr::postin); } - - /** */ - Text Package::preun() const - { return lookupStrAttribute( sat::SolvAttr::preun); } - - /** */ - Text Package::postun() const - { return lookupStrAttribute( sat::SolvAttr::postun); } - - /** */ ByteCount Package::sourcesize() const - { return lookupNumAttribute( sat::SolvAttr::sourcesize); } + { return lookupNumAttribute( sat::SolvAttr::sourcesize ); } /** */ #warning DUMMY authors diff --git a/zypp/Package.h b/zypp/Package.h index 4e6b8e5..cb56846 100644 --- a/zypp/Package.h +++ b/zypp/Package.h @@ -48,27 +48,17 @@ namespace zypp /** */ std::string distribution() const; /** */ - Label license() const; + std::string license() const; /** */ std::string packager() const; /** */ - PackageGroup group() const; + std::string group() const; /** */ Keywords keywords() const; /** Don't ship it as class Url, because it might be * in fact anything but a legal Url. */ std::string url() const; - /** */ - std::string os() const; - /** */ - Text prein() const; - /** */ - Text postin() const; - /** */ - Text preun() const; - /** */ - Text postun() const; - /** */ + /** Size of corresponding the source package. */ ByteCount sourcesize() const; /** */ std::list authors() const; @@ -86,17 +76,30 @@ namespace zypp Edition sourcePkgEdition() const; /** - * Checksum the source says this package should have - * \deprecated Use location().checksum() + * Checksum the source says this package should have. + * \see \ref location */ - ZYPP_DEPRECATED CheckSum checksum() const + CheckSum checksum() const { return location().checksum(); } - /** - * \short Location of the resolvable in the repository + /** Location of the resolvable in the repository. + * \ref OnMediaLocation conatins all information required to + * retrieve the packge (url, checksum, etc.). */ OnMediaLocation location() const; + + /** \deprecated no metadata always empty */ + ZYPP_DEPRECATED std::string os() const { return std::string(); } + /** \deprecated no metadata always empty */ + ZYPP_DEPRECATED std::string prein() const { return std::string(); } + /** \deprecated no metadata always empty */ + ZYPP_DEPRECATED std::string postin() const { return std::string(); } + /** \deprecated no metadata always empty */ + ZYPP_DEPRECATED std::string preun() const { return std::string(); } + /** \deprecated no metadata always empty */ + ZYPP_DEPRECATED std::string postun() const { return std::string(); } + protected: friend Ptr make( const sat::Solvable & solvable_r ); /** Ctor */ diff --git a/zypp/Pattern.cc b/zypp/Pattern.cc index e6d3dd2..680f9e9 100644 --- a/zypp/Pattern.cc +++ b/zypp/Pattern.cc @@ -48,8 +48,8 @@ namespace zypp bool Pattern::userVisible() const { return lookupBoolAttribute( sat::SolvAttr::isvisible ); } /** */ - std::string Pattern::category() const - { return lookupStrAttribute( sat::SolvAttr::category ); } + std::string Pattern::category( const Locale & lang_r ) const + { return lookupStrAttribute( sat::SolvAttr::category, lang_r ); } /** */ Pathname Pattern::icon() const { return lookupStrAttribute( sat::SolvAttr::icon ); } @@ -57,13 +57,13 @@ namespace zypp Pathname Pattern::script() const { return lookupStrAttribute( sat::SolvAttr::script ); } - Label Pattern::order() const - { return Label(); } + std::string Pattern::order() const + { return lookupStrAttribute( sat::SolvAttr::order ); } - std::set Pattern::install_packages( const Locale & lang ) const - { #warning implement PATTERN::INSTALL_PACKAGES #if 0 + std::set Pattern::install_packages( const Locale & lang ) const + { - static void copycaps( std::set & out, const CapSet & in) - { - for (CapSet::const_iterator it = in.begin(); it != in.end(); ++it) { @@ -87,9 +87,9 @@ namespace zypp - } - - -#endif return std::set(); } +#endif #warning implement PATTERN::INSTALL_PACKAGES const Capabilities & Pattern::includes() const diff --git a/zypp/Pattern.h b/zypp/Pattern.h index 9f68c32..29277c8 100644 --- a/zypp/Pattern.h +++ b/zypp/Pattern.h @@ -41,16 +41,13 @@ namespace zypp /** */ bool userVisible() const; /** */ - std::string category() const; + std::string category( const Locale & lang_r = Locale() ) const; /** */ Pathname icon() const; /** */ Pathname script() const; /** */ - Label order() const; - - /** \deprecated AFAIK unused old Selection interface method. */ - std::set install_packages( const Locale & lang = Locale("") ) const ZYPP_DEPRECATED; + std::string order() const; /** Ui hint. */ const Capabilities & includes() const; diff --git a/zypp/Product.cc b/zypp/Product.cc index 95ef147..3fdb728 100644 --- a/zypp/Product.cc +++ b/zypp/Product.cc @@ -40,39 +40,42 @@ namespace zypp // Package interface forwarded to implementation // /////////////////////////////////////////////////////////////////// - +#warning DUMMY type std::string Product::type() const { return std::string(); } - Label Product::vendor() const - { return Label(); } - +#warning DUMMY releaseNotesUrl Url Product::releaseNotesUrl() const { return Url(); } +#warning DUMMY updateUrls std::list Product::updateUrls() const { return std::list(); } +#warning DUMMY extraUrls std::list Product::extraUrls() const { return std::list(); } +#warning DUMMY optionalUrls std::list Product::optionalUrls() const { return std::list(); } +#warning DUMMY flags std::list Product::flags() const { return std::list(); } - /** */ - Label Product::shortName() const - { return Label(); } +#warning DUMMY shortName + std::string Product::shortName() const + { return std::string(); } - /** */ - Label Product::longName() const - { return summary(); } + std::string Product::longName( const Locale & lang_r ) const + { return summary( lang_r ); } +#warning DUMMY distributionName std::string Product::distributionName() const { return std::string(); } +#warning DUMMY distributionEdition Edition Product::distributionEdition() const { return Edition(); } diff --git a/zypp/Product.h b/zypp/Product.h index 9e7b016..58c5e78 100644 --- a/zypp/Product.h +++ b/zypp/Product.h @@ -41,9 +41,6 @@ namespace zypp /** Get the product type (base, add-on) */ std::string type() const; - /** Get the vendor of the product */ - Label vendor() const; - /** The URL to download the release notes for this product */ Url releaseNotesUrl() const; @@ -69,11 +66,11 @@ namespace zypp /** The product flags */ std::list flags() const; - /** */ - Label shortName() const; + /** Untranslated short name like SLES 10*/ + std::string shortName() const; - /** */ - Label longName() const; + /** Translated long name like SUSE Linux Enterprise Server 10*/ + std::string longName( const Locale & lang_r = Locale() ) const; /** Vendor specific distribution id. */ std::string distributionName() const; diff --git a/zypp/Repository.h b/zypp/Repository.h index c54f794..8f51864 100644 --- a/zypp/Repository.h +++ b/zypp/Repository.h @@ -29,20 +29,21 @@ namespace zypp // /** */ class Repository : protected sat::detail::PoolMember, - private base::SafeBool + private base::SafeBool { public: typedef filter_iterator SolvableIterator; typedef sat::detail::size_type size_type; + typedef sat::detail::RepoIdType IdType; public: /** Default ctor creates \ref noRepository.*/ Repository() - : _id( sat::detail::noRepoId ) {} + : _id( sat::detail::noRepoId ) {} /** \ref PoolImpl ctor. */ - explicit Repository( sat::detail::RepoIdType id_r ) - : _id( id_r ) {} + explicit Repository( IdType id_r ) + : _id( id_r ) {} public: /** Represents no \ref Repository. */ @@ -106,9 +107,9 @@ namespace zypp void addSolv( const Pathname & file_r ); /** Add \c count_r new empty \ref Solvable to this \ref Repository. */ - sat::detail::SolvableIdType addSolvables( unsigned count_r ); + sat::Solvable::IdType addSolvables( unsigned count_r ); /** \overload Add only one new \ref Solvable. */ - sat::detail::SolvableIdType addSolvable() + sat::Solvable::IdType addSolvable() { return addSolvables( 1 ); } //@} @@ -116,12 +117,12 @@ namespace zypp /** Expert backdoor. */ ::_Repo * get() const; /** Expert backdoor. */ - sat::detail::RepoIdType id() const { return _id; } + IdType id() const { return _id; } private: friend base::SafeBool::operator bool_type() const; bool boolTest() const { return get(); } private: - sat::detail::RepoIdType _id; + IdType _id; }; /////////////////////////////////////////////////////////////////// @@ -138,7 +139,7 @@ namespace zypp /** \relates Repository */ inline bool operator<( const Repository & lhs, const Repository & rhs ) - { return lhs.get() < rhs.get(); } + { return lhs.get() < rhs.get(); } /////////////////////////////////////////////////////////////////// // diff --git a/zypp/ResObject.cc b/zypp/ResObject.cc index 953f533..c268d66 100644 --- a/zypp/ResObject.cc +++ b/zypp/ResObject.cc @@ -59,23 +59,23 @@ namespace zypp // /////////////////////////////////////////////////////////////////// - Text ResObject::summary() const - { return lookupStrAttribute( sat::SolvAttr::summary ); } + std::string ResObject::summary( const Locale & lang_r ) const + { return lookupStrAttribute( sat::SolvAttr::summary, lang_r ); } - Text ResObject::description() const - { return lookupStrAttribute( sat::SolvAttr::description ); } + std::string ResObject::description( const Locale & lang_r ) const + { return lookupStrAttribute( sat::SolvAttr::description, lang_r ); } - Text ResObject::insnotify() const - { return lookupStrAttribute( sat::SolvAttr::insnotify ); } + std::string ResObject::insnotify( const Locale & lang_r ) const + { return lookupStrAttribute( sat::SolvAttr::insnotify, lang_r ); } - Text ResObject::delnotify() const - { return lookupStrAttribute( sat::SolvAttr::delnotify ); } + std::string ResObject::delnotify( const Locale & lang_r ) const + { return lookupStrAttribute( sat::SolvAttr::delnotify, lang_r ); } - License ResObject::licenseToConfirm() const - { return lookupStrAttribute( sat::SolvAttr::eula ); } + std::string ResObject::licenseToConfirm( const Locale & lang_r ) const + { return lookupStrAttribute( sat::SolvAttr::eula, lang_r ); } - ByteCount ResObject::size() const - { return ByteCount( lookupNumAttribute( sat::SolvAttr::size ), ByteCount::K ); } + ByteCount ResObject::installsize() const + { return ByteCount( lookupNumAttribute( sat::SolvAttr::installsize ), ByteCount::K ); } ByteCount ResObject::downloadSize() const { return ByteCount( lookupNumAttribute( sat::SolvAttr::downloadsize ), ByteCount::K ); } @@ -87,13 +87,11 @@ namespace zypp bool ResObject::installOnly() const { return false; } -#warning DUMMY Date ResObject::buildtime() const - { return Date(); } + { return Date( lookupNumAttribute( sat::SolvAttr::buildtime ) ); } -#warning DUMMY installtime Date ResObject::installtime() const - { return Date(); } + { return Date( lookupNumAttribute( sat::SolvAttr::installtime ) ); } #warning DUMMY diskusage const DiskUsage & ResObject::diskusage() const diff --git a/zypp/ResObject.h b/zypp/ResObject.h index b3cde4f..844cbae 100644 --- a/zypp/ResObject.h +++ b/zypp/ResObject.h @@ -15,14 +15,16 @@ #include "zypp/base/Deprecated.h" #include "zypp/Resolvable.h" -#include "zypp/NeedAType.h" #include "zypp/Date.h" +#include "zypp/Locale.h" +#include "zypp/Vendor.h" #include "zypp/ByteCount.h" #include "zypp/DiskUsage.h" -#include "zypp/TranslatedText.h" #include "zypp/OnMediaLocation.h" #include "zypp/Repository.h" +#include "zypp/TranslatedText.h" + /////////////////////////////////////////////////////////////////// namespace zypp { ///////////////////////////////////////////////////////////////// @@ -67,12 +69,12 @@ namespace zypp * \short Short text describing the resolvable. * This attribute is usually displayed in columns. */ - Text summary() const; + std::string summary( const Locale & lang_r = Locale() ) const; /** * \short Long text describing the resolvable. */ - Text description() const; + std::string description( const Locale & lang_r = Locale() ) const; /** * \short Installation Notification @@ -80,7 +82,7 @@ namespace zypp * This text can be used to tell the user some notes * When he selects the resovable for installation. */ - Text insnotify() const; + std::string insnotify( const Locale & lang_r = Locale() ) const; /** * \short De-Installation Notification @@ -88,7 +90,7 @@ namespace zypp * This text can be used to tell the user some notes * When he selects the resovable for deinstall. */ - Text delnotify() const; + std::string delnotify( const Locale & lang_r = Locale() ) const; /** * \short License or agreement to accept @@ -96,7 +98,7 @@ namespace zypp * Agreement, warning or license the user should * accept before installing the resolvable. */ - Text licenseToConfirm() const; + std::string licenseToConfirm( const Locale & lang_r = Locale() ) const; /** * \short Vendor @@ -107,7 +109,10 @@ namespace zypp { return Resolvable::vendor().asString(); } /** Installed size. */ - ByteCount size() const; + ByteCount installsize() const; + /** \deprecated Use installsize which is more precise. */ + ZYPP_DEPRECATED ByteCount size() const + { return installsize(); } /** Size of the rpm package. */ ByteCount downloadSize() const; diff --git a/zypp/Vendor.h b/zypp/Vendor.h new file mode 100644 index 0000000..73368be --- /dev/null +++ b/zypp/Vendor.h @@ -0,0 +1,29 @@ +/*---------------------------------------------------------------------\ +| ____ _ __ __ ___ | +| |__ / \ / / . \ . \ | +| / / \ V /| _/ _/ | +| / /__ | | | | | | | +| /_____||_| |_| |_| | +| | +\---------------------------------------------------------------------*/ +/** \file zypp/Vendor.h + * +*/ +#ifndef ZYPP_VENDOR_H +#define ZYPP_VENDOR_H + +#include + +/////////////////////////////////////////////////////////////////// +namespace zypp +{ ///////////////////////////////////////////////////////////////// + + typedef std::string Vendor; + + ///////////////////////////////////////////////////////////////// +} // namespace zypp +/////////////////////////////////////////////////////////////////// + +#include "VendorAttr.h" + +#endif // ZYPP_VENDOR_H diff --git a/zypp/VendorAttr.h b/zypp/VendorAttr.h index d9cd380..477f217 100644 --- a/zypp/VendorAttr.h +++ b/zypp/VendorAttr.h @@ -16,8 +16,8 @@ #include #include "zypp/base/NonCopyable.h" -#include "zypp/NeedAType.h" #include "zypp/PathInfo.h" +#include "zypp/Vendor.h" /////////////////////////////////////////////////////////////////// namespace zypp { @@ -37,7 +37,7 @@ class VendorAttr : private base::NonCopyable /** * Adding new equivalent vendors described in a file **/ - bool addVendorFile( const Pathname & filename) const; + bool addVendorFile( const Pathname & filename) const; /** Return whether two vendor strings shold be treated as the same vendor. * Usually the solver is allowed to automatically select a package of an diff --git a/zypp/sat/SolvAttr.cc b/zypp/sat/SolvAttr.cc index 143fa80..ea9c2bd 100644 --- a/zypp/sat/SolvAttr.cc +++ b/zypp/sat/SolvAttr.cc @@ -9,10 +9,14 @@ /** \file zypp/SolvAttr.cc * */ +extern "C" +{ +#include +} + #include #include "zypp/base/String.h" - #include "zypp/sat/SolvAttr.h" using std::endl; @@ -25,44 +29,54 @@ namespace sat const SolvAttr SolvAttr::noAttr; -#warning use predefined Ids from libsatsolver. - const SolvAttr SolvAttr::summary ( "solvable:summary" ); - const SolvAttr SolvAttr::description ( "solvable:description" ); - const SolvAttr SolvAttr::insnotify ( "solvable:messageins" ); - const SolvAttr SolvAttr::delnotify ( "solvable:messagedel" ); - const SolvAttr SolvAttr::vendor ( "solvable:vendor" ); - const SolvAttr SolvAttr::license ( "solvable:license" ); - const SolvAttr SolvAttr::size ( "solvable:installsize" ); - const SolvAttr SolvAttr::downloadsize ( "solvable:downloadsize" ); +#warning STILL ATTRIBUTES HERE WHICH ARE NOT PROVIDED BY SOLV FILES +// At least the ones that do nat have a satsolver/knownid. + + const SolvAttr SolvAttr::summary ( SOLVABLE_SUMMARY ); // translated + const SolvAttr SolvAttr::description ( SOLVABLE_DESCRIPTION ); // translated + const SolvAttr SolvAttr::insnotify ( SOLVABLE_MESSAGEINS ); // translated + const SolvAttr SolvAttr::delnotify ( SOLVABLE_MESSAGEDEL ); // translated + const SolvAttr SolvAttr::eula ( SOLVABLE_EULA ); // translated + const SolvAttr SolvAttr::installtime ( SOLVABLE_INSTALLTIME ); + const SolvAttr SolvAttr::buildtime ( SOLVABLE_BUILDTIME ); + const SolvAttr SolvAttr::installsize ( SOLVABLE_INSTALLSIZE ); + const SolvAttr SolvAttr::downloadsize ( SOLVABLE_DOWNLOADSIZE ); + const SolvAttr SolvAttr::diskusage ( SOLVABLE_DISKUSAGE ); //package - const SolvAttr SolvAttr::medianr ( "solvable:medianr" ); - const SolvAttr SolvAttr::mediafile ( "solvable:mediafile" ); - const SolvAttr SolvAttr::mediadir ( "solvable:mediadir" ); - const SolvAttr SolvAttr::eula ( "solvable:eula" ); + const SolvAttr SolvAttr::medianr ( SOLVABLE_MEDIANR ); + const SolvAttr SolvAttr::mediafile ( SOLVABLE_MEDIAFILE ); + const SolvAttr SolvAttr::mediadir ( SOLVABLE_MEDIADIR ); const SolvAttr SolvAttr::changelog ( "changelog" ); const SolvAttr SolvAttr::buildhost ( "buildhost" ); const SolvAttr SolvAttr::distribution ( "distribution" ); + const SolvAttr SolvAttr::license ( SOLVABLE_LICENSE ); const SolvAttr SolvAttr::packager ( "packager" ); - const SolvAttr SolvAttr::group ( "solvable:group" ); - const SolvAttr SolvAttr::keywords ( "solvable:keywords" ); - const SolvAttr SolvAttr::os ( "os" ); - const SolvAttr SolvAttr::prein ( "prein" ); - const SolvAttr SolvAttr::postin ( "postin" ); - const SolvAttr SolvAttr::preun ( "preun" ); - const SolvAttr SolvAttr::postun ( "postun" ); + const SolvAttr SolvAttr::group ( SOLVABLE_GROUP ); + const SolvAttr SolvAttr::keywords ( SOLVABLE_KEYWORDS ); const SolvAttr SolvAttr::sourcesize ( "sourcesize" ); - const SolvAttr SolvAttr::authors ( "solvable:authors" ); + const SolvAttr SolvAttr::authors ( SOLVABLE_AUTHORS ); const SolvAttr SolvAttr::filenames ( "filenames" ); const SolvAttr SolvAttr::srcpkgname ( "srcpkgname" ); const SolvAttr SolvAttr::srcpkgedition( "srcpkgedition" ); + const SolvAttr SolvAttr::filelist ( SOLVABLE_FILELIST ); + const SolvAttr SolvAttr::sourcearch ( SOLVABLE_SOURCEARCH ); + const SolvAttr SolvAttr::sourcename ( SOLVABLE_SOURCENAME ); + const SolvAttr SolvAttr::sourceevr ( SOLVABLE_SOURCEEVR ); + const SolvAttr SolvAttr::headerend ( SOLVABLE_HEADEREND ); + + // patch + const SolvAttr SolvAttr::patchcategory( SOLVABLE_PATCHCATEGORY ); //pattern - const SolvAttr SolvAttr::isvisible ( "solvable:isvisible" ); - const SolvAttr SolvAttr::icon ( "icon" ); + const SolvAttr SolvAttr::isvisible ( SOLVABLE_ISVISIBLE ); + const SolvAttr SolvAttr::icon ( SOLVABLE_ICON ); + const SolvAttr SolvAttr::order ( SOLVABLE_ORDER ); const SolvAttr SolvAttr::isdefault ( "isdefault" ); - const SolvAttr SolvAttr::category ( "solvable:category" ); // FIXME translate + const SolvAttr SolvAttr::category ( SOLVABLE_CATEGORY ); // translated const SolvAttr SolvAttr::script ( "script" ); + const SolvAttr SolvAttr::includes ( SOLVABLE_INCLUDES ); + const SolvAttr SolvAttr::extends ( SOLVABLE_EXTENDS ); } // namespace sat ///////////////////////////////////////////////////////////////// diff --git a/zypp/sat/SolvAttr.h b/zypp/sat/SolvAttr.h index 94d171b..252a7c3 100644 --- a/zypp/sat/SolvAttr.h +++ b/zypp/sat/SolvAttr.h @@ -43,39 +43,47 @@ namespace sat static const SolvAttr description; static const SolvAttr insnotify; static const SolvAttr delnotify; - static const SolvAttr vendor; - static const SolvAttr license; - static const SolvAttr size; + static const SolvAttr eula; + static const SolvAttr installtime; + static const SolvAttr buildtime; + static const SolvAttr installsize; static const SolvAttr downloadsize; + static const SolvAttr diskusage; //package static const SolvAttr mediadir; static const SolvAttr medianr; static const SolvAttr mediafile; - static const SolvAttr eula; static const SolvAttr changelog; static const SolvAttr buildhost; static const SolvAttr distribution; + static const SolvAttr license; static const SolvAttr packager; static const SolvAttr group; static const SolvAttr keywords; - static const SolvAttr os; - static const SolvAttr prein; - static const SolvAttr postin; - static const SolvAttr preun; - static const SolvAttr postun; static const SolvAttr sourcesize; static const SolvAttr authors; static const SolvAttr filenames; static const SolvAttr srcpkgname; static const SolvAttr srcpkgedition; + static const SolvAttr filelist; + static const SolvAttr sourcearch; + static const SolvAttr sourcename; + static const SolvAttr sourceevr; + static const SolvAttr headerend; + + // patch + static const SolvAttr patchcategory; // patern static const SolvAttr isvisible; static const SolvAttr icon; + static const SolvAttr order; static const SolvAttr isdefault; static const SolvAttr category; static const SolvAttr script; + static const SolvAttr includes; + static const SolvAttr extends; //@} diff --git a/zypp/sat/Solvable.cc b/zypp/sat/Solvable.cc index 7c66e88..0624a89 100644 --- a/zypp/sat/Solvable.cc +++ b/zypp/sat/Solvable.cc @@ -77,9 +77,15 @@ namespace zypp { NO_SOLVABLE_RETURN( std::string() ); const char *s = ::repo_lookup_str( _solvable, attr.idStr().id() ); - return s ? s : std::string(); + return s ? s : std::string(); } + std::string Solvable::lookupStrAttribute( const SolvAttr & attr, const Locale & lang_r ) const + { +#warning FIX RETRIEVIENG TRANSLATIONS + return lookupStrAttribute( attr ); + } + unsigned Solvable::lookupNumAttribute( const SolvAttr & attr ) const { NO_SOLVABLE_RETURN( 0 ); diff --git a/zypp/sat/Solvable.h b/zypp/sat/Solvable.h index fbd54bd..dba261b 100644 --- a/zypp/sat/Solvable.h +++ b/zypp/sat/Solvable.h @@ -56,12 +56,15 @@ namespace zypp private base::SafeBool { public: + typedef sat::detail::SolvableIdType IdType; + + public: /** Default ctor creates \ref nosolvable.*/ Solvable() : _id( detail::noSolvableId ) {} /** \ref PoolImpl ctor. */ - explicit Solvable( detail::SolvableIdType id_r ) + explicit Solvable( IdType id_r ) : _id( id_r ) {} public: @@ -84,6 +87,15 @@ namespace zypp * or an empty string if it does not exists. */ std::string lookupStrAttribute( const SolvAttr & attr ) const; + /** \overload Trying to look up a translated string attribute. + * + * Passing an empty \ref Locale will return the string for the + * current default locale (\see \ref ZConfig::defaultTextLocale). + * + * Returns the translation for \c lang_r considering all fallback + * locales. Returns an empty string if no translation is available. + */ + std::string lookupStrAttribute( const SolvAttr & attr, const Locale & lang_r ) const; /** * returns the numeric attribute value for \ref attr @@ -172,12 +184,12 @@ namespace zypp /** Expert backdoor. */ ::_Solvable * get() const; /** Expert backdoor. */ - detail::SolvableIdType id() const { return _id; } + IdType id() const { return _id; } private: friend base::SafeBool::operator bool_type() const; bool boolTest() const { return get(); } private: - detail::SolvableIdType _id; + IdType _id; }; /////////////////////////////////////////////////////////////////// diff --git a/zypp/target/CommitPackageCacheReadAhead.cc b/zypp/target/CommitPackageCacheReadAhead.cc index d52ee8b..ba6bc06 100644 --- a/zypp/target/CommitPackageCacheReadAhead.cc +++ b/zypp/target/CommitPackageCacheReadAhead.cc @@ -160,7 +160,7 @@ namespace zypp ManagedFile fromSource( sourceProvidePackage( it->first ) ); // copy it to the cachedir - std::string destName( str::form( "S%lu_%u_%s", + std::string destName( str::form( "S%p_%u_%s", it->first->repository().id(), it->first->mediaNr(), fromSource.value().basename().c_str() ) ); diff --git a/zypp/ui/PatternContentsImpl.cc b/zypp/ui/PatternContentsImpl.cc index 0e1239b..dd3bb9b 100644 --- a/zypp/ui/PatternContentsImpl.cc +++ b/zypp/ui/PatternContentsImpl.cc @@ -40,7 +40,9 @@ namespace zypp void operator()( const Pattern::constPtr & pattern ) { - std::set s( pattern->install_packages() ); +#warning NEEDS FIX +// std::set s( pattern->install_packages() ); + std::set s; _result->insert( s.begin(), s.end() ); } diff --git a/zypp/ui/UserWantedPackages.cc b/zypp/ui/UserWantedPackages.cc index 9edf819..33d92f1 100644 --- a/zypp/ui/UserWantedPackages.cc +++ b/zypp/ui/UserWantedPackages.cc @@ -129,7 +129,8 @@ namespace zypp DBG << (*it)->theObj()->kind().asString() << " will be transacted: \"" << pkgSet->name() << "\"" << endl; - set setPkgs = pkgSet->install_packages(); +#warning NEEDS FIX + set setPkgs;// = pkgSet->install_packages(); pkgNames.insert( setPkgs.begin(), setPkgs.end() ); } } -- 2.7.4