On Tuesday 27 March 2012 20:50:28 Saurabh Sood wrote:
Hi,
I am starting work on the GSoC project for 'Beautiful 1-Click
install'. I need to use libzypp in a Qt Application. I have not been
able to find any documentation for it. Also, are there any examples I
could use to understand the library better?
Doc for zypp:
http://doc.opensuse.org/projects/libzypp/HEAD/
Example code :( Look at zypper, but it is huge and not always a good example.
Look at the tools/ directory in the libzypp source tree. Ask on zypp-devel.
Ask on zypp-devel. Ask on zypp-devel...
The snippet below loads all your system repos (without refresh) and prints out
all installed and available packages, patches, srcpackages,...
Learn about ResPool, PoolItem and ui::Selectable and Resolver. Then you're
almost ready to select packages, resolve dependencies and install them.
----------------------------------------------------
#include <iostream>
//#include
//#include
#include
#include
using std::endl;
int main( int argc, const char * argv[] )
try {
//zypp::base::LogControl::instance().logToStdErr();
//zypp::base::LogControl::instance().logfile( "/tmp/mylog" );
zypp::misc::defaultLoadSystem( zypp::misc::LS_NOREFRESH );
for ( const zypp::PoolItem & pi : zypp::ResPool::instance() )
{
std::cout << pi << endl;
}
return 0;
}
catch ( const zypp::Exception & exp )
{
std::cerr << exp << endl << exp.historyAsString();
throw;
}
catch (...)
{
std::cerr << "Oops!" << endl;
throw;
}
----------------------------------------------------
--
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