Author: dmacvicar Date: Fri Apr 4 18:50:42 2008 New Revision: 9387 URL: http://svn.opensuse.org/viewcvs/zypp?rev=9387&view=rev Log: reload target, backup Modified: trunk/libzypp/zypp/Target.cc trunk/libzypp/zypp/Target.h trunk/libzypp/zypp/target/TargetImpl.cc trunk/libzypp/zypp/target/TargetImpl.h trunk/libzypp/zypp/zypp_detail/ZYppImpl.cc Modified: trunk/libzypp/zypp/Target.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Target.cc?rev=9387&r1=9386&r2=9387&view=diff ============================================================================== --- trunk/libzypp/zypp/Target.cc (original) +++ trunk/libzypp/zypp/Target.cc Fri Apr 4 18:50:42 2008 @@ -70,6 +70,9 @@ void Target::load() { _pimpl->load(); } + void Target::unload() + { _pimpl->unload(); } + target::rpm::RpmDb & Target::rpmDb() { return _pimpl->rpm(); } Modified: trunk/libzypp/zypp/Target.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Target.h?rev=9387&r1=9386&r2=9387&view=diff ============================================================================== --- trunk/libzypp/zypp/Target.h (original) +++ trunk/libzypp/zypp/Target.h Fri Apr 4 18:50:42 2008 @@ -64,6 +64,12 @@ */ void load(); + /** + * unload target resolvables from the + * pool + */ + void unload(); + /** \deprecated NOOP */ ZYPP_DEPRECATED void reset() {} Modified: trunk/libzypp/zypp/target/TargetImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/target/TargetImpl.cc?rev=9387&r1=9386&r2=9387&view=diff ============================================================================== --- trunk/libzypp/zypp/target/TargetImpl.cc (original) +++ trunk/libzypp/zypp/target/TargetImpl.cc Fri Apr 4 18:50:42 2008 @@ -320,6 +320,14 @@ } } + void TargetImpl::unload() + { + sat::Pool satpool( sat::Pool::instance() ); + Repository system( satpool.systemRepo() ); + system.eraseFromPool(); + } + + void TargetImpl::load() { buildCache(); Modified: trunk/libzypp/zypp/target/TargetImpl.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/target/TargetImpl.h?rev=9387&r1=9386&r2=9387&view=diff ============================================================================== --- trunk/libzypp/zypp/target/TargetImpl.h (original) +++ trunk/libzypp/zypp/target/TargetImpl.h Fri Apr 4 18:50:42 2008 @@ -70,6 +70,8 @@ void load(); + void unload(); + void clearCache(); void buildCache(); Modified: trunk/libzypp/zypp/zypp_detail/ZYppImpl.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/zypp_detail/ZYppImpl.cc?rev=9387&r1=9386&r2=9387&view=diff ============================================================================== --- trunk/libzypp/zypp/zypp_detail/ZYppImpl.cc (original) +++ trunk/libzypp/zypp/zypp_detail/ZYppImpl.cc Fri Apr 4 18:50:42 2008 @@ -31,7 +31,7 @@ { ///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// namespace zypp_detail - { ///////////////////////////////////////////////////////////////// + { ///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// // @@ -95,14 +95,13 @@ { MIL << "initTarget( " << root << endl; if (_target) { - if (_target->root() == root) { - MIL << "Repeated call to initializeTarget()" << endl; - return; - } -#warning NEED SOME NEW WAY TO INDICATE NEDD OF TARGET RELOAD -#if 0 - removeInstalledResolvables( ); -#endif + if (_target->root() == root) { + MIL << "Repeated call to initializeTarget()" << endl; + return; + } + + _target->unload(); + } _target = new Target( root ); _target->buildCache(); @@ -110,11 +109,9 @@ void ZYppImpl::finishTarget() { -#warning NEED SOME NEW WAY TO UNLOAD THE POOL -#if 0 if (_target) - removeInstalledResolvables(); -#endif + _target->unload(); + _target = 0; } @@ -137,19 +134,17 @@ ZYppCommitResult res = _target->_pimpl->commit( pool(), policy_r ); if (! policy_r.dryRun() ) { - // Tag target data invalid, so they are reloaded on the next call to - // target->resolvables(). Actually the target should do this without - // foreign help. - _target->reset(); -#warning NEED SOME NEW WAY TO INDICATE NEDD OF TARGET RELOAD -#if 0 - removeInstalledResolvables(); + + DBG << "unloading " << sat::Pool::instance().systemRepoName() << " repo from pool" << endl; + + _target->unload(); + if ( policy_r.syncPoolAfterCommit() ) { // reload new status from target - addResolvables( _target->resolvables(), true ); + DBG << "reloading " << sat::Pool::instance().systemRepoName() << " repo to pool" << endl; + _target->load(); } -#endif } MIL << "Commit (" << policy_r << ") returned: " -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org