45 #define NO_REPOSITORY_RETURN( VAL ) \
46 sat::detail::CRepo * _repo( get() ); \
47 if ( ! _repo ) return VAL
49 #define NO_REPOSITORY_THROW( VAL ) \
50 sat::detail::CRepo * _repo( get() ); \
51 if ( ! _repo ) ZYPP_THROW( VAL )
76 return _repo->priority;
82 return _repo->subpriority;
104 if ( it.asString() == id_r )
138 for (
const auto & val :
keywords() )
169 if ( compare( cpeid_r, it.cpeId(), SetRelation::subset ) )
175 if ( ! myIds.
empty() )
181 if ( compare( cpeid_r, prod->cpeId(), SetRelation::superset ) )
185 if ( prod->hasUpdateContentIdentifier( myId.asString() ) )
204 if ( ! myIds.
empty() )
222 return !_repo->nsolvables;
228 return _repo->nsolvables;
285 info_r.
alias().c_str(),
alias().c_str() ) ) );
288 MIL << *
this << endl;
300 MIL << *
this <<
" removed from pool" << endl;
312 if ( ++it != _for_end )
331 if (
myPool()._addSolv( _repo, file ) != 0 )
336 MIL << *
this <<
" after adding " << file_r << endl;
343 std::string command( file_r.extension() ==
".gz" ?
"zcat " :
"cat " );
344 command += file_r.asString();
353 if (
myPool()._addHelix( _repo, file ) != 0 )
358 MIL << *
this <<
" after adding " << file_r << endl;
375 return str <<
"noRepository";
377 return str <<
"sat::repo(" << obj.
alias() <<
")"
379 <<
"prio " << obj.
get()->priority <<
'.' << obj.
get()->subpriority
387 {
"name", obj.
name() },
388 {
"alias", obj.
alias() }
402 }
while ( base() < satpool->repos+satpool->nrepos && !*base() );
std::string asString(const Patch::Category &obj)
std::string name() const
Repository name.
#define NO_REPOSITORY_RETURN(VAL)
RepoInfo info() const
Return any associated RepoInfo.
std::ostream & node(std::ostream &out_r, const std::string &name_r, Node::Attr attr_r)
Functor filtering Solvable by Repository.
std::string alias() const
unique identifier for this source.
static const SolvAttr repositoryExpire
static const SolvAttr repositoryProductLabel
sat::ArrayAttr< std::string, std::string > Keywords
std::string alias() const
Short unique string to identify a repo.
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.
std::string name() const
Label to display for this repo.
byKind_iterator byKindBegin(const ResKind &kind_r) const
void addSolv(const Pathname &file_r)
Load Solvables from a solv-file.
std::string label() const
Product label.
::_Repo CRepo
Wrapped libsolv C data type exposed as backdoor.
void _deleteRepo(CRepo *repo_r)
Creating a new repo named name_r.
sat::Solvable::IdType addSolvables(unsigned count_r)
Add count_r new empty Solvable to this Repository.
static const RepoIdType noRepoId(0)
Id to denote Repo::noRepository.
::_Pool CPool
Wrapped libsolv C data type exposed as backdoor.
void clearInfo()
Remove any RepoInfo set for this repository.
static const SolvAttr repositoryTimestamp
unsigned SolvableIdType
Id type to connect Solvable and sat-solvable.
SolvableIterator solvablesEnd() const
Iterator behind the last Solvable.
detail::CPool * get() const
Expert backdoor.
What is known about a repository.
Date generatedTimestamp() const
Timestamp when this repository was generated.
Common Platform Enumearation (2.3) See http://cpe.mitre.org/ for more information on the Common Platf...
unsigned asUnsigned() const
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
detail::SolvableIdType _addSolvables(CRepo *repo_r, unsigned count_r)
Adding Solvables to a repo.
LookupAttr::TransformIterator based container to retrieve list attributes.
CpeId cpeId() const
The Common Platform Enumeration name for this product.
int satInternalSubPriority() const
TraitsType::constPtrType constPtr
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
byKind_iterator byKindEnd(const ResKind &kind_r) const
bool isSystemRepo() const
Return whether this is the system repository.
std::string ContentRevision
filter_iterator< detail::ByRepository, sat::detail::SolvableIterator > SolvableIterator
bool isUpdateRepo() const
Hint whether the Repo may provide updates for a product.
CRepo * getRepo(RepoIdType id_r) const
sat::detail::size_type size_type
static const SolvAttr repositoryRevision
bool providesUpdatesFor(const CpeId &cpeid_r) const
Hint whether the Repo may provide updates for a product identified by it's CpeId. ...
Repository nextInPool() const
Return next Repository in Pool (or noRepository).
std::string label() const
Label for use in messages for the user interface.
ContentIdentifier contentIdentifier() const
Unique string identifying a repositories content.
Store and operate on date (time_t).
static Pool instance()
Singleton ctor.
SolvableIterator solvablesBegin() const
Iterator to the first Solvable.
sat::detail::CRepo * get() const
Expert backdoor.
iterator end() const
Iterator behind the end of query results.
void setRepoInfo(RepoIdType id_r, const RepoInfo &info_r)
Also adjust repo priority and subpriority accordingly.
Lightweight repository attribute value lookup.
std::ostream & operator<<(std::ostream &str, const Exception &obj)
void setInfo(const RepoInfo &info_r)
Set RepoInfo for this repository.
Date suggestedExpirationTimestamp() const
Suggested expiration timestamp.
Query class for Repository related products.
ContentRevision contentRevision() const
Timestamp or arbitrary user supplied string.
bool hasKeyword(const std::string &val_r) const
Whether val_r is present in keywords.
Keywords keywords() const
repository keywords (tags)
static PoolImpl & myPool()
bool solvablesEmpty() const
Whether Repository contains solvables.
#define NO_REPOSITORY_THROW(VAL)
void resetDispose()
Set no dispose function.
bool hasContentIdentifier(const ContentIdentifier &id_r) const
Whether id_r matches this repos content identifier.
bool empty() const
Whether the query is empty.
std::string label() const
Alias or name, according to ZConfig::repoLabelIsAlias.
std::string ContentIdentifier
size_type solvablesSize() const
Number of solvables in Repository.
void addHelix(const Pathname &file_r)
Load Solvables from a helix-file.
static constexpr NoThrowType noThrow
Indicator argument for non-trowing ctor.
Base class for Exception.
static const Repository noRepository
Represents no Repository.
int satInternalPriority() const
libsolv internal priorities.
static Date now()
Return the current time.
static const SolvAttr repositoryRepoid
bool isSystemRepo(CRepo *repo_r) const
static const std::string & systemRepoAlias()
Reserved system repository alias .
static const SolvAttr repositoryKeywords
void eraseFromPool()
Remove this Repository from it's Pool.
static const SolvAttr repositoryProductCpeid
ProductInfoIterator updatesProductEnd() const
Get an iterator to the end of distos the repository provides upadates for.
bool hasUpdateContentIdentifier(const Repository::ContentIdentifier &cident_r) const
Whether cident_r is listed as required update repository.
static const std::string & systemRepoAlias()
Reserved system repository alias .
static const SolvAttr repositoryDistros
array of repositoryProductLabel repositoryProductCpeid pairs
static const SolvAttr repositoryUpdates
array of repositoryProductLabel repositoryProductCpeid pairs
const RepoInfo & repoInfo(RepoIdType id_r)
std::string asString() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
ProductInfoIterator compatibleWithProductEnd() const
Get an iterator to the end of the repository compatible distros.
ProductInfoIterator updatesProductBegin() const
Get an iterator to the beginning of distos the repository provides upadates for.
std::ostream & dumpAsXmlOn(std::ostream &str, const Tp &obj, const std::string &name_r)
bool maybeOutdated() const
The suggested expiration date of this repository already passed.
ProductInfoIterator compatibleWithProductBegin() const
Get an iterator to the beginning of the repository compatible distros.
iterator begin() const
Iterator to the begin of query results.
Search for repository attributes.
static ResPool instance()
Singleton ctor.