I'm Shalom working on one-click-installer as part of GSoC, 2016.
Following is a problem I've encountered while installing packages
using Libzypp API.

A bit of background information:

OCI, in order to *display* information about packages listed in its
specification file (.ymp), loads specific repository(ies) temporarily
and uses PoolQuery API to query meta-data such as installedSize(),
repository(), and so on.

>> scoped_ptr<RepoManager> ZypperUtils::s_repoManager( new RepoManager( 
>> Pathname( "/tmp" ) ) );
>> initListedRepos() //loads only specific repos into pool/cache
>> PoolQuery q;
>> q.addKind( ResKind::package );
>> q.addAttribute( sat::SolvAttr::name, packageName );
>> q.setMatchExact();
>> return packageObject( q );

While installing packages, ResPool contains the temporary PoolItems
which are no longer needed alongside the required PoolItems (from
enabled repos).
Following is the output before loading the enabled repositories to
resolve missing dependencies of a package -

+++++++++++++++ init pool +++++++++++++++++++++++
ResPool sat::pool(SERIAL(1))[356]{1repos|354slov}
 ResObjects: 354
 package:      332
 pattern:      1
 srcpackage:   21

It is supposed to be

+++++++++++++++ init pool +++++++++++++++++++++++
ResPool sat::pool(SERIAL(0))[2]{0repos|0slov}
 ResObjects: 0

to ensure no unwanted conflicts.

So, is there a way to reset the sat pool before loading the enabled
repos? I'm using the following code but wondering if there's a much
better way to do it.

>> Repository repo = s_zypp->pool().reposFind( "temp" );  // temp (alias) is 
>> the repo loaded into pool for temporary use
>> repo.eraseFromPool();

Have a nice day.

Best regards,
To unsubscribe, e-mail: zypp-devel+unsubscr...@opensuse.org
To contact the owner, e-mail: zypp-devel+ow...@opensuse.org

Reply via email to