#include "zypp/sat/Solvable.h"
#include "zypp/RepoInfo.h"
#include "zypp/Date.h"
+#include "zypp/CpeId.h"
///////////////////////////////////////////////////////////////////
namespace zypp
/** Label to display for this repo. */
std::string name() const;
- /** User string */
+ /** Alias or name, according to \ref ZConfig::repoLabelIsAlias */
+ std::string label() const;
+
+ /** User string: \ref label (alias or name) */
std::string asUserString() const
- { return name(); }
+ { return label(); }
public:
/** Timestamp or arbitrary user supplied string.
*/
ContentIdentifier contentIdentifier() const;
+ /** Whether \a id_r matches this repos content identifier. */
+ bool hasContentIdentifier( const ContentIdentifier & id_r ) const;
+
/**
* Timestamp when this repository was generated
*
*/
bool maybeOutdated() const;
- /**
- * if the repository claims to update something then
- * it is an update repository
- *
- * This is implemented by looking at the repository updates
- * tag.
- * \see http://en.opensuse.org/Standards/Rpm_Metadata#SUSE_repository_info_.28suseinfo.xml.29.2C_extensions_to_repomd.xml
+ /** Hint whether the Repo may provide updates for a product.
+ *
+ * Either the repository claims to update a product via a repository updates
+ * tag in it's metadata or a known product lists the repositories ContentIdentifier
+ * as required update repo.
*/
bool isUpdateRepo() const;
- /**
- * whether the repository claims to update something \ref prod
- * with key \ref cpeid
- *
- * \see zypp::Product::cpeId()
- *
- * See http://cpe.mitre.org/ for more information on the
- * Common Platform Enumearation.
- */
- bool providesUpdatesFor( const std::string &cpeid ) const;
+ /** Hint whether the Repo may provide updates for a product identified by it's \ref CpeId
+ *
+ * Either the repository claims to update a product via a repository updates
+ * tag in it's metadata or a known product lists the repositories ContentIdentifier
+ * as required update repo.
+ */
+ bool providesUpdatesFor( const CpeId & cpeid_r ) const;
/** Whether \ref Repository contains solvables. */
bool solvablesEmpty() const;
public:
- /** Query class for Repository */
+ /** Query class for Repository related products */
class ProductInfoIterator;
/**
ProductInfoIterator compatibleWithProductEnd() const;
/**
- * Get an iterator to the beginning of the repository
- * compatible distros.
+ * Get an iterator to the beginning of distos the repository
+ * provides upadates for.
+ * \note This is only a hint within the repositories metadata.
+ * The same realation might be expressed by a product listing
+ * this repositories ContentIdentifier as required update repo.
* \see Repository::ProductInfoIterator
*/
ProductInfoIterator updatesProductBegin() const;
/**
- * Get an iterator to the end of the repository
- * compatible distros.
+ * Get an iterator to the end of distos the repository
+ * provides upadates for.
* \see Repository::ProductInfoIterator
*/
ProductInfoIterator updatesProductEnd() const;
/**
* Query class for Repository related products
*
+ * Products are identified by CpeIds within the repositories metadata.
+ * \see http://en.opensuse.org/Standards/Rpm_Metadata#SUSE_repository_info_.28suseinfo.xml.29.2C_extensions_to_repomd.xml
+ *
* The iterator does not provide a dereference
* operator so you can do * on it, but you can
* access the attributes of each related product
* \code
* for_( it, repo.compatibleWithProductBegin(), repo.compatibleWithProductEnd() )
* {
- * cout << it.cpeid() << endl;
+ * cout << it.label() << ": " << it.cpeid() << endl;
* }
* \endcode
*
ProductInfoIterator()
{}
- /**
- * Product label
- */
+ /** Product label */
std::string label() const;
- /**
- * The Common Platform Enumeration name
- * for this product.
- *
- * See http://cpe.mitre.org
- */
- std::string cpeId() const;
+ /** The Common Platform Enumeration name for this product. */
+ CpeId cpeId() const;
private:
friend class Repository;