Go to the documentation of this file.
12 #include <sys/types.h>
18 #include <solv/pool.h>
19 #include <solv/repo.h>
20 #include <solv/solvable.h>
53 {
return myPool()->nsolvables; }
71 {
return !
myPool()->urepos; }
74 {
return myPool()->urepos; }
97 if ( ! it->solvablesEmpty() )
111 ret += it->solvablesSize();
125 pool_whatmatchesdep(
get(),
attr.id(), cap.
id(), q, 0);
132 pool_whatmatchessolvable(
get(),
attr.id(),
static_cast<Id
>( solv.
id() ), q, 0 );
139 pool_whatcontainsdep(
get(),
attr.id(), cap.
id(), q, 0 );
167 if ( alias_r == it->alias() )
190 tmprepo->addSolv( file_r );
214 tmprepo->addHelix( file_r );
276 return str <<
"sat::pool(" << obj.
serial() <<
")["
283 #undef ZYPP_BASE_LOGGER_LOGGROUP
284 #define ZYPP_BASE_LOGGER_LOGGROUP "solvidx"
292 ERR <<
"Can't open solv-file: " << solv << endl;
297 if ( ::
unlink( solvidxfile.c_str() ) == -1 && errno != ENOENT )
299 ERR <<
"Can't unlink solv-idx: " <<
Errno() << endl;
303 int fd = ::open( solvidxfile.c_str(), O_CREAT|O_EXCL|O_WRONLY|O_TRUNC, 0644 );
306 ERR <<
"Can't create solv-idx: " <<
Errno() << endl;
311 std::ofstream idx( solvidxfile.c_str() );
316 if ( ::repo_add_solv( _repo, solv, 0 ) == 0 )
320 FOR_REPO_SOLVABLES( _repo, _id, _solv )
325 #define idstr(V) pool_id2str( _pool, _solv->V )
326 if ( _solv->arch == ARCH_SRC || _solv->arch == ARCH_NOSRC )
327 idx <<
"srcpackage:" <<
idstr(name) <<
SEP <<
idstr(evr) <<
SEP <<
"noarch" << endl;
335 ERR <<
"Can't read solv-file: " << ::pool_errstr( _pool ) << endl;
337 ::repo_free( _repo, 0 );
338 ::pool_free( _pool );
bool isAvailableLocale(const Locale &locale_r) const
sat::detail::IdType id() const
Expert backdoor.
bool solvablesEmpty() const
Whether Pool contains solvables.
static const std::string & systemRepoAlias()
Reserved system repository alias @System .
Solvable set wrapper to allow adding additional convenience iterators.
A Solvable object within the sat Pool.
IdType id() const
Expert backdoor.
Queue autoInstalled() const
Get ident list of all autoinstalled solvables.
SolvableIterator solvablesBegin() const
Iterator to the first Solvable.
bool isAvailableLocale(const Locale &locale_r) const
Whether this Locale is in the set of available locales.
size_type capacity() const
Internal array size for stats only.
What is known about a repository.
void setAutorefresh(bool autorefresh)
enable or disable autorefresh
const LocaleSet & getAvailableLocales() const
Get the set of available locales.
void initRequestedLocales(const LocaleSet &locales_r)
Start tracking changes based on this locales_r.
RepositoryIterator reposEnd() const
Iterator behind the last Repository.
::s_Pool CPool
Wrapped libsolv C data type exposed as backdoor.
void setNeedrebootSpec(sat::SolvableSpec needrebootSpec_r)
Solvables which should trigger the reboot-needed hint if installed/updated.
Queue whatMatchesDep(const SolvAttr &attr, const Capability &cap) const
void setName(const std::string &name)
set the repository name
static const std::string & systemRepoAlias()
Reserved system repository alias @System .
Functor removing Repository from it's Pool.
Pathname rootDir() const
Get rootdir (for file conflicts check)
static PoolImpl & myPool()
void prepare() const
Update housekeeping data (e.g.
const LocaleSet & getRemovedRequestedLocales() const
Removed since last initRequestedLocales.
Define a set of Solvables by ident and provides.
SolvableIterator solvablesEnd() const
Iterator behind the last Solvable.
Repository findSystemRepo() const
Return the system repository if it is on the pool.
int unlink(const Pathname &path)
Like 'unlink'.
size_type solvablesSize() const
Number of solvables in Pool.
detail::SolvableIterator SolvableIterator
RepositoryIterator reposBegin() const
Iterator to the first Repository.
void setAutoInstalled(const Queue &autoInstalled_r)
Set ident list of all autoinstalled solvables.
const SerialNumber & serialIDs() const
Serial number changing whenever resusePoolIDs==true was used.
const LocaleSet & getRequestedLocales() const
Current set of requested Locales.
bool addRequestedLocale(const Locale &locale_r)
User change (tracked).
StringQueue autoInstalled() const
Get ident list of all autoinstalled solvables.
const MultiversionList & multiversion() const
void prepare() const
Update housekeeping data if necessary (e.g.
void setNeedrebootSpec(sat::SolvableSpec needrebootSpec_r)
Set new Solvable specs.
const LocaleSet & getAvailableLocales() const
All Locales occurring in any repo.
bool addRequestedLocale(const Locale &locale_r)
Add one Locale to the set of requested locales.
const char * c_str() const
String representation.
std::string alias() const
unique identifier for this source.
bool reposEmpty() const
Whether Pool contains repos.
Repository addRepoHelix(const Pathname &file_r, const std::string &name_r)
Load Solvables from a helix-file into a Repository named name_r.
void setTextLocale(const Locale &locale_r)
Set the default language for retrieving translated texts.
std::ostream & operator<<(std::ostream &str, const FileConflicts &obj)
bool eraseRequestedLocale(const Locale &locale_r)
Erase one Locale from the set of requested locales.
void setRequestedLocales(const LocaleSet &locales_r)
User change (tracked).
Easy-to use interface to the ZYPP dependency resolver.
const LocaleSet & getRemovedRequestedLocales() const
Removed since last initRequestedLocales.
const SerialNumber & serial() const
Serial number changing whenever the content changes.
Libsolv Id queue wrapper.
void setEnabled(bool enabled)
enable or disable the repository
const LocaleSet & getAddedRequestedLocales() const
Added since last initRequestedLocales.
const SerialNumber & serialIDs() const
Serial number changing whenever resusePoolIDs==true was used.
bool eraseRequestedLocale(const Locale &locale_r)
User change (tracked).
bool isRequestedLocale(const Locale &locale_r) const
Whether this Locale is in the set of requested locales.
const MultiversionList & multiversionList() const
::s_Solvable CSolvable
Wrapped libsolv C data type exposed as backdoor.
bool isRequestedLocale(const Locale &locale_r) const
Queue whatContainsDep(const SolvAttr &attr, const Capability &cap) const
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
bool isSystemRepo() const
Return whether this is the system repository.
size_type reposSize() const
Number of repos in Pool.
Queue whatMatchesSolvable(const SolvAttr &attr, const Solvable &solv) const
Simple serial number provider.
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Pathname extend(const std::string &r) const
Append string r to the last component of the path.
detail::size_type size_type
void initRequestedLocales(const LocaleSet &locales_r)
Start tracking changes based on this locales_r.
void updateSolvFileIndex(const Pathname &solvfile_r)
Create solv file content digest for zypper bash completion.
std::unordered_set< Locale > LocaleSet
void setTextLocale(const Locale &locale_r)
Convenience errno wrapper.
const LocaleSet & getAddedRequestedLocales() const
Added since last initRequestedLocales.
Repository addRepoSolv(const Pathname &file_r, const std::string &name_r)
Load Solvables from a solv-file into a Repository named name_r.
void setRequestedLocales(const LocaleSet &locales_r)
Set the requested locales.
std::string basename() const
Return the last component of this path.
Iterable< RepositoryIterator > repos() const
Iterate the repositories.
String related utilities and Regular expression matching.
void setAlias(const std::string &alias)
set the repository alias
void resetDispose()
Set no dispose function.
Repository reposInsert(const std::string &alias_r)
Return a Repository named alias_r.
void setInfo(const RepoInfo &info_r)
Set RepoInfo for this repository.
zypp::detail::RepositoryIterator RepositoryIterator
const std::string & asString() const
String representation.
Pathname rootDir() const
Get rootdir (for file conflicts check)
'Language[_Country]' codes.
::s_Repo CRepo
Wrapped libsolv C data type exposed as backdoor.
Repository reposFind(const std::string &alias_r) const
Find a Repository named alias_r.
detail::CPool * get() const
Expert backdoor.
void setAutoInstalled(const StringQueue &autoInstalled_r)
Set ident list of all autoinstalled solvables.
const SerialNumber & serial() const
Housekeeping data serial number.
Repository systemRepo()
Return the system repository, create it if missing.
const LocaleSet & getRequestedLocales() const
Return the requested locales.