[zypp-devel] Means to install a SRPM

Hi all, Say I have a reference to a Package object (or, if it makes it easier, a ResObject, or an ui::Selectable one). What is the best way to get a reference to the related SrcPackage object? Should I do a query for the Package name attribute within the SrcPackage pool? Thanks, Ricardo ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org

On 09/04/2010 02:57 AM, Ricardo Cruz wrote:
Hi all,
Say I have a reference to a Package object (or, if it makes it easier, a ResObject, or an ui::Selectable one). What is the best way to get a reference to the related SrcPackage object?
Should I do a query for the Package name attribute within the SrcPackage pool?
Hi! Yes, you can get the SrcPackage only from the pool, e.g. using one of ResPoolProxy::lookup method to get a Selectable and from it the highest-version source resolvable, which you can cast to SrcPackage. The Package class has sourcPkg* methods to get its name, edition, type and all of them in one string, but no method to get corresponding SrcPackage: http://gitorious.org/opensuse/libzypp/blobs/master/zypp/Package.h Install it via Zypp::installSrcPackage(srcpkg) It's also possible to install a source package *with* its build deps by simply adding a source package capability requirement for solver: Capability cap( srcpkg->name(), Rel::EQ, srcpkg->edition(), ResKind::srcpackage); getZYpp()->resolver()->addRequire(cap); ... and solve & commit HTH -- cheers, jano Ján Kupec YaST team ---------------------------------------------------------(PGP)--- Key ID: 637EE901 Fingerprint: 93B9 C79B 2D20 51C3 800B E09B 8048 46A6 637E E901 ---------------------------------------------------------(IRC)--- Server: irc.freenode.net Nick: jniq Channels: #zypp #yast #suse #susecz ---------------------------------------------------------(EOF)---

Will be doing that. Thanks, Jano! Cheers, Ricardo ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
participants (2)
-
Jano Kupec
-
Ricardo Cruz