[zypp-devel] Using libzypp in Qt
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? Regards,. Saurabh Sood -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org To contact the owner, e-mail: zypp-devel+owner@opensuse.org
Dne 27.3.2012 20:50, Saurabh Sood napsal(a):
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?
Regards,. Saurabh Sood
Hi, I don't know about the documentation but I'd point you to yast2-qt-pkg sources: http://svn.opensuse.org/svn/yast/trunk/qt-pkg/ yast2-qt-pkg provides the package management UI (libzypp wrapper) for yast using Qt library, I guess it could be a good starting point for you... -- Best Regards Ladislav Slezák Yast Developer ------------------------------------------------------------------------ SUSE LINUX, s.r.o. e-mail: lslezak@suse.cz Lihovarská 1060/12 tel: +420 284 028 960 190 00 Prague 9 fax: +420 284 028 951 Czech Republic http://www.suse.cz/ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org To contact the owner, e-mail: zypp-devel+owner@opensuse.org
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 <zypp/base/LogControl.h> //#include <zypp/base/LogTools.h> #include <zypp/misc/DefaultLoadSystem.h> #include <zypp/ResPool.h> 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
On 03/27/2012 08:50 PM, 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?
Regards,. Saurabh Sood
Have in mind that libzypp is supposed to be run as root. If the stuff you plan to do does not require much more than installing packages, you may consider PackageKit as a layer for the end user. -- Duncan Mac-Vicar P. - http://www.suse.com/ SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstraße 5, 90409 Nürnberg, Germany -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org To contact the owner, e-mail: zypp-devel+owner@opensuse.org
participants (4)
-
Duncan Mac-Vicar P.
-
Ladislav Slezak
-
Michael Andres
-
Saurabh Sood