Author: mlandres Date: Thu Aug 14 18:24:34 2008 New Revision: 10861 URL: http://svn.opensuse.org/viewcvs/zypp?rev=10861&view=rev Log: support buddies in solver testcases Modified: trunk/libzypp/zypp/Product.cc trunk/libzypp/zypp/Product.h Modified: trunk/libzypp/zypp/Product.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Product.cc?rev=10861&r1=10860&r2=10861&view=diff ============================================================================== --- trunk/libzypp/zypp/Product.cc (original) +++ trunk/libzypp/zypp/Product.cc Thu Aug 14 18:24:34 2008 @@ -79,7 +79,17 @@ { Capability identCap( lookupStrAttribute( sat::SolvAttr::productReferences ) ); if ( ! identCap ) + { + // No 'references': fallback to provider of 'product(name) = version' + // Without this solver testcase won't work, as it does not remember + // 'references'. + identCap = Capability( str::form( "product(%s) = %s", name().c_str(), edition().c_str() ) ); + } + if ( ! identCap ) + { return sat::Solvable::noSolvable; + } + // if there is productReferences defined, we expect // a matching package within the same repo. @@ -94,6 +104,9 @@ return sat::Solvable::noSolvable; } + std::string Product::shortName() const + { return lookupStrAttribute( sat::SolvAttr::productShortlabel ); } + std::string Product::flavor() const { return lookupStrAttribute( sat::SolvAttr::productFlavor ); } @@ -137,12 +150,6 @@ return ret; } - std::string Product::shortName() const - { return lookupStrAttribute( sat::SolvAttr::productShortlabel ); } - - std::string Product::longName( const Locale & lang_r ) const - { return summary( lang_r ); } - std::string Product::distributionName() const { return lookupStrAttribute( sat::SolvAttr::productDistproduct ); } Modified: trunk/libzypp/zypp/Product.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Product.h?rev=10861&r1=10860&r2=10861&view=diff ============================================================================== --- trunk/libzypp/zypp/Product.h (original) +++ trunk/libzypp/zypp/Product.h Thu Aug 14 18:24:34 2008 @@ -44,11 +44,18 @@ sat::Solvable referencePackage() const; public: - /** The product flavor (LiveCD Demo, FTP edition,...).*/ + /** Untranslated short name like <tt>SLES 10</tt>*/ + std::string shortName() const; + + /** The product flavor (LiveCD Demo, FTP edition,...). */ std::string flavor() const; - /** Get the product type (base, add-on) */ - std::string type() const ZYPP_DEPRECATED; + /** Get the product type (base, add-on) + * Well, in an ideal world there is only one base product. + * It's the installed product denoted by a symlink in + * \c /etc/products.d. + */ + std::string type() const; /** The URL to download the release notes for this product */ Url releaseNotesUrl() const; @@ -75,16 +82,20 @@ /** The product flags */ std::liststd::string flags() const; - /** Untranslated short name like <tt>SLES 10</tt>*/ - std::string shortName() const; - - /** Translated long name like <tt>SUSE Linux Enterprise Server 10</tt>*/ - std::string longName( const Locale & lang_r = Locale() ) const ZYPP_DEPRECATED; + /** Translated long name like <tt>SUSE Linux Enterprise Server 10</tt> + * \deprecated use summary. + */ + std::string longName( const Locale & lang_r = Locale() ) const ZYPP_DEPRECATED + { return summary( lang_r ); } - /** Vendor specific distribution id. */ + /** Vendor specific distribution id. + * \deprecated replaced by ResObject::distribution + */ std::string distributionName() const ZYPP_DEPRECATED; - /** Vendor specific distribution version. */ + /** Vendor specific distribution version. + * \deprecated replaced by ResObject::distribution + */ Edition distributionEdition() const ZYPP_DEPRECATED; protected: -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org