-------------------------------------------------------------------
+Thu Sep 11 16:01:57 CEST 2008 - dmacvicar@suse.de
+
+- add Repostiroy::updateKeys and
+ Repository::providesUpdatesForKey(string) for repo and
+ product matching
+- Provide Repository::isUpdateRepo
+
+-------------------------------------------------------------------
Thu Sep 11 14:41:28 CEST 2008 - ma@suse.de
- Fix evaluation of vendor support flags.
return Date();
}
-
bool Repository::maybeOutdated() const
{
// system repo is not mirrored
return suggestedExpirationTimestamp() < Date::now();
}
+
+ Repository::UpdateKeys Repository::updateKeys() const
+ { return UpdateKeys( sat::SolvAttr::repositoryUpdates, *this ); }
+
+ bool Repository::providesUpdatesForKey( const std::string &key ) const
+ {
+ UpdateKeys keys(updateKeys());
+ return ( keys.find(key) != keys.end() );
+ }
+ bool Repository::isUpdateRepo() const
+ {
+ return ( ! updateKeys().empty() );
+ }
+
bool Repository::solvablesEmpty() const
{
NO_REPOSITORY_RETURN( true );
namespace zypp
{ /////////////////////////////////////////////////////////////////
+ namespace sat
+ {
+ template<class _ResultT, class _AttrT>
+ class ArrayAttr;
+ }
+
namespace detail
{
struct ByRepository;
typedef filter_iterator<detail::ByRepository, sat::detail::SolvableIterator> SolvableIterator;
typedef sat::detail::size_type size_type;
typedef sat::detail::RepoIdType IdType;
+ typedef sat::ArrayAttr<std::string,std::string> UpdateKeys;
public:
/** Default ctor creates \ref noRepository.*/
*/
bool maybeOutdated() const;
+ /**
+ * if the repository claims to update something then
+ * it is an update repository
+ */
+ bool isUpdateRepo() const;
+
+ /**
+ * Wether the reposity claims to provide updates to \ref prod
+ */
+ UpdateKeys updateKeys() const;
+
+ /**
+ * wether the repository claims to update something \ref prod
+ * with key &\key
+ */
+ bool providesUpdatesForKey( const std::string &key ) const;
+
/** Whether \ref Repository contains solvables. */
bool solvablesEmpty() const;
/////////////////////////////////////////////////////////////////
} // namespace zypp
///////////////////////////////////////////////////////////////////
+
+#include "zypp/sat/LookupAttr.h"
+
#endif // ZYPP_SAT_REPOSITORY_H
// repository
const SolvAttr SolvAttr::repositoryTimestamp ( REPOSITORY_TIMESTAMP );
const SolvAttr SolvAttr::repositoryExpire ( REPOSITORY_EXPIRE );
-
+ const SolvAttr SolvAttr::repositoryUpdates ( REPOSITORY_UPDATES );
} // namespace sat
/////////////////////////////////////////////////////////////////
//@{
static const SolvAttr repositoryTimestamp;
static const SolvAttr repositoryExpire;
+ static const SolvAttr repositoryUpdates;
//@}
//@}