26 template<
typename DlContextRefType,
typename MediaHandle>
27 auto statusLogic( DlContextRefType &&ctx, MediaHandle mediaHandle ) {
28 constexpr bool isAsync = std::is_same_v<DlContextRefType,repo::AsyncDownloadContextRef>;
31 if ( !mediaHandle.localPath().has_value() ) {
36 const auto &repoInfo = std::forward<DlContextRefType>(ctx)->repoInfo();
44 return statusLogic( std::move(dl), std::move(mediaHandle) );
49 return statusLogic( std::move(dl), std::move(mediaHandle) );
54 template<
typename DlContextRefType,
typename MediaHandle>
55 auto dlLogic( DlContextRefType &&ctx, MediaHandle mediaHandle, ProgressObserverRef progressObserver ) {
57 constexpr bool isAsync = std::is_same_v<DlContextRefType,repo::AsyncDownloadContextRef>;
62 if ( !mediaHandle.localPath().has_value() ) {
66 if ( progressObserver ) progressObserver->inc();
69 const auto &repoInfo = std::forward<DlContextRefType>(ctx)->repoInfo();
70 auto newstatus =
zypp::RepoStatus( mediaHandle.localPath().value() / repoInfo.path() );
72 zypp::Pathname productpath( std::forward<DlContextRefType>(ctx)->destDir() / repoInfo.path() );
74 newstatus.saveToCookieFile( productpath/
"cookie" );
76 if ( progressObserver ) progressObserver->setFinished();
78 }
catch (
const zypp::Exception &e ) {
90 return dlLogic( std::move(dl), std::move(mediaHandle), std::move(progressObserver) );
95 return dlLogic( std::move(dl), std::move(mediaHandle), std::move(progressObserver) );
Track changing files or directories.