Mailinglist Archive: zypp-devel (116 mails)

< Previous Next >
[zypp-devel] Re: RepoManager [was: status 04.06]
  • From: Jan Kupec <jkupec@xxxxxxx>
  • Date: Mon, 04 Jun 2007 17:39:57 +0200
  • Message-id: <4664324D.7030207@xxxxxxx>
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@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx

< Previous Next >