https://bugzilla.novell.com/show_bug.cgi?id=369893
User ma@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=369893#c18
--- Comment #18 from Michael Andres 2008-06-03 06:41:41 MDT ---
You can find the PoolItem and select it for installation:
- Via a Selectable:
ui::Selectable::Ptr srcp(
getZYpp()->poolProxy().lookup( ResKind::srcpackage, "zypper" )
);
if ( srcp )
srcp->setStatus( S_Install );
- By iterating the pool and manually selecting some available version:
PoolItem srcp;
for_( it, pool.byIdentBegin( ResKind::srcpackage, "zypper" ),
pool.byIdentEnd( ResKind::srcpackage, "zypper" ) )
{
if ( it->status().isInstalled() )
continue;
if ( !srcp || srcp->edition() < (*it)->edition() )
srcp = *it;
}
if ( srcp )
srcp.status().setTransact( true, ResStatus::USER );
The only thing that currently does not work is trying to select the source
package via:
addRequire(
Capability(srcpkg->name(), Rel::EQ, srcpkg->edition(),
ResTraits<SrcPackage>::kind)
);
This is because a source package does not provide its "name == edition". But
this will be fixed. Capability will rewrite the capability into something the
satsolver understands.
---
@Jano:
As the current zyyper code (in zypper-misc.cc(2663):build_deps_install) already
looks up some appropriate package:
SrcPackage::constPtr srcpkg = source_find(*it);
the following should select it:
if (srcpkg)
PoolItem(srcpkg).status().setTransact( true, ResStatus::USER );
No need to drop the item you found, and ask the solver to find it again ;)
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.