[zypp-commit] r8720 - in /trunk/libzypp/zypp: RepoManager.cc RepoManager.h
![](https://seccdn.libravatar.org/avatar/88ae816389753d50e4caf334fbb92500.jpg?s=120&d=mm&r=g)
Author: visnov Date: Fri Feb 15 14:16:22 2008 New Revision: 8720 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8720&view=rev Log: - unbreak refresh - provide API for cleaning up packages Modified: trunk/libzypp/zypp/RepoManager.cc trunk/libzypp/zypp/RepoManager.h Modified: trunk/libzypp/zypp/RepoManager.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoManager.cc?rev=8720&r1=8719&r2=8720&view=diff ============================================================================== --- trunk/libzypp/zypp/RepoManager.cc (original) +++ trunk/libzypp/zypp/RepoManager.cc Fri Feb 15 14:16:22 2008 @@ -614,15 +614,10 @@ // 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; @@ -655,6 +650,16 @@ 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 ) Modified: trunk/libzypp/zypp/RepoManager.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoManager.h?rev=8720&r1=8719&r2=8720&view=diff ============================================================================== --- trunk/libzypp/zypp/RepoManager.h (original) +++ trunk/libzypp/zypp/RepoManager.h Fri Feb 15 14:16:22 2008 @@ -203,6 +203,17 @@ 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; -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org
participants (1)
-
visnov@svn.opensuse.org