[zypp-devel] libzypp related queries
Hi, I am trying to implement an application in C++ to add a repository (as part of GSoC for Beautiful 1 Click install). I wanted to know which all classes I should look at in the documentation. I was initially trying to implement the same using PackageKit, but it doesnt support adding repositories. Hoping to hear soon, Regards,. Saurabh -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org To contact the owner, e-mail: zypp-devel+owner@opensuse.org
On Sunday 01 April 2012 17:47:23 Saurabh Sood wrote:
Hi, I am trying to implement an application in C++ to add a repository (as part of GSoC for Beautiful 1 Click install). I wanted to know which all classes I should look at in the documentation. I was initially trying to implement the same using PackageKit, but it doesnt support adding repositories.
Checkout the libzypp sorces. Look at tools/ToolScanRepos.cc and tests/lib/TestSetup.h. Follow ToolScanRepos.cc calling test.loadRepo(..) in TestSetup.h. This will show you the basic way of taking a URL or path to a local directory with .rpms, creating a zypp::RepoInfo from it and finally passing this to the zypp::RepoManager in order to add the repo, download the matadata, build the local cache and finally loading the data into then zypp::ResPool , so you can query or or install the packages provided by your repo. -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres SUSE LINUX Products GmbH, Development, ma@suse.de GF:Jeff Hawn,Jennifer Guild,Felix Imendörffer, HRB16746(AG Nürnberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org To contact the owner, e-mail: zypp-devel+owner@opensuse.org
Dne 1.4.2012 17:47, Saurabh Sood napsal(a):
Hi, I am trying to implement an application in C++ to add a repository (as part of GSoC for Beautiful 1 Click install). I wanted to know which all classes I should look at in the documentation. I was initially trying to implement the same using PackageKit, but it doesnt support adding repositories.
Um... well, it's not officially documented because I have added it as a libzypp backend extension to PackageKit, but it actually _can_ add a new repo. (We need that functionality for Webyast.) The trick is using RepoSetData DBus function with [<id>, 'add', <url>] parameter. This will create a new repository. You need to set the name, priority, etc... via additional calls. See the webyast code example here: https://github.com/webyast/webyast/blob/master/plugins/software/app/models/r... -- Ladislav Slezák Appliance department / YaST Developer Lihovarská 1060/12 190 00 Prague 9 / Czech Republic tel: +420 284 028 960 lslezak@suse.com SUSE -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org To contact the owner, e-mail: zypp-devel+owner@opensuse.org
participants (3)
-
Ladislav Slezak
-
Michael Andres
-
Saurabh Sood