revision 5664 Here you can find a basic workflow working. How does it looks like? (RepoManager_test case) RepoManager manager(opts); list<RepoInfo> repos = manager.knownRepositories(); RepoInfo repo(repos.front()); manager.refreshMetadata(repo); Repository repository; try { repository = manager.createFromCache(repo); } catch ( const RepoNotCachedException &e ) { ZYPP_CAUGHT(e); MIL << "repo " << repo.alias() << " not cached yet. Caching..." << endl; manager.buildCache(repo); repository = manager.createFromCache(repo); } ResStore store = repository.resolvables(); MIL << store.size() << " resolvables" << endl; I am still getting 0 resolvables, unlike in CacheStore_test where I use a custom parse and I insert resolvables via appendResolvables, so I am not sure if it is a YUMParser bug or CacheStore bug.... will look at it. All paths are passed in the RepoManagerOptions parameter, which default to the ZYpp global paths. -- Duncan Mac-Vicar Prett Novell :: SUSE R&D, Maxfeldstr. 5, 90409 Nürnberg GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Duncan Mac-Vicar Prett wrote:
revision 5664
Here you can find a basic workflow working.
How does it looks like? (RepoManager_test case)
At the first look, nice! The only thing i would change in the code is to add RepoManager::isCached(repo) and use it to check if the repo is cached instead of catching the exception.
RepoManager manager(opts); list<RepoInfo> repos = manager.knownRepositories(); RepoInfo repo(repos.front()); manager.refreshMetadata(repo);
I'd like an additional 'force' bool arg here defaulting to false which would cause a refresh even if everything indicates that it is not needed. (for use with e.g. zypper refresh --force or --full). This could be provided through opts as well, but then we would need means to change them after RepoManager creation.
Repository repository; try { repository = manager.createFromCache(repo); } catch ( const RepoNotCachedException &e ) { ZYPP_CAUGHT(e); MIL << "repo " << repo.alias() << " not cached yet. Caching..." << endl; manager.buildCache(repo); repository = manager.createFromCache(repo); }
ResStore store = repository.resolvables(); MIL << store.size() << " resolvables" << endl;
I am still getting 0 resolvables, unlike in CacheStore_test where I use a custom parse and I insert resolvables via appendResolvables, so I am not sure if it is a YUMParser bug or CacheStore bug.... will look at it.
Weird. I use them (look at devel/devel.jkupec/YUMParser_test.cc) and i get the database stuffed with resolvables. But, i can't see anything in the code that would actually populate the ResStore :O) Thought the manager.createFromCache() should do it but it just creates a Repository object and does nothing in the constructor except members' initialization from passed params. Im a missing something? Nope. You are not calling repository.createResolvables() anywhere :O) Commited, check it out now.
All paths are passed in the RepoManagerOptions parameter, which default to the ZYpp global paths.
This is nice. Jano -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Monday 04 June 2007 17:39:57 Jan Kupec wrote:
The only thing i would change in the code is to add RepoManager::isCached(repo) and use it to check if the repo is cached instead of catching the exception.
Yes. I agree.
I'd like an additional 'force' bool arg here defaulting to false which would cause a refresh even if everything indicates that it is not needed. (for use with e.g. zypper refresh --force or --full).
good point. I would use either a RefreshOpts class or a different method. We have bad experience with bool parameters as flag to change behavior.
Nope. You are not calling repository.createResolvables() anywhere :O) Commited, check it out now.
Thanks. This has to be done in the RepostoryImpl resolvables() call.
All paths are passed in the RepoManagerOptions parameter, which default to the ZYpp global paths.
Yeah, designed to be tested. When you test, you always want to use TmpDirs everywhere. -- Duncan Mac-Vicar Prett Novell :: SUSE R&D, Maxfeldstr. 5, 90409 Nürnberg GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Dňa Ut 5. Jún 2007 10:06 Duncan Mac-Vicar Prett napísal:
On Monday 04 June 2007 17:39:57 Jan Kupec wrote:
The only thing i would change in the code is to add RepoManager::isCached(repo) and use it to check if the repo is cached instead of catching the exception.
Yes. I agree.
I'd like an additional 'force' bool arg here defaulting to false which would cause a refresh even if everything indicates that it is not needed. (for use with e.g. zypper refresh --force or --full).
good point. I would use either a RefreshOpts class or a different method. We have bad experience with bool parameters as flag to change behavior.
Nope. You are not calling repository.createResolvables() anywhere :O) Commited, check it out now.
Thanks. This has to be done in the RepostoryImpl resolvables() call.
All paths are passed in the RepoManagerOptions parameter, which default to the ZYpp global paths.
Yeah, designed to be tested. When you test, you always want to use TmpDirs everywhere.
And installation, I hope. Stano -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
participants (3)
-
Duncan Mac-Vicar Prett
-
Jan Kupec
-
Stanislav Visnovsky