14#include <zypp/base/LogTools.h>
15#include <zypp/PathInfo.h>
27#undef ZYPP_BASE_LOGGER_LOGGROUP
28#define ZYPP_BASE_LOGGER_LOGGROUP "zypp::misc"
39 if ( not flags_r && geteuid() != 0 ) {
42 MIL <<
str::form(
"*** Load system at '%s' (%lx)", sysRoot_r.
c_str(), (
unsigned long)flags_r ) << endl;
44 if ( !
PathInfo( sysRoot_r ).isDir() )
58 getZYpp()->initializeTarget( sysRoot_r );
59 getZYpp()->target()->load();
80 MIL <<
str::form(
"*** clean cache for repo '%s'\t", nrepo.
name().c_str() ) << endl;
87 if ( ! repoManager.
isCached( nrepo ) )
89 MIL <<
str::form(
"*** build cache for repo '%s'\t", nrepo.
name().c_str() ) << endl;
93 MIL <<
str::form(
"*** load repo '%s'\t", nrepo.
name().c_str() ) << std::flush;
Base class for Exception.
std::string historyAsString() const
The history as string.
std::string asString() const
Error message provided by dumpOn as string.
What is known about a repository.
repo::RepoType type() const
Type of repository,.
Url url() const
Pars pro toto: The first repository url.
static const std::string & systemRepoAlias()
Reserved system repository alias @System .
static ZYppFactory instance()
Singleton ctor.
Wrapper class for stat/lstat.
const char * c_str() const
String representation.
std::string name() const
Repository name.
bool enabled() const
If enabled is false, then this repository must be ignored as if does not exists, except when checking...
std::string alias() const
unique identifier for this source.
Repository reposFind(const std::string &alias_r) const
Find a Repository named alias_r.
static Pool instance()
Singleton ctor.
Repository systemRepo()
Return the system repository, create it if missing.
@ LS_READONLY
// Create readonly ZYpp instance.
@ LS_NOREFRESH
// Don't refresh existing repos.
@ LS_NOREPOS
// Don't loag existing repos (just Target).
void defaultLoadSystem(const Pathname &sysRoot_r, LoadSystemFlags flags_r)
Create the ZYpp instance and load target and enabled repositories.
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
void IWantIt() ZYPP_DEPRECATED
Easy-to use interface to the ZYPP dependency resolver.
creates and provides information about known sources.
@ REFRESH_NEEDED
refresh is needed
RefreshCheckStatus checkIfToRefreshMetadata(const RepoInfo &info, const Url &url, RawMetadataRefreshPolicy policy)
bool isCached(const RepoInfo &info) const
void loadFromCache(const RepoInfo &info, OPT_PROGRESS)
void refreshMetadata(const RepoInfo &info, RawMetadataRefreshPolicy policy, OPT_PROGRESS)
void buildCache(const RepoInfo &info, CacheBuildPolicy policy, OPT_PROGRESS)
void cleanCache(const RepoInfo &info, OPT_PROGRESS)
std::list< RepoInfo > knownRepositories() const
List of known repositories.
static const RepoType RPMPLAINDIR
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
#define ZYPP_RETHROW(EXCPT)
Drops a logline and rethrows, updating the CodeLocation.
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.