23 template<
typename DlContextRefType,
typename MediaHandle>
24 auto statusLogic( DlContextRefType &&ctx, MediaHandle mediaHandle ) {
25 constexpr bool isAsync = std::is_same_v<DlContextRefType,repo::AsyncDownloadContextRef>;
28 if ( !mediaHandle.localPath().has_value() ) {
33 const auto &repoInfo = std::forward<DlContextRefType>(ctx)->repoInfo();
41 return statusLogic( std::move(dl), std::move(mediaHandle) );
46 return statusLogic( std::move(dl), std::move(mediaHandle) );
51 template<
typename DlContextRefType,
typename MediaHandle>
52 auto dlLogic( DlContextRefType &&ctx, MediaHandle mediaHandle, ProgressObserverRef progressObserver ) {
54 constexpr bool isAsync = std::is_same_v<DlContextRefType,repo::AsyncDownloadContextRef>;
59 if ( !mediaHandle.localPath().has_value() ) {
63 if ( progressObserver ) progressObserver->inc();
66 const auto &repoInfo = std::forward<DlContextRefType>(ctx)->repoInfo();
67 auto newstatus =
zypp::RepoStatus( mediaHandle.localPath().value() / repoInfo.path() );
69 zypp::Pathname productpath( std::forward<DlContextRefType>(ctx)->destDir() / repoInfo.path() );
71 newstatus.saveToCookieFile( productpath/
"cookie" );
73 if ( progressObserver ) progressObserver->setFinished();
87 return dlLogic( std::move(dl), std::move(mediaHandle), std::move(progressObserver) );
92 return dlLogic( std::move(dl), std::move(mediaHandle), std::move(progressObserver) );
Track changing files or directories.