Author: coolo
Date: Fri Feb 15 11:46:16 2008
New Revision: 44491
URL: http://svn.opensuse.org/viewcvs/yast?rev=44491&view=rev
Log:
Duncan's port to latest libzypp
Modified:
trunk/pkg-bindings/src/Callbacks.cc
trunk/pkg-bindings/src/Locale.cc
trunk/pkg-bindings/src/Package.cc
trunk/pkg-bindings/src/PkgFunctions.h
trunk/pkg-bindings/src/Resolvable_Install.cc
trunk/pkg-bindings/src/Resolvable_Properties.cc
trunk/pkg-bindings/src/Selection.cc
trunk/pkg-bindings/src/Source_Resolvables.cc
trunk/pkg-bindings/src/Target.cc
trunk/pkg-bindings/src/Target_Load.cc
Modified: trunk/pkg-bindings/src/Callbacks.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Callbacks.cc?rev=44491&r1=44490&r2=44491&view=diff
==============================================================================
--- trunk/pkg-bindings/src/Callbacks.cc (original)
+++ trunk/pkg-bindings/src/Callbacks.cc Fri Feb 15 11:46:16 2008
@@ -31,11 +31,12 @@
#include "Callbacks.YCP.h" // PkgFunctions::CallbackHandler::YCPCallbacks
#include "GPGMap.h"
-#include
-#include
-#include
-#include
-#include
+#include "zypp/ZYppCallbacks.h"
+#include "zypp/Package.h"
+#include "zypp/Patch.h"
+#include "zypp/KeyRing.h"
+#include "zypp/PublicKey.h"
+#include "zypp/Digest.h"
// FIXME: do this nicer, source create use this to avoid user feedback
// on probing of source type
Modified: trunk/pkg-bindings/src/Locale.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Locale.cc?rev=44491&r1=44490&r2=44491&view=diff
==============================================================================
--- trunk/pkg-bindings/src/Locale.cc (original)
+++ trunk/pkg-bindings/src/Locale.cc Fri Feb 15 11:46:16 2008
@@ -75,7 +75,7 @@
zypp::Locale loc = zypp::Locale(locale->value());
// add packages for the preferred locale, preserve additional locales
- zypp::ZYpp::LocaleSet lset = zypp_ptr()->getRequestedLocales();
+ zypp::LocaleSet lset = zypp_ptr()->getRequestedLocales();
// remove the previous locale
if (preferred_locale != zypp::Locale::noCode)
@@ -180,7 +180,7 @@
YCPValue
PkgFunctions::SetAdditionalLocales (const YCPList &langycplist)
{
- zypp::ZYpp::LocaleSet lset;
+ zypp::LocaleSet lset;
int i = 0;
while (i < langycplist->size())
@@ -228,9 +228,9 @@
try
{
- zypp::ZYpp::LocaleSet lset = zypp_ptr()->getRequestedLocales();
+ zypp::LocaleSet lset = zypp_ptr()->getRequestedLocales();
- for (zypp::ZYpp::LocaleSet::const_iterator it = lset.begin();
+ for (zypp::LocaleSet::const_iterator it = lset.begin();
it != lset.end(); ++it)
{
// ignore the main locale
Modified: trunk/pkg-bindings/src/Package.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Package.cc?rev=44491&r1=44490&r2=44491&view=diff
==============================================================================
--- trunk/pkg-bindings/src/Package.cc (original)
+++ trunk/pkg-bindings/src/Package.cc Fri Feb 15 11:46:16 2008
@@ -44,7 +44,7 @@
#include
#include
#include
-#include
+//#include
#include <fstream>
#include <sstream>
@@ -392,7 +392,7 @@
struct CaIMatch
{
- zypp::PoolItem_Ref item;
+ zypp::PoolItem item;
bool operator() (const zypp::CapAndItem & cai )
{
@@ -603,7 +603,7 @@
struct ProvideProcess
{
- zypp::PoolItem_Ref item;
+ zypp::PoolItem item;
zypp::Arch _architecture;
zypp::ResStatus::TransactByValue whoWantsIt;
std::string version;
@@ -858,9 +858,9 @@
struct ItemMatch
{
- zypp::PoolItem_Ref item;
+ zypp::PoolItem item;
- bool operator() (const zypp::PoolItem_Ref i )
+ bool operator() (const zypp::PoolItem i )
{
item = i;
return false;
@@ -868,7 +868,7 @@
};
static zypp::Package::constPtr
-find_package( const string & name, zypp::PoolItem_Ref & item, zypp::ResPool pool )
+find_package( const string & name, zypp::PoolItem & item, zypp::ResPool pool )
{
if (name.empty())
return NULL;
@@ -882,7 +882,7 @@
pool.byNameEnd( name ),
zypp::functor::chain( zypp::resfilter::ByUninstalled(),
zypp::resfilter::ByKind( zypp::ResTraitszypp::Package::kind ) ),
- zypp::functor::functorRef( match ) );
+ zypp::functor::functorRef( match ) );
// if no match yet, try again with installed package
// (but those only provide an english summary)
@@ -892,7 +892,7 @@
pool.byNameEnd( name ),
zypp::functor::chain( zypp::resfilter::ByInstalled(),
zypp::resfilter::ByKind( zypp::ResTraitszypp::Package::kind ) ),
- zypp::functor::functorRef( match ) );
+ zypp::functor::functorRef( match ) );
}
if (!match.item)
@@ -920,7 +920,7 @@
{
try
{
- zypp::PoolItem_Ref item;
+ zypp::PoolItem item;
zypp::Package::constPtr pkg = find_package( p->value(), item, zypp_ptr()->pool() );
if (pkg == NULL)
@@ -955,7 +955,7 @@
{
try
{
- zypp::PoolItem_Ref item;
+ zypp::PoolItem item;
zypp::Package::constPtr pkg = find_package( p->value(), item, zypp_ptr()->pool() );
if (pkg == NULL)
@@ -989,7 +989,7 @@
{
try
{
- zypp::PoolItem_Ref item;
+ zypp::PoolItem item;
zypp::Package::constPtr pkg = find_package( p->value(), item, zypp_ptr()->pool() );
if (pkg == NULL)
@@ -1023,7 +1023,7 @@
{
try
{
- zypp::PoolItem_Ref item;
+ zypp::PoolItem item;
zypp::Package::constPtr pkg = find_package( p->value(), item, zypp_ptr()->pool() );
if (pkg == NULL)
@@ -1042,7 +1042,7 @@
YCPValue
-PkgFunctions::PkgProp( zypp::PoolItem_Ref item )
+PkgFunctions::PkgProp( zypp::PoolItem item )
{
YCPMap data;
zypp::Package::constPtr pkg = zypp::asKindzypp::Package( item.resolvable() );
@@ -1107,7 +1107,7 @@
try
{
YCPMap data;
- zypp::PoolItem_Ref item;
+ zypp::PoolItem item;
zypp::Package::constPtr pkg = find_package( p->value(), item, zypp_ptr()->pool() );
if (item)
@@ -1152,7 +1152,7 @@
YCPValue
PkgFunctions::GetPkgLocation (const YCPString& p, bool full_path)
{
- zypp::PoolItem_Ref item;
+ zypp::PoolItem item;
try
{
@@ -2107,47 +2107,7 @@
YCPBoolean
PkgFunctions::PkgEstablish ()
{
- bool result = false;
-
- try
- {
- result = zypp_ptr()->resolver()->establishPool();
- }
- catch (const zypp::Exception& excpt)
- {
- y2error("An error occurred during Pkg::PkgEstablish.");
- _last_error.setLastError(excpt.asUserString(), "See /var/log/YaST2/badlist for more information.");
- }
-
- // save information about failed dependencies to file
- if (!result)
- {
- try
- {
- zypp::ResolverProblemList problems = zypp_ptr()->resolver()->problems();
- int problem_size = problems.size();
-
- if (problem_size > 0)
- {
- y2error ("PkgSolve: %d packages failed (see /var/log/YaST2/badlist)", problem_size);
-
- std::ofstream out ("/var/log/YaST2/badlist");
-
- out << problem_size << " packages failed" << std::endl;
- for(zypp::ResolverProblemList::const_iterator p = problems.begin();
- p != problems.end(); ++p )
- {
- out << (*p)->description() << std::endl;
- }
- }
- }
- catch (...)
- {
- return YCPBoolean(false);
- }
- }
-
- return YCPBoolean(result);
+ return YCPBoolean(false);
}
@@ -2167,47 +2127,7 @@
YCPBoolean
PkgFunctions::PkgFreshen()
{
- bool result = false;
-
- try
- {
- result = zypp_ptr()->resolver()->freshenPool();
- }
- catch (const zypp::Exception& excpt)
- {
- y2error("An error occurred during Pkg::PkgFreshen.");
- _last_error.setLastError(excpt.asUserString(), "See /var/log/YaST2/badlist for more information.");
- }
-
- // save information about failed dependencies to file
- if (!result)
- {
- try
- {
- zypp::ResolverProblemList problems = zypp_ptr()->resolver()->problems();
- int problem_size = problems.size();
-
- if (problem_size > 0)
- {
- y2error ("PkgSolve: %d packages failed (see /var/log/YaST2/badlist)", problem_size);
-
- std::ofstream out ("/var/log/YaST2/badlist");
-
- out << problem_size << " packages failed" << std::endl;
- for(zypp::ResolverProblemList::const_iterator p = problems.begin();
- p != problems.end(); ++p )
- {
- out << (*p)->description() << std::endl;
- }
- }
- }
- catch (...)
- {
- return YCPBoolean(false);
- }
- }
-
- return YCPBoolean(result);
+ return YCPBoolean(true);
}
@@ -2225,30 +2145,21 @@
YCPBoolean
PkgFunctions::PkgSolveCheckTargetOnly()
{
- // create pool just with objects from target
- zypp::ResStore store;
-
try
{
- store = zypp_ptr()->target()->resolvables();
+ zypp_ptr()->target()->load();
}
catch (...)
{
return YCPBoolean(false);
}
- zypp::ResPoolManager pool;
- pool.insert(store.begin(), store.end(), true);
-
- // create resolver
- zypp::Resolver solver(pool.accessor());
-
bool result = false;
try
{
// verify consistency of system
- result = solver.verifySystem();
+ result = zypp_ptr()->resolver()->verifySystem();
}
catch (const zypp::Exception& excpt)
{
@@ -2357,8 +2268,6 @@
resolvable->add (YCPString ("kind"), YCPSymbol ("product"));
else if (zypp::isKindzypp::Pattern(it->resolvable()))
resolvable->add (YCPString ("kind"), YCPSymbol ("pattern"));
- else if (zypp::isKindzypp::Selection(it->resolvable()))
- resolvable->add (YCPString ("kind"), YCPSymbol ("selection"));
else if (zypp::isKindzypp::Script(it->resolvable()))
resolvable->add (YCPString ("kind"), YCPSymbol ("script"));
else if (zypp::isKindzypp::Message(it->resolvable()))
@@ -2586,7 +2495,7 @@
// get partitioning
zypp::DiskUsageCounter::MountPointSet mps = zypp_ptr()->getPartitions();
- zypp::PoolItem_Ref item;
+ zypp::PoolItem item;
zypp::Package::constPtr pkg = find_package(package->value(), item, zypp_ptr()->pool() );
// the package was not found
Modified: trunk/pkg-bindings/src/PkgFunctions.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/PkgFunctions.h?rev=44491&r1=44490&r2=44491&view=diff
==============================================================================
--- trunk/pkg-bindings/src/PkgFunctions.h (original)
+++ trunk/pkg-bindings/src/PkgFunctions.h Fri Feb 15 11:46:16 2008
@@ -113,7 +113,7 @@
std::string UniqueAlias(const std::string &alias);
YCPValue GetPkgLocation(const YCPString& p, bool full_path);
- YCPValue PkgProp( zypp::PoolItem_Ref item );
+ YCPValue PkgProp( zypp::PoolItem item );
YCPValue PkgMediaSizesOrCount (bool sizes);
bool aliasExists(const std::string &alias) const;
Modified: trunk/pkg-bindings/src/Resolvable_Install.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Resolvable_Install.cc?rev=44491&r1=44490&r2=44491&view=diff
==============================================================================
--- trunk/pkg-bindings/src/Resolvable_Install.cc (original)
+++ trunk/pkg-bindings/src/Resolvable_Install.cc Fri Feb 15 11:46:16 2008
@@ -65,9 +65,6 @@
else if ( req_kind == "package" ) {
kind = zypp::ResTraitszypp::Package::kind;
}
- else if ( req_kind == "selection" ) {
- kind = zypp::ResTraitszypp::Selection::kind;
- }
else if ( req_kind == "pattern" ) {
kind = zypp::ResTraitszypp::Pattern::kind;
}
@@ -124,9 +121,6 @@
else if ( req_kind == "package" ) {
kind = zypp::ResTraitszypp::Package::kind;
}
- else if ( req_kind == "selection" ) {
- kind = zypp::ResTraitszypp::Selection::kind;
- }
else if ( req_kind == "pattern" ) {
kind = zypp::ResTraitszypp::Pattern::kind;
}
@@ -170,9 +164,6 @@
else if ( req_kind == "package" ) {
kind = zypp::ResTraitszypp::Package::kind;
}
- else if ( req_kind == "selection" ) {
- kind = zypp::ResTraitszypp::Selection::kind;
- }
else if ( req_kind == "pattern" ) {
kind = zypp::ResTraitszypp::Pattern::kind;
}
@@ -239,9 +230,6 @@
else if ( req_kind == "package" ) {
kind = zypp::ResTraitszypp::Package::kind;
}
- else if ( req_kind == "selection" ) {
- kind = zypp::ResTraitszypp::Selection::kind;
- }
else if ( req_kind == "pattern" ) {
kind = zypp::ResTraitszypp::Pattern::kind;
}
Modified: trunk/pkg-bindings/src/Resolvable_Properties.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/pkg-bindings/src/Resolvable_Properties.cc?rev=44491&r1=44490&r2=44491&view=diff
==============================================================================
--- trunk/pkg-bindings/src/Resolvable_Properties.cc (original)
+++ trunk/pkg-bindings/src/Resolvable_Properties.cc Fri Feb 15 11:46:16 2008
@@ -41,7 +41,6 @@
#include
#include
-#include
/**
@builtin ResolvableProperties
@@ -51,7 +50,7 @@
return list of resolvables of selected kind with required name
@param name name of the resolvable, if empty returns all resolvables of the kind
- @param kind_r kind of resolvable, can be `product, `patch, `package, `selection, `pattern or `language
+ @param kind_r kind of resolvable, can be `product, `patch, `package, `pattern or `language
@param version version of the resolvable, if empty all versions are returned
@return list