14 #include <zypp-core/zyppng/io/Process> 15 #include <zypp-core/zyppng/pipelines/MTry> 16 #include <zypp-core/zyppng/pipelines/Algorithm> 17 #include <zypp-media/MediaException> 18 #include <zypp-media/ng/Provide> 19 #include <zypp-media/ng/ProvideSpec> 24 #include <zypp/ng/Context> 33 #undef ZYPP_BASE_LOGGER_LOGGROUP 34 #define ZYPP_BASE_LOGGER_LOGGROUP "zypp::repomanager" 42 template <
class Executor,
class OpType>
43 struct ProbeRepoLogic :
public LogicBase<Executor, OpType>
51 using MediaHandle =
typename ProvideType::MediaHandle;
58 ,
_path(std::move(path))
62 MaybeAsyncRef<expected<zypp::repo::RepoType>> execute( ) {
63 const auto &url =
_medium.baseUrl();
64 MIL <<
"going to probe the repo type at " << url <<
" (" <<
_path <<
")" << std::endl;
68 MIL <<
"Probed type NONE (not exists) at " << url <<
" (" <<
_path <<
")" << std::endl;
78 std::shared_ptr<ProvideType> providerRef =
_zyppContext->provider();
83 return providerRef->attachMediaIfNeeded(
_medium )
84 |
and_then([
this, providerRef]( MediaHandle medium )
88 |
and_then( maybeCopyResultToDest(
"repodata/repomd.xml") )
91 |
or_else( [
this, providerRef, medium]( std::exception_ptr err ) {
93 std::rethrow_exception (err);
98 DBG <<
"problem checking for repodata/repomd.xml file" << std::endl;
106 |
and_then( maybeCopyResultToDest(
"content") )
110 |
or_else( [
this, medium]( std::exception_ptr err ) {
113 std::rethrow_exception (err);
118 DBG <<
"problem checking for content file" << std::endl;
130 const auto &url = medium.baseUrl();
133 if ( ! ( url.schemeIsDownloading() || url.schemeIsPlugin() ) ) {
137 MIL <<
"Probed type RPMPLAINDIR at " << url <<
" (" <<
_path <<
")" << std::endl;
145 MIL <<
"Probed type NONE at " << url <<
" (" <<
_path <<
")" << std::endl;
157 auto maybeCopyResultToDest ( std::string &&subPath ) {
160 MIL <<
"Target path is set, copying " << file.file() <<
" to " << *
_targetPath/subPath << std::endl;
161 return std::move(file)
179 template <
class RefreshContextRef>
180 auto probeRepoLogic( RefreshContextRef ctx,
RepoInfo repo, std::optional<zypp::Pathname> targetPath)
184 |
and_then( [ctx, path = repo.path() ](
auto &&mediaHandle ) {
185 return probeRepoType( ctx, std::forward<decltype(mediaHandle)>(mediaHandle), path );
202 return probeRepoLogic( std::move(ctx), std::move(repo), std::move(targetPath) );
207 return probeRepoLogic( std::move(ctx), std::move(repo), std::move(targetPath) );
212 template <
class ZyppContextRef>
213 auto readRepoFileLogic( ZyppContextRef ctx,
zypp::Url repoFileUrl )
217 |
and_then([repoFileUrl](
auto local ){
218 DBG <<
"reading repo file " << repoFileUrl <<
", local path: " << local.file() << std::endl;
226 return readRepoFileLogic( std::move(ctx), std::move(repoFileUrl) );
231 return readRepoFileLogic( std::move(ctx), std::move(repoFileUrl) );
236 template<
typename Executor,
class OpType>
237 struct CheckIfToRefreshMetadataLogic :
public LogicBase<Executor, OpType> {
243 using ZyppContextRefType =
typename RefreshContextRefType::element_type::ContextRefType;
244 using ZyppContextType =
typename RefreshContextRefType::element_type::ContextType;
245 using ProvideType =
typename ZyppContextType::ProvideType;
247 using MediaHandle =
typename ProvideType::MediaHandle;
250 CheckIfToRefreshMetadataLogic( RefreshContextRefType refCtx,
LazyMediaHandle &&medium, ProgressObserverRef progressObserver )
256 MaybeAsyncRef<expected<repo::RefreshCheckStatus>> execute( ) {
258 MIL <<
"Going to CheckIfToRefreshMetadata" << std::endl;
264 MIL <<
"Check if to refresh repo " <<
_refreshContext->repoInfo().alias() <<
" at " <<
_medium.baseUrl() <<
" (" << info.type() <<
")" << std::endl;
273 if ( oldstatus.
empty() ) {
274 MIL <<
"No cached metadata, going to refresh" << std::endl;
278 if (
_medium.baseUrl().schemeIsVolatile() ) {
279 MIL <<
"Never refresh CD/DVD" << std::endl;
284 MIL <<
"Forced refresh!" << std::endl;
288 if (
_medium.baseUrl().schemeIsLocal() ) {
301 if ( oldstatus == *cachestatus ) {
304 const auto refDelay =
_refreshContext->zyppContext()->config().repo_refresh_delay();
305 if ( diff < refDelay ) {
307 WAR <<
"Repository '" << info.alias() <<
"' was refreshed in the future!" << std::endl;
310 MIL <<
"Repository '" << info.alias()
311 <<
"' has been refreshed less than repo.refresh.delay (" 313 <<
") minutes ago. Advising to skip refresh" << std::endl;
319 MIL <<
"Metadata and solv cache don't match. Check data on server..." << std::endl;
337 if ( oldstatus == newstatus ) {
338 MIL <<
"repo has not changed" << std::endl;
343 MIL <<
"repo has changed, going to refresh" << std::endl;
344 MIL <<
"Old status: " << oldstatus <<
" New Status: " << newstatus << std::endl;
372 template<
typename Executor,
class OpType>
373 struct RefreshMetadataLogic :
public LogicBase<Executor, OpType>{
380 using ZyppContextRefType =
typename RefreshContextRefType::element_type::ContextRefType;
381 using ZyppContextType =
typename RefreshContextRefType::element_type::ContextType;
382 using ProvideType =
typename ZyppContextType::ProvideType;
383 using MediaHandle =
typename ProvideType::MediaHandle;
388 using DlContextRefType = std::shared_ptr<DlContextType>;
390 RefreshMetadataLogic( RefreshContextRefType refCtx,
LazyMediaHandle &&medium, ProgressObserverRef progressObserver )
396 MaybeAsyncRef<expected<RefreshContextRefType>> execute() {
403 MIL <<
"RefreshCheckStatus returned: " << status << std::endl;
417 MIL <<
"Going to refresh metadata from " <<
_medium.baseUrl() << std::endl;
427 if ( info.type() != repokind ) {
430 info.setProbedType( repokind );
444 dlContext->setPluginRepoverification(
_refreshContext->pluginRepoverification() );
449 |
and_then([
this]( DlContextRefType && ) {
482 template <
class RefreshContextRef>
483 auto refreshMetadataLogic( RefreshContextRef refCtx, ProgressObserverRef progressObserver)
491 : rexception { info_r,
_(
"Failed to retrieve new repository metadata.") }
495 if ( rexception.historyEmpty() ) {
496 rexception.remember( old_r );
504 auto helper = std::make_shared<ExHelper>( ExHelper{ refCtx->repoInfo() } );
507 auto refreshPipeline = [ refCtx, progressObserver ](
zypp::Url url ){
509 |
and_then( [ refCtx , progressObserver](
auto mediaHandle )
mutable {
return refreshMetadata ( std::move(refCtx), std::move(mediaHandle), progressObserver ); } );
513 auto predicate = [ info = refCtx->repoInfo(), helper ](
const expected<RefreshContextRef> &res ) ->
bool{
519 ERR <<
"Giving up..." << std::endl;
520 helper->remember( e );
523 ERR <<
"Trying another url..." << std::endl;
524 helper->remember( e );
532 return refCtx->repoInfo().baseUrls()
534 | [helper]( expected<RefreshContextRef> result ) {
537 ERR <<
"No more urls..." << std::endl;
547 return refreshMetadataLogic ( std::move(refCtx), std::move(progressObserver) );
551 return refreshMetadataLogic ( std::move(refCtx), std::move(progressObserver) );
557 template <
typename ZyppCtxRef>
struct Repo2SolvOp;
560 struct Repo2SolvOp<ContextRef> :
public AsyncOp<expected<void>>
565 MIL <<
"Starting repo2solv for repo " << repo.
alias () << std::endl;
566 auto me = std::make_shared<Repo2SolvOp<ContextRef>>();
567 me->_repo = std::move(repo);
572 std::vector<const char *> argsIn;
573 argsIn.reserve ( args.size() );
574 std::for_each( args.begin (), args.end(), [&](
const std::string &s ) { argsIn.push_back(s.data()); });
575 argsIn.push_back (
nullptr);
577 if (!me->_proc->start( argsIn.data() )) {
585 const std::string &line = data.asString();
590 void procFinished(
int ret ) {
592 while (
_proc->canReadLine() )
611 struct Repo2SolvOp<SyncContextRef>
615 std::string errdetail;
618 WAR <<
" " << output;
622 int ret = prog.
close();
633 template<
typename Executor,
class OpType>
634 struct BuildCacheLogic :
public LogicBase<Executor, OpType>{
637 using ZyppContextRefType =
typename RefreshContextRefType::element_type::ContextRefType;
638 using ZyppContextType =
typename RefreshContextRefType::element_type::ContextType;
639 using ProvideType =
typename ZyppContextType::ProvideType;
640 using MediaHandle =
typename ProvideType::MediaHandle;
641 using ProvideRes =
typename ProvideType::Res;
651 MaybeAsyncRef<expected<RefreshContextRefType>> execute() {
662 const auto &options =
_refCtx->repoManagerOptions();
673 if ( raw_metadata_status.empty() )
689 WAR <<
"No permission to write raw cache " << mediarootParent << std::endl;
698 bool needs_cleaning =
false;
699 const auto &info =
_refCtx->repoInfo();
700 if (
_refCtx->repoManager()->isCached( info ) )
702 MIL << info.alias() <<
" is already cached." << std::endl;
707 if ( *cache_status == raw_metadata_status )
709 MIL << info.alias() <<
" cache is up to date with metadata." << std::endl;
723 MIL << info.alias() <<
" cache rebuild is forced" << std::endl;
727 needs_cleaning =
true;
734 auto r =
_refCtx->repoManager()->cleanCache(info);
739 MIL << info.alias() <<
" building cache..." << info.type() << std::endl;
763 switch ( repokind.
toEnum() )
773 MIL <<
"repo type is " << repokind << std::endl;
775 return mountIfRequired( repokind, info )
776 |
and_then([
this, repokind, solvfile = std::move(solvfile) ]( std::optional<MediaHandle> forPlainDirs )
mutable {
778 const auto &info =
_refCtx->repoInfo();
780 switch ( repokind.
toEnum() )
790 #ifdef ZYPP_REPO2SOLV_PATH 791 cmd.push_back( ZYPP_REPO2SOLV_PATH );
793 cmd.push_back(
zypp::PathInfo(
"/usr/bin/repo2solv" ).isFile() ?
"repo2solv" :
"repo2solv.sh" );
796 cmd.push_back(
"-o" );
797 cmd.push_back( solvfile.
asString() );
798 cmd.push_back(
"-X" );
804 cmd.push_back(
"-R" );
806 std::optional<zypp::Pathname> localPath = forPlainDirs.has_value() ? forPlainDirs->localPath() :
zypp::Pathname();
811 cmd.push_back( (*localPath / info.path().absolutename()).c_str() );
816 return Repo2SolvOp<ZyppContextRefType>::run( info, std::move(cmd) )
817 |
and_then( [
this, guard = std::move(guard), solvfile = std::move(solvfile) ]()
mutable {
819 guard.resetDispose();
829 |
and_then([
this, raw_metadata_status](){
831 return _refCtx->repoManager()->setCacheStatus(
_refCtx->repoInfo(), raw_metadata_status );
835 MIL <<
"Commit cache.." << std::endl;
840 |
or_else ( [
this]( std::exception_ptr e ) {
851 return _refCtx->zyppContext()->provider()->attachMedia( info.
url(), ProvideMediaSpec() )
852 |
and_then( [
this]( MediaHandle handle ) {
881 template<
typename Executor,
class OpType>
882 struct AddRepoLogic :
public LogicBase<Executor, OpType>{
888 AddRepoLogic( RepoManagerPtrType &&repoMgrRef,
RepoInfo &&info, ProgressObserverRef &&myProgress )
894 MaybeAsyncRef<expected<RepoInfo> > execute() {
900 MIL <<
"Try adding repo " <<
_info << std::endl;
910 DBG <<
"unknown repository type, probing" << std::endl;
919 tosave.setType(probedtype);
929 MIL <<
"done" << std::endl;
932 |
or_else( [
this]( std::exception_ptr e) {
934 MIL <<
"done" << std::endl;
958 template<
typename Executor,
class OpType>
959 struct AddReposLogic :
public LogicBase<Executor, OpType>{
964 AddReposLogic( RepoManagerPtrType &&repoMgrRef,
zypp::Url &&url, ProgressObserverRef &&myProgress )
970 MaybeAsyncRef<expected<void>> execute() {
975 |
and_then([
this]( std::list<RepoInfo> repos ) {
977 for ( std::list<RepoInfo>::const_iterator it = repos.begin();
984 if ( (*it).alias() == (*kit).alias() )
986 ERR <<
"To be added repo " << (*it).alias() <<
" conflicts with existing repo " << (*kit).alias() << std::endl;
1006 MIL <<
"Saving " << repos.size() <<
" repo" << ( repos.size() ?
"s" :
"" ) <<
" in " << repofile << std::endl;
1008 std::ofstream file(repofile.
c_str());
1015 for ( std::list<RepoInfo>::iterator it = repos.begin();
1019 MIL <<
"Saving " << (*it).alias() << std::endl;
1027 it->dumpAsIniOn(file);
1028 it->setFilepath(repofile);
1029 it->setMetadataPath( *rawCachePath );
1030 it->setPackagesPath( *pckCachePath );
1036 MIL <<
"done" << std::endl;
1062 template<
typename Executor,
class OpType>
1063 struct RefreshGeoIpLogic :
public LogicBase<Executor, OpType>{
1069 using ZyppContextType =
typename ZyppContextRefType::element_type;
1070 using ProvideType =
typename ZyppContextType::ProvideType;
1071 using MediaHandle =
typename ProvideType::MediaHandle;
1072 using ProvideRes =
typename ProvideType::Res;
1080 MaybeAsyncRef<expected<void>> execute() {
1084 if ( !
_zyppCtx->config().geoipEnabled() ) {
1085 MIL <<
"GeoIp disabled via ZConfig, not refreshing the GeoIP information." << std::endl;
1089 std::vector<std::string> hosts;
1090 for (
const auto &baseUrl :
_urls ) {
1091 const auto &host = baseUrl.getHost();
1093 hosts.push_back( host );
1098 if ( hosts.empty() ) {
1099 MIL <<
"No configured geoip URL found, not updating geoip data" << std::endl;
1106 MIL <<
"Unable to create cache directory for GeoIP." << std::endl;
1111 MIL <<
"No access rights for the GeoIP cache directory." << std::endl;
1121 auto age = std::chrono::system_clock::now() - std::chrono::system_clock::from_time_t( pi.mtime() );
1122 if ( age < std::chrono::hours(24) )
1125 MIL <<
"Removing GeoIP file for " << entry.
name <<
" since it's older than 24hrs." << std::endl;
1130 auto firstOfCb = [
this]( std::string hostname ) {
1134 MIL <<
"Skipping GeoIP request for " << hostname <<
" since a valid cache entry exists." << std::endl;
1138 MIL <<
"Query GeoIP for " << hostname << std::endl;
1147 MIL <<
"Ignoring invalid GeoIP hostname: " << hostname << std::endl;
1152 return _zyppCtx->provider()->attachMedia( url, ProvideMediaSpec() )
1153 |
and_then( [
this]( MediaHandle provideHdl ) {
return _zyppCtx->provider()->provide( provideHdl,
"/geoip", ProvideFileSpec() ); })
1154 |
inspect_err( [hostname](
const std::exception_ptr& ){
MIL <<
"Failed to query GeoIP from hostname: " << hostname << std::endl; } )
1155 |
and_then( [hostname,
this]( ProvideRes provideRes ) {
1159 constexpr
auto writeHostToFile = [](
const zypp::Pathname &fName,
const std::string &host ){
1161 out.open( fName.
asString(), std::ios_base::trunc );
1162 if ( out.is_open() ) {
1163 out << host << std::endl;
1165 MIL <<
"Failed to create/open GeoIP cache file " << fName << std::endl;
1169 std::string geoipMirror;
1172 if ( reader.seekToNode( 1,
"host" ) ) {
1173 const auto &
str = reader.nodeText().asString();
1181 MIL <<
"Storing geoIP redirection: " << hostname <<
" -> " <<
str << std::endl;
1186 MIL <<
"No host entry or empty file returned for GeoIP, remembering for 24hrs" << std::endl;
1190 MIL <<
"Empty or invalid GeoIP file, not requesting again for 24hrs" << std::endl;
1193 writeHostToFile(
_geoIPCache / hostname, geoipMirror );
1196 | []( expected<void> res ) {
return res.is_valid(); };
1199 return std::move(hosts)
1201 | [](
bool foundGeoIP ){
1204 MIL <<
"Successfully queried GeoIP data." << std::endl;
1208 MIL <<
"Failed to query GeoIP data." << std::endl;
RefreshContextRefType _refreshContext
ProgressObserverRef _progressObserver
AsyncOpRef< expected< repo::AsyncDownloadContextRef > > download(repo::AsyncDownloadContextRef dl, ProvideMediaHandle mediaHandle, ProgressObserverRef progressObserver=nullptr)
zypp::RepoStatus RepoStatus
bool empty() const
Whether the status is empty (empty checksum)
thrown when it was impossible to determine this repo type.
int assert_dir(const Pathname &path, unsigned mode)
Like 'mkdir -p'.
Listentry returned by readdir.
expected< T, E > inspect(expected< T, E > exp, Function &&f)
SignalProxy< void(int)> sigFinished()
ProgressObserverRef _myProgress
A ProvideRes object is a reference counted ownership of a resource in the cache provided by a Provide...
AsyncOpRef< expected< repo::AsyncRefreshContextRef > > refreshMetadata(repo::AsyncRefreshContextRef refCtx, LazyMediaHandle< Provide > medium, ProgressObserverRef progressObserver)
expected< std::list< RepoInfo > > repositories_in_file(const zypp::Pathname &file)
Reads RepoInfo's from a repo file.
const std::string & execError() const
Some detail telling why the execution failed, if it failed.
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
zypp::Pathname _mediarootpath
const char * c_str() const
String representation.
void addHistory(const std::string &msg_r)
Add some message text to the history.
String related utilities and Regular expression matching.
zypp::Pathname _geoIPCache
What is known about a repository.
static expected< std::decay_t< Type >, Err > make_expected_success(Type &&t)
std::optional< zypp::Pathname > _targetPath
void setHost(const std::string &host)
Set the hostname or IP in the URL authority.
std::string receiveLine()
Read one line from the input stream.
AsyncOpRef< expected< repo::AsyncRefreshContextRef > > buildCache(repo::AsyncRefreshContextRef refCtx, zypp::RepoManagerFlags::CacheBuildPolicy policy, ProgressObserverRef progressObserver)
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
ProgressObserverRef _progress
#define ZYPP_EXCPT_PTR(EXCPT)
Drops a logline and returns Exception as a std::exception_ptr.
ZyppContextRefType _zyppContext
ZyppContextRefType _zyppCtx
static zypp::repo::RepoType probeCache(const zypp::Pathname &path_r)
Probe Metadata in a local cache directory.
static expected< void > touchIndexFile(const RepoInfo &info, const RepoManagerOptions &options)
expected< zypp::Pathname > packagescache_path_for_repoinfo(const RepoManagerOptions &opt, const RepoInfo &info)
Calculates the packages cache path for a repository.
static expected< RepoStatus > metadataStatus(const RepoInfo &info, const RepoManagerOptions &options)
void remember(const Exception &old_r)
Store an other Exception as history.
ResultType or_else(const expected< T, E > &exp, Function &&f)
Url url() const
Pars pro toto: The first repository url.
Exp mtry(F &&f, Args &&...args)
zypp::repo::RepoException _error
#define ZYPP_RETHROW(EXCPT)
Drops a logline and rethrows, updating the CodeLocation.
std::string asString() const
Returns a default string representation of the Url object.
expected< zypp::Pathname > rawproductdata_path_for_repoinfo(const RepoManagerOptions &opt, const RepoInfo &info)
Calculates the raw product metadata path for a repository, this is inside the raw cache dir...
auto firstOf(Transformation &&transformFunc, DefaultType &&def, Predicate &&predicate=detail::ContinueUntilValidPredicate())
RepoManagerPtrType _repoMgrRef
Convenient building of std::string via std::ostringstream Basically a std::ostringstream autoconverti...
Execute a program and give access to its io An object of this class encapsulates the execution of an ...
void setScheme(const std::string &scheme)
Set the scheme name in the URL.
const std::string & asString() const
String representation.
std::string alias() const
unique identifier for this source.
bool isExist() const
Return whether valid stat info exists.
expected< T, E > inspect_err(expected< T, E > exp, Function &&f)
std::string asUserString() const
Translated error message as string suitable for the user.
RepoManagerRef< SyncContextRef > SyncRepoManagerRef
expected< void > assert_alias(const RepoInfo &info)
Pathname dirname() const
Return all but the last component od this path.
zypp::Pathname _productdatapath
int close() override
Wait for the progamm to complete.
#define ZYPP_ENABLE_LOGIC_BASE(Executor, OpType)
static void setup(ProgressObserverRef progress, const std::string &label=std::string(), int steps=100)
void updateSolvFileIndex(const Pathname &solvfile_r)
Create solv file content digest for zypper bash completion.
Writing the zypp history fileReference counted signleton for writhing the zypp history file...
bool isValid() const
Verifies the Url.
typename conditional< B, T, F >::type conditional_t
std::conditional_t< isAsync, AsyncOpRef< T >, T > makeReadyResult(T &&result)
std::vector< std::string > Arguments
int unlink(const Pathname &path)
Like 'unlink'.
static const RepoType NONE
static expected success(ConsParams &&...params)
void resetDispose()
Set no dispose function.
int compareCI(const C_Str &lhs, const C_Str &rhs)
thrown if the user has no permission to update(write) the caches.
static const RepoType RPMMD
#define ZYPP_CAUGHT(EXCPT)
Drops a logline telling the Exception was caught (in order to handle it).
zypp::RepoManagerFlags::CacheBuildPolicy _policy
std::shared_ptr< AsyncOp< T > > AsyncOpRef
AsyncOpRef< expected< void > > refreshGeoIPData(ContextRef ctx, RepoInfo::url_set urls)
expected< RepoStatus > cacheStatus(const RepoInfo &info) const
zypp::RepoManagerFlags::RefreshCheckStatus RefreshCheckStatus
static const RepoType YAST2
AsyncOpRef< expected< zypp::repo::RepoType > > probeRepoType(ContextRef ctx, AsyncLazyMediaHandle medium, zypp::Pathname path, std::optional< zypp::Pathname > targetPath)
RefreshContextRefType _refCtx
expected< void > assert_urls(const RepoInfo &info)
static ProgressObserverRef makeSubTask(ProgressObserverRef parentProgress, float weight=1.0, const std::string &label=std::string(), int steps=100)
AsyncOpRef< expected< zypp::RepoStatus > > repoStatus(repo::AsyncDownloadContextRef dl, ProvideMediaHandle mediaHandle)
Base class for Exception.
Date timestamp() const
The time the data were changed the last time.
const std::string & command() const
The command we're executing.
auto setProgress(ProgressObserverRef progressObserver, double progrValue, std::optional< std::string > newStr={})
Exception for repository handling.
SignalProxy< void()> sigReadyRead()
refresh is delayed due to settings
bool any_of(const Container &c, Fnc &&cb)
static Date now()
Return the current time.
std::string getPathName(EEncoding eflag=zypp::url::E_DECODED) const
Returns the path name from the URL.
Wrapper class for ::stat/::lstat.
AsyncOpRef< expected< repo::RefreshCheckStatus > > checkIfToRefreshMetadata(repo::AsyncRefreshContextRef refCtx, LazyMediaHandle< Provide > medium, ProgressObserverRef progressObserver)
RepoManagerRef< ContextRef > AsyncRepoManagerRef
static void finish(ProgressObserverRef progress, ProgressObserver::FinishResult result=ProgressObserver::Success)
ResultType and_then(const expected< T, E > &exp, Function &&f)
static const RepoType RPMPLAINDIR
expected< zypp::Pathname > rawcache_path_for_repoinfo(const RepoManagerOptions &opt, const RepoInfo &info)
Calculates the raw cache path for a repository, this is usually /var/cache/zypp/alias.
Track changing files or directories.
AsyncOpRef< expected< RepoInfo > > addRepository(AsyncRepoManagerRef mgr, RepoInfo info, ProgressObserverRef myProgress)
Repository already exists and some unique attribute can't be duplicated.
#define ZYPP_FWD_CURRENT_EXCPT()
Drops a logline and returns the current Exception as a std::exception_ptr.
Functor replacing repository variables.
AsyncOpRef< expected< std::list< RepoInfo > > > readRepoFile(ContextRef ctx, zypp::Url repoFileUrl)
int dirForEachExt(const Pathname &dir_r, const function< bool(const Pathname &, const DirEntry &)> &fnc_r)
Simiar to.
AsyncOpRef< expected< void > > addRepositories(AsyncRepoManagerRef mgr, zypp::Url url, ProgressObserverRef myProgress)
typename remove_smart_ptr< T >::type remove_smart_ptr_t
expected< zypp::Pathname > solv_path_for_repoinfo(const RepoManagerOptions &opt, const RepoInfo &info)
Calculates the solv cache path for a repository.
Repository type enumeration.
xmlTextReader based interface to iterate xml streams.
zypp::ByteArray ByteArray