// ok we have the metadata, now exchange
// the contents
- // first, clean up the old rawcache metadata
- // #FIXME
- // now, move the new metadata in
- // #FIXME
-
- //TmpDir oldmetadata( TmpDir::makeSibling( rawpath ) );
- //filesystem::rename( rawpath, oldmetadata.path() );
- // move the just downloaded there
- //filesystem::rename( tmpdir.path(), rawpath );
+ TmpDir oldmetadata( TmpDir::makeSibling( rawpath ) );
+ filesystem::rename( rawpath, oldmetadata.path() );
+ move the just downloaded there
+ filesystem::rename( tmpdir.path(), rawpath );
// we are done.
return;
progress.toMax();
}
+ void RepoManager::cleanPackages( const RepoInfo &info,
+ const ProgressData::ReceiverFnc & progressfnc )
+ {
+ ProgressData progress(100);
+ progress.sendTo(progressfnc);
+
+ filesystem::recursive_rmdir(packagescache_path_for_repoinfo(_pimpl->options, info));
+ progress.toMax();
+ }
+
void RepoManager::buildCache( const RepoInfo &info,
CacheBuildPolicy policy,
const ProgressData::ReceiverFnc & progressrcv )
const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
/**
+ * \short Clean local package cache
+ *
+ * Empty local directory with downloaded packages
+ *
+ * \throws repo::RepoNoAliasException if can't figure an alias
+ * \throws Exception on unknown error.
+ */
+ void cleanPackages( const RepoInfo &info,
+ const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
+
+ /**
* \short Status of metadata cache
*/
RepoStatus cacheStatus( const RepoInfo &info ) const;