From: Martin Vidner Date: Thu, 11 May 2006 08:50:06 +0000 (+0000) Subject: - SourceManager: moved source deletion before creation X-Git-Tag: BASE-SuSE-SLE-10-SP2-Branch~818 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9272a3678e496ca134a24b34dc2796412b2c6867;p=platform%2Fupstream%2Flibzypp.git - SourceManager: moved source deletion before creation so that we can recreate a deleted one (#174295) - r3362 --- diff --git a/package/libzypp.changes b/package/libzypp.changes index cd14b70..2f388e9 100644 --- a/package/libzypp.changes +++ b/package/libzypp.changes @@ -1,8 +1,11 @@ ------------------------------------------------------------------- -Thu May 11 10:40:21 CEST 2006 - mvidner@suse.cz +Thu May 11 10:49:36 CEST 2006 - mvidner@suse.cz +- SourceManager: moved source deletion before creation + so that we can recreate a deleted one (#174295) - removed dead code dealing with known_caches from SourceManager::store (see r3195) +- r3362 ------------------------------------------------------------------- Thu May 11 10:15:14 CEST 2006 - jsrain@suse.cz diff --git a/zypp/SourceManager.cc b/zypp/SourceManager.cc index 0a00ea0..89bfe85 100644 --- a/zypp/SourceManager.cc +++ b/zypp/SourceManager.cc @@ -267,6 +267,17 @@ namespace zypp MIL << "Created..." << topdir << std::endl; } + // delete before modifying and creating + // so that we can recreate a deleted one (#174295) + for( SourceMap::iterator it = _deleted_sources.begin(); it != _deleted_sources.end(); it++) + { + MIL << "Deleting source " << it->second << " from persistent store" << endl; + store.deleteSource( it->second.alias() ); + filesystem::recursive_rmdir( it->second.cacheDir() ); + } + + _deleted_sources.clear(); + for( SourceMap::iterator it = _sources.begin(); it != _sources.end(); it++) { storage::PersistentStorage::SourceData descr; @@ -304,15 +315,6 @@ namespace zypp store.storeSource( descr ); } - for( SourceMap::iterator it = _deleted_sources.begin(); it != _deleted_sources.end(); it++) - { - MIL << "Deleting source " << it->second << " from persistent store" << endl; - store.deleteSource( it->second.alias() ); - filesystem::recursive_rmdir( it->second.cacheDir() ); - } - - _deleted_sources.clear(); - MIL << "SourceManager store done." << endl; }