[zypp-devel] Reset [Erase all PoolItems in] ResPool (sat::pool)

Hello, 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. Problem: 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, Shalom -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org To contact the owner, e-mail: zypp-devel+owner@opensuse.org

On Sunday 10 July 2016 00:04:02 Shalom Ray wrote:
It is supposed to be
+++++++++++++++ init pool +++++++++++++++++++++++ ResPool sat::pool(SERIAL(0))[2]{0repos|0slov} ResObjects: 0 =+++++++++++++++++++++++++++++++++++++++++++++++=
to ensure no unwanted conflicts.
Problem: 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();
That's fine. -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres SUSE LINUX GmbH, Development, ma@suse.com Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 74 053-0 +------------------------------------------------------------------+ SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org To contact the owner, e-mail: zypp-devel+owner@opensuse.org
participants (2)
-
Michael Andres
-
Shalom Ray