11 #include <zypp-core/ng/ui/ProgressObserver> 12 #include <zypp-media/ng/ProvideSpec> 13 #include <zypp/ng/Context> 19 #undef ZYPP_BASE_LOGGER_LOGGROUP 20 #define ZYPP_BASE_LOGGER_LOGGROUP "zypp::repomanager" 27 if ( !mediaHandle.
localPath().has_value() ) {
32 const auto &repoInfo = std::forward<repo::DownloadContextRef>(ctx)->repoInfo();
40 return statusLogic( std::move(dl), std::move(mediaHandle) );
44 auto dlLogic( repo::DownloadContextRef &&ctx,
ProvideMediaHandle mediaHandle, ProgressObserverRef progressObserver ) {
49 if ( !mediaHandle.
localPath().has_value() ) {
53 if ( progressObserver ) progressObserver->inc();
56 const auto &repoInfo = std::forward<repo::DownloadContextRef>(ctx)->repoInfo();
59 zypp::Pathname productpath( std::forward<repo::DownloadContextRef>(ctx)->destDir() / repoInfo.path() );
61 newstatus.saveToCookieFile( productpath/
"cookie" );
63 if ( progressObserver ) progressObserver->setFinished();
71 return makeReadyTask<Ret>( Ret::success( std::forward<repo::DownloadContextRef>(ctx) ) );
75 MaybeAwaitable<expected<repo::DownloadContextRef> >
download(repo::DownloadContextRef dl,
ProvideMediaHandle mediaHandle, ProgressObserverRef progressObserver)
77 return dlLogic( std::move(dl), std::move(mediaHandle), std::move(progressObserver) );
zypp::RepoStatus RepoStatus
int assert_dir(const Pathname &path, unsigned mode)
Like 'mkdir -p'.
#define ZYPP_EXCPT_PTR(EXCPT)
Drops a logline and returns Exception as a std::exception_ptr.
MaybeAwaitable< expected< repo::DownloadContextRef > > download(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle, ProgressObserverRef progressObserver)
static expected success(ConsParams &&...params)
#define ZYPP_CAUGHT(EXCPT)
Drops a logline telling the Exception was caught (in order to handle it).
Base class for Exception.
#define ZYPP_FWD_CURRENT_EXCPT()
Drops a logline and returns the current Exception as a std::exception_ptr.
MaybeAwaitable< expected< zypp::RepoStatus > > repoStatus(repo::DownloadContextRef dl, ProvideMediaHandle mediaHandle)