removed dependencies and using the new one
authorStefan Schubert <schubi@suse.de>
Mon, 2 Jan 2006 11:02:19 +0000 (11:02 +0000)
committerStefan Schubert <schubi@suse.de>
Mon, 2 Jan 2006 11:02:19 +0000 (11:02 +0000)
41 files changed:
zypp/solver/detail/Dependency.cc [deleted file]
zypp/solver/detail/Dependency.h [deleted file]
zypp/solver/detail/DependencyPtr.h [deleted file]
zypp/solver/detail/Makefile.am
zypp/solver/detail/Match.cc
zypp/solver/detail/Match.h
zypp/solver/detail/MultiWorld.cc
zypp/solver/detail/MultiWorld.h
zypp/solver/detail/OrDependency.cc [deleted file]
zypp/solver/detail/OrDependency.h [deleted file]
zypp/solver/detail/OrDependencyPtr.h [deleted file]
zypp/solver/detail/Package.cc
zypp/solver/detail/QueueItem.h
zypp/solver/detail/QueueItemBranch.h
zypp/solver/detail/QueueItemConflict.cc
zypp/solver/detail/QueueItemConflict.h
zypp/solver/detail/QueueItemGroup.h
zypp/solver/detail/QueueItemInstall.cc
zypp/solver/detail/QueueItemInstall.h
zypp/solver/detail/QueueItemRequire.cc
zypp/solver/detail/QueueItemRequire.h
zypp/solver/detail/QueueItemUninstall.cc
zypp/solver/detail/QueueItemUninstall.h
zypp/solver/detail/ResItem.cc
zypp/solver/detail/ResItem.h
zypp/solver/detail/ResItemAndDependency.cc
zypp/solver/detail/ResItemAndDependency.h
zypp/solver/detail/Resolver.cc
zypp/solver/detail/Resolver.h
zypp/solver/detail/ResolverContext.cc
zypp/solver/detail/ResolverContext.h
zypp/solver/detail/ResolverInfoMissingReq.cc
zypp/solver/detail/ResolverInfoMissingReq.h
zypp/solver/detail/ResolverQueue.cc
zypp/solver/detail/ResolverQueue.h
zypp/solver/detail/StoreWorld.cc
zypp/solver/detail/StoreWorld.h
zypp/solver/detail/World.h
zypp/solver/detail/XmlParser.cc
zypp/solver/detail/XmlParser.h
zypp/solver/detail/libzypp_solver.h

diff --git a/zypp/solver/detail/Dependency.cc b/zypp/solver/detail/Dependency.cc
deleted file mode 100644 (file)
index 657d302..0000000
+++ /dev/null
@@ -1,378 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* Dependency.cc
- *
- * Copyright (C) 2000-2002 Ximian, Inc.
- * Copyright (C) 2005 SUSE Linux Products GmbH
- *
- * Definition of 'dependency'
- *  contains name-op-spec
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-
-#include <y2util/stringutil.h>
-
-#include <zypp/solver/detail/Dependency.h>
-#include <zypp/solver/detail/OrDependency.h>
-#include <zypp/Arch.h>
-#include <zypp/Edition.h>
-
-/////////////////////////////////////////////////////////////////////////
-namespace zypp 
-{ ///////////////////////////////////////////////////////////////////////
-  ///////////////////////////////////////////////////////////////////////
-  namespace solver
-  { /////////////////////////////////////////////////////////////////////
-    /////////////////////////////////////////////////////////////////////
-    namespace detail
-    { ///////////////////////////////////////////////////////////////////
-      
-      using namespace std;
-      
-      IMPL_DERIVED_POINTER(Dependency,Spec);
-      
-      
-      string
-      Dependency::asString ( void ) const
-      {
-          return toString (*this);
-      }
-      
-      
-      string
-      Dependency::toString ( const Dependency & dependency )
-      {
-          string res;
-      
-          res += dependency.name();
-          if (dependency.relation() != Rel::ANY) {
-       res += " ";
-       res += dependency.relation().asString();
-       res += " ";
-      
-       res += dependency.edition().asString();
-          }
-          if (dependency.orDep()) res += " [OR]";
-          if (dependency.preDep()) res += " [PRE]";
-      
-          return res;
-      }
-      
-      
-      string
-      Dependency::toString (const CDependencyList & dl)
-      {
-          string res("[");
-          for (CDependencyList::const_iterator iter = dl.begin(); iter != dl.end(); iter++) {
-       if (iter != dl.begin()) res += ", ";
-       res += (*iter)->asString();
-          }
-          return res + "]";
-      }
-      
-      
-      
-      
-      ostream &
-      Dependency::dumpOn( ostream & str ) const
-      {
-          str << asString();
-          return str;
-      }
-      
-      
-      ostream&
-      operator<<( ostream& os, const Dependency& dependency)
-      {
-          return os << dependency.asString();
-      }
-      
-      //---------------------------------------------------------------------------
-      
-      Dependency::Dependency (const string & name, const Rel & relation, const Resolvable::Kind & kind,
-       constChannelPtr channel,
-       int epoch, const string & version, const string & release, const Arch & arch,
-       bool or_dep, bool pre_dep)
-          : Spec (kind, name, epoch, version, release, arch)
-          , _relation (relation)
-          , _channel (channel)
-          , _or_dep (or_dep)
-          , _pre_dep (pre_dep)
-      {
-      }
-      
-      
-      Dependency::Dependency (const string & name, const Rel & relation, const Resolvable::Kind & kind,
-       constChannelPtr channel, const Edition & edition, bool or_dep, bool pre_dep)
-          : Spec (kind, name, edition)
-          , _relation (relation)
-          , _channel (channel)
-          , _or_dep (or_dep)
-          , _pre_dep (pre_dep)
-      {
-      }
-      
-      
-      Dependency::Dependency (OrDependencyPtr or_dep)
-          : Spec (ResTraits<zypp::Package>::kind, or_dep->name())
-          , _relation (Rel::ANY)
-          , _channel (NULL)
-          , _or_dep (false)
-          , _pre_dep (true)
-      {
-          or_dep->addCreatedProvide (this);
-      }
-      
-      
-      Dependency::Dependency (constXmlNodePtr node)
-          : Spec (ResTraits<zypp::Package>::kind, "")
-          , _relation (Rel::ANY)
-          , _channel (new Channel(CHANNEL_TYPE_ANY))
-          , _or_dep (false)
-          , _pre_dep (false)
-      {
-          const char *tmp;
-      
-          if (!node->equals("dep")) {
-       fprintf (stderr, "Dependency::Dependency bad node\n");
-       abort();
-          }
-      
-          setName(node->getProp ("name"));
-          tmp = node->getProp ("op", NULL);
-          if (tmp) {
-       _relation = Rel(tmp);
-       setEpoch (node->getIntValueDefault ("epoch", Edition::noepoch));
-       setVersion (node->getProp ("version"));
-       setRelease (node->getProp ("release"));
-          }
-      
-          tmp = node->getProp ("arch", NULL);
-          if (tmp) {
-       setArch ( Arch(node->getProp ("arch")));
-          } else {
-       setArch ( Arch());
-          }
-      #if 0
-          tmp = node->getProp ("kind", NULL);
-          if (tmp) {
-       setKind (Kind (node->getProp ("kind")));
-          }
-      #endif
-          /* FIXME: should get channel from XML */
-          /* FIXME: should get arch from XML */
-      }
-      
-      
-      Dependency::~Dependency()
-      {
-      }
-      
-      //---------------------------------------------------------------------------
-      
-      DependencyPtr parseXml (constXmlNodePtr node)
-      {
-          if (node->equals("dep")) {
-              return new Dependency (node);
-          } else if (node->equals("or")) {
-              CDependencyList or_dep_list;
-      
-              node = node->children();
-      
-              while (node) {
-                  if (node->isElement()) {
-                      or_dep_list.push_back (new Dependency (node));
-                  }
-      
-                  node = node->next();
-              }
-      
-              OrDependencyPtr or_dep = OrDependency::fromDependencyList(or_dep_list);
-              return new Dependency (or_dep);
-          }
-      
-          fprintf (stderr, "Unhandled dependency [%s]\n", node->name());
-      
-          return NULL;
-      }
-      
-      
-      bool
-      Dependency::verifyRelation (constDependencyPtr prov) const
-      {
-          int compare_ret = 0;
-          if (getenv ("SPEW_DEP")) fprintf (stderr, "Dependency::verifyRelation(dep: %s, prov: %s)", asString().c_str(), prov->asString().c_str());
-          /* No dependency can be met by a different token name */
-          if (name() != prov->name()) {
-              if (getenv ("SPEW_DEP")) fprintf (stderr, "-> wrong name\n");
-              return false;
-          }
-      
-          /* No dependency can be met by a different type */
-          if (kind() != prov->kind()) {
-              if (getenv ("SPEW_DEP")) fprintf (stderr, "-> wrong kind(dep: %s, prov: %s)\n", kind().asString().c_str(), prov->kind().asString().c_str());
-              return false;
-          }
-      
-          /* WARNING: RC_RELATION_NONE is NOT handled */
-      
-          /* No specific version in the req, so return */
-          if (_relation == Rel::ANY) {
-              if (getenv ("SPEW_DEP")) fprintf (stderr, " (any) -> true\n");
-              return true;
-          }
-      
-          /* No specific version in the prov.  In RPM this means it will satisfy
-           * any version, but debian it will not satisfy a versioned dep */
-          if (prov->relation() == Rel::ANY) {
-              if (getenv ("SPEW_DEP")) fprintf (stderr, " provides (any) matches GVersion -> true\n");
-              return true;
-          }
-      
-          if (!channel()->equals (prov->channel()))
-          {
-              if (getenv ("SPEW_DEP")) fprintf (stderr, " wrong channel -> false\n");
-              return false;
-          }
-      
-          SpecPtr newdepspec;
-          SpecPtr newprovspec;
-      
-          if (epoch() >= 0 && prov->epoch() >= 0) {
-              /* HACK: This sucks, but I don't know a better way to compare elements one at a time */
-              newdepspec = new Spec(kind(), "", epoch());
-              newprovspec = new Spec(prov->kind(), "", prov->epoch());
-              compare_ret = Spec::compare (newprovspec, newdepspec);
-          } else if (prov->epoch() > 0 ) {
-              //VERSION_PROP_IGNORE_ABSENT_EPOCHS
-              compare_ret = 0;
-          } else if (epoch() > 0 ) {
-              compare_ret = Edition::noepoch;
-          }
-          if (getenv ("SPEW_DEP")) fprintf (stderr, "epoch(%d), prov->epoch(%d) -> compare_ret %d\n", epoch(), prov->epoch(), compare_ret);
-          if (compare_ret == 0) {
-              if (!(release().empty() || prov->release().empty())) {
-                  newdepspec = new Spec(kind(), "", Edition::noepoch, version(), release());
-                  newprovspec = new Spec(prov->kind(), "", Edition::noepoch, prov->version(), prov->release());
-              } else {
-                  newdepspec = new Spec(kind(), "", Edition::noepoch, version());
-                  newprovspec = new Spec(prov->kind(), "", Edition::noepoch, prov->version());
-              }
-              compare_ret = Spec::compare (newprovspec, newdepspec);
-          }
-          if (getenv ("SPEW_DEP")) fprintf (stderr, " (compare result -> %d)", compare_ret);
-      
-          if (compare_ret < 0
-              && ((prov->relation() == Rel::GT || prov->relation() == Rel::GE )
-                  || (_relation == Rel::LT || _relation == Rel::LE )))
-          {
-              if (getenv ("SPEW_DEP")) fprintf (stderr, " -> true\n");
-              return true;
-          } else if (compare_ret > 0 
-                     && ((prov->relation() == Rel::LT || prov->relation() == Rel::LE )
-                         || (_relation == Rel::GT || _relation == Rel::GE )))
-          {
-              if (getenv ("SPEW_DEP")) fprintf (stderr, " -> true\n");
-              return true;
-          } else if (compare_ret == 0
-                     && (((prov->relation() == Rel::EQ || prov->relation() == Rel::GE || prov->relation() == Rel::LE)
-                          && (_relation == Rel::EQ || _relation == Rel::GE || _relation == Rel::LE))
-                         || ((prov->relation() == Rel::LT) && (_relation == Rel::LT))
-                         || ((prov->relation() == Rel::GT) && (_relation == Rel::GT))))
-          {
-              if (getenv ("SPEW_DEP")) fprintf (stderr, " -> true\n");
-              return true;
-          }
-          if (getenv ("SPEW_DEP")) fprintf (stderr, " -> false\n");
-          return false;
-      }
-      
-      //---------------------------------------------------------------------------
-      
-      #if 0
-      xmlNode *
-      rc_resItem_dep_or_slist_to_xml_node (RCResItemDepSList *dep)
-      {
-          xmlNode *or_node;
-          const RCResItemDepSList *dep_iter;
-      
-          or_node = xmlNewNode (NULL, "or");
-      
-          dep_iter = dep;
-          while (dep_iter) {
-       RCResItemDep *dep_item = (RCResItemDep *)(dep_iter->data);
-       xmlAddChild (or_node, rc_resItem_dep_to_xml_node (dep_item));
-       dep_iter = dep_iter->next;
-          }
-      
-          return or_node;
-      } /* rc_resItem_dep_or_slist_to_xml_node */
-      
-      xmlNode *
-      rc_resItem_dep_to_xml_node (RCResItemDep *dep_item)
-      {
-          RCResItemSpec *spec = (RCResItemSpec *) dep_item;
-          xmlNode *dep_node;
-      
-          if (rc_resItem_dep_is_or (dep_item)) {
-       RCResItemDepSList *dep_or_slist;
-       dep_or_slist = rc_dep_string_to_or_dep_slist
-           (rc_resItem_spec_get_name (spec));
-       dep_node = rc_resItem_dep_or_slist_to_xml_node (dep_or_slist);
-       rc_resItem_dep_slist_free (dep_or_slist);
-       return dep_node;
-          }
-      
-          dep_node = xmlNewNode (NULL, "dep");
-      
-          xmlSetProp (dep_node, "name", rc_resItem_spec_get_name (spec));
-      
-          if (rc_resItem_dep_get_relation (dep_item) != Relation::Any) {
-       xmlSetProp (dep_node, "op",
-                   rc_resItem_relation_to_string (
-                       rc_resItem_dep_get_relation (dep_item), false));
-      
-       if (rc_resItem_spec_has_epoch (spec)) {
-           gchar *tmp;
-      
-           tmp = g_strdup_printf ("%d", rc_resItem_spec_get_epoch (spec));
-           xmlSetProp (dep_node, "epoch", tmp);
-           g_free (tmp);
-       }
-      
-       if (spec->version) {
-           xmlSetProp (dep_node, "version", spec->version);
-       }
-      
-       if (spec->release) {
-           xmlSetProp (dep_node, "release", spec->release);
-       }
-          }
-      
-          return (dep_node);
-      } /* rc_resItem_dep_to_xml_node */
-      
-      #endif
-        
-      ///////////////////////////////////////////////////////////////////
-    };// namespace detail
-    /////////////////////////////////////////////////////////////////////
-    /////////////////////////////////////////////////////////////////////
-  };// namespace solver
-  ///////////////////////////////////////////////////////////////////////
-  ///////////////////////////////////////////////////////////////////////
-};// namespace zypp
-/////////////////////////////////////////////////////////////////////////
-
diff --git a/zypp/solver/detail/Dependency.h b/zypp/solver/detail/Dependency.h
deleted file mode 100644 (file)
index 2312f8b..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* Dependency.h
- * Copyright (C) 2000-2002 Ximian, Inc.
- * Copyright (C) 2005 SUSE Linux Products GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-
-#ifndef _Dependency_h
-#define _Dependency_h
-
-#include <list>
-#include <iosfwd>
-#include <string.h>
-
-#include <y2util/Ustring.h>
-
-#include <zypp/solver/detail/Channel.h>
-#include <zypp/solver/detail/DependencyPtr.h>
-#include <zypp/solver/detail/OrDependencyPtr.h>
-#include <zypp/solver/detail/Spec.h>
-#include <zypp/solver/detail/XmlNode.h>
-#include <zypp/ResObject.h>
-#include <zypp/Rel.h>
-
-/////////////////////////////////////////////////////////////////////////
-namespace zypp 
-{ ///////////////////////////////////////////////////////////////////////
-  ///////////////////////////////////////////////////////////////////////
-  namespace solver
-  { /////////////////////////////////////////////////////////////////////
-    /////////////////////////////////////////////////////////////////////
-    namespace detail
-    { ///////////////////////////////////////////////////////////////////
-      
-      ///////////////////////////////////////////////////////////////////
-      
-      typedef std::list <DependencyPtr> DependencyList;
-      typedef std::list <constDependencyPtr> CDependencyList;
-      
-      ///////////////////////////////////////////////////////////////////
-      //
-      //       CLASS NAME : Dependency
-      /**
-       *
-       **/
-      
-      class Dependency : public Spec {
-          REP_BODY(Dependency);
-      
-        private:
-          Rel _relation;
-          constChannelPtr _channel;
-          bool _or_dep;
-          bool _pre_dep;
-      
-        public:
-
-          Dependency (const std::string & name,
-         const Rel & relation,
-         const Resolvable::Kind & kind = ResTraits<zypp::Package>::kind,
-         constChannelPtr channel = NULL,
-         int epoch = Edition::noepoch,
-         const std::string & version = "",
-         const std::string & release = "",
-          const Arch & arch = Arch(),
-         bool or_dep = false,
-         bool pre_dep = false);
-
-          Dependency (const std::string & name,
-         const Rel & relation,
-          const Resolvable::Kind & kind = ResTraits<zypp::Package>::kind,
-         constChannelPtr channel = NULL,
-         const zypp::Edition & edition = zypp::Edition(),
-         bool or_dep = false,
-         bool pre_dep = false);
-      
-          Dependency (OrDependencyPtr or_dep); //RCResItemDep *rc_dep_or_new_provide (RCDepOr *dor);
-      
-          Dependency (constXmlNodePtr node);           //RCResItemDep *rc_xml_node_to_resItem_dep (const xmlNode *node);
-      
-          virtual ~Dependency();
-       
-          // ---------------------------------- I/O
-      
-          const xmlNodePtr asXmlNode (void) const;             // xmlNode *rc_resItem_dep_to_xml_node (RCResItemDep *dep_item);
-      
-          static std::string toString ( const Dependency & dep );
-      
-          static std::string toString ( const CDependencyList & deplist );
-      
-          virtual std::ostream & dumpOn( std::ostream & str ) const;
-      
-          friend std::ostream& operator<<( std::ostream & str, const Dependency & dep);
-      
-          std::string asString ( void ) const;
-      
-          // ---------------------------------- accessors
-      
-          const Rel & relation() const { return _relation; }
-          constChannelPtr channel (void) const { return _channel; }
-      
-          bool orDep (void) const { return _or_dep; }
-          void setOrDep (bool or_dep) { _or_dep = or_dep; }
-      
-          bool preDep (void) const { return _pre_dep; }
-          void setPreDep (bool pre_dep) { _pre_dep = pre_dep; }
-      
-          // ---------------------------------- methods
-      
-          DependencyPtr parseXml (constXmlNodePtr node);
-          bool verifyRelation (constDependencyPtr prov) const;
-      };
-      
-      // xmlNode *rc_resItem_dep_or_slist_to_xml_node (RCResItemDepSList *dep);
-      
-      ///////////////////////////////////////////////////////////////////
-    };// namespace detail
-    /////////////////////////////////////////////////////////////////////
-    /////////////////////////////////////////////////////////////////////
-  };// namespace solver
-  ///////////////////////////////////////////////////////////////////////
-  ///////////////////////////////////////////////////////////////////////
-};// namespace zypp
-/////////////////////////////////////////////////////////////////////////
-
-#endif // _Dependency_h
diff --git a/zypp/solver/detail/DependencyPtr.h b/zypp/solver/detail/DependencyPtr.h
deleted file mode 100644 (file)
index 49f0755..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* DependencyPtr.h
- *
- * Copyright (C) 2005 SUSE Linux Products GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-
-#ifndef _DependencyPtr_h
-#define _DependencyPtr_h
-
-#include <y2util/RepDef.h>
-#include <zypp/solver/detail/SpecPtr.h>
-
-/////////////////////////////////////////////////////////////////////////
-namespace zypp 
-{ ///////////////////////////////////////////////////////////////////////
-  ///////////////////////////////////////////////////////////////////////
-  namespace solver
-  { /////////////////////////////////////////////////////////////////////
-    /////////////////////////////////////////////////////////////////////
-    namespace detail
-    { ///////////////////////////////////////////////////////////////////
-
-      ///////////////////////////////////////////////////////////////////
-      //       CLASS NAME : DependencyPtr
-      //       CLASS NAME : constDependencyPtr
-      ///////////////////////////////////////////////////////////////////
-      DEFINE_DERIVED_POINTER(Dependency,Spec);
-      
-      ///////////////////////////////////////////////////////////////////
-    };// namespace detail
-    /////////////////////////////////////////////////////////////////////
-    /////////////////////////////////////////////////////////////////////
-  };// namespace solver
-  ///////////////////////////////////////////////////////////////////////
-  ///////////////////////////////////////////////////////////////////////
-};// namespace zypp
-/////////////////////////////////////////////////////////////////////////
-
-#endif // _DependencyPtr_h
index cd05fdf..128ec47 100644 (file)
@@ -23,12 +23,8 @@ include_HEADERS = \
        Subscription.h                  \
        ResItem.h                       \
        ResItemPtr.h                    \
-       Dependency.h                    \
-       DependencyPtr.h                 \
        ResItemAndDependency.h  \
        ResItemAndDependencyPtr.h       \
-       OrDependency.h                  \
-       OrDependencyPtr.h               \
        Package.h                       \
        PackagePtr.h                    \
        PackageUpdate.h                 \
@@ -101,9 +97,7 @@ lib@PACKAGE@_solver_detail_la_SOURCES =                      \
        Channel.cc                                      \
        Subscription.cc                                 \
        ResItem.cc                                      \
-       Dependency.cc                                   \
        ResItemAndDependency.cc                 \
-       OrDependency.cc                                 \
        XmlNode.cc                                      \
        Importance.cc                                   \
        Section.cc                                      \
index f71fad4..ee56a86 100644 (file)
@@ -25,6 +25,9 @@
 #include <zypp/solver/detail/World.h>
 #include <zypp/Rel.h>
 
+#include <zypp/CapFactory.h>
+#include <zypp/CapSet.h>
+
 
 /////////////////////////////////////////////////////////////////////////
 namespace zypp 
@@ -122,16 +125,8 @@ namespace zypp
           }
       
           // Check the dep
-          if ((_dependency == NULL) ^ (lock._dependency == NULL))
-       return false;
-          if (_dependency && lock._dependency) {
-       if (!( ((constSpecPtr) _dependency)->equals((constSpecPtr) lock._dependency))
-           || (_dependency->relation() != lock._dependency->relation())
-           || (_dependency->kind() != lock._dependency->kind()))
-       {
-               return false;
-       }
-          }
+          if ( _dependency != lock._dependency)
+              return false;
       
           return true;
       }
@@ -144,42 +139,42 @@ namespace zypp
           constChannelPtr channel = resItem->channel ();
         
           if (channel != NULL && !_channel_id.empty()) {
-       if (! channel->hasEqualId (_channel_id)) {
-           return false;
-       }
+              if (! channel->hasEqualId (_channel_id)) {
+                  return false;
+              }
           }
       
           name = resItem->name ();
       
-      // FIXME, implement regexp
-      #if 0
+          // FIXME, implement regexp
+#if 0
           if (match->_pattern_spec
-       && ! g_pattern_match_string (match->pattern_spec, name)) {
-       return false;
+              && ! g_pattern_match_string (match->pattern_spec, name)) {
+              return false;
           }
-      #endif
-      
-        /* FIXME: ResItems don't have ResItemUpdate right now */
-      /*   if (match->importance != RC_IMPORTANCE_INVALID && */
-      /*         !rc_resItem_is_installed (resItem)) { */
-      /*         RCResItemUpdate *up = rc_resItem_get_latest_update (pkg); */
-      /*         if (up) { */
-      /*                 if (match->importance_gteq ? up->importance > match->importance */
-      /*                         : up->importance < match->importance) */
-      /*                         return FALSE; */
-      /*         } */
-      /*   } */
-      
-          if (_dependency) {
-       DependencyPtr dependency;
-       bool check;
-      
-       dependency = new Dependency (resItem->name(), Rel::EQ, ResTraits<zypp::Package>::kind, resItem->channel(), resItem->edition());
-       check = _dependency->verifyRelation (dependency);
-       return check;
-          }
-      
-          return true;
+#endif
+      
+          /* FIXME: ResItems don't have ResItemUpdate right now */
+          /*   if (match->importance != RC_IMPORTANCE_INVALID && */
+          /*     !rc_resItem_is_installed (resItem)) { */
+          /*     RCResItemUpdate *up = rc_resItem_get_latest_update (pkg); */
+          /*     if (up) { */
+          /*             if (match->importance_gteq ? up->importance > match->importance */
+          /*                     : up->importance < match->importance) */
+          /*                     return FALSE; */
+          /*     } */
+          /*   } */
+          CapFactory  factory;                      
+          Capability dependency;
+          bool check;
+      
+          dependency = factory.parse ( resItem->kind(),
+                                       resItem->name(),
+                                       Rel::EQ,
+                                       resItem->edition(),
+                                       resItem->arch());
+          check = _dependency.matches (dependency);
+          return check;
       }
 
       ///////////////////////////////////////////////////////////////////
index 14f5165..9a33dbb 100644 (file)
@@ -62,7 +62,7 @@ namespace zypp
         private:
           std::string _channel_id;
       
-          constDependencyPtr _dependency;
+          Capability _dependency;
       
           std::string _name_glob;
       //    GPatternSpec *_pattern_spec;
@@ -94,8 +94,8 @@ namespace zypp
           void setChannel (constChannelPtr channel) { _channel_id = channel->id(); }
           void setChannelId (const std::string & channel_id) { _channel_id = channel_id; }
       
-          constDependencyPtr dependency () const { return _dependency; }
-          void setDependency (constDependencyPtr dependency) { _dependency = dependency; }
+          const Capability & dependency () const { return _dependency; }
+          void setDependency (const Capability & dependency) { _dependency = dependency; }
       
           const std::string & glob () const { return _name_glob; }
           void setGlob (const std::string & glob_str) { _name_glob = glob_str; }
index ad161b1..6ce0529 100644 (file)
@@ -543,7 +543,7 @@ namespace zypp
       
       
       constResItemPtr
-      MultiWorld::findResItemWithConstraint (constChannelPtr channel, const char *name, constDependencyPtr constraint, bool is_and) const
+      MultiWorld::findResItemWithConstraint (constChannelPtr channel, const char *name, const Capability & constraint, bool is_and) const
       {
           constResItemPtr resItem;
           for (SubWorldInfoList::const_iterator iter = _subworlds.begin(); iter != _subworlds.end(); iter++) {
@@ -604,7 +604,7 @@ namespace zypp
       // iterater over resItems with dependency
       
       int
-      MultiWorld::foreachProvidingResItem (constDependencyPtr dep, ResItemAndSpecFn fn, void *data)
+      MultiWorld::foreachProvidingResItem (const Capability & dep, ResItemAndDepFn fn, void *data)
       {
           int count = 0;
           for (SubWorldInfoList::const_iterator iter = _subworlds.begin(); iter != _subworlds.end(); iter++) {
@@ -618,7 +618,7 @@ namespace zypp
       }
       
       int
-      MultiWorld::foreachRequiringResItem (constDependencyPtr dep, ResItemAndDepFn fn, void *data)
+      MultiWorld::foreachRequiringResItem (const Capability & dep, ResItemAndDepFn fn, void *data)
       {
           int count = 0;
           for (SubWorldInfoList::const_iterator iter = _subworlds.begin(); iter != _subworlds.end(); iter++) {
@@ -632,7 +632,7 @@ namespace zypp
       }
       
       int
-      MultiWorld::foreachConflictingResItem (constDependencyPtr dep, ResItemAndDepFn fn, void *data)
+      MultiWorld::foreachConflictingResItem (const Capability & dep, ResItemAndDepFn fn, void *data)
       {
           int count = 0;
           for (SubWorldInfoList::const_iterator iter = _subworlds.begin(); iter != _subworlds.end(); iter++) {
index 1bed9c9..9c44f05 100644 (file)
@@ -29,6 +29,7 @@
 #include <zypp/solver/detail/ServiceWorldPtr.h>
 #include <zypp/solver/detail/World.h>
 #include <zypp/solver/detail/Pending.h>
+#include <zypp/Capability.h>
 
 /////////////////////////////////////////////////////////////////////////
 namespace zypp 
@@ -106,7 +107,7 @@ class MultiWorld : public World {
       
           virtual constResItemPtr findInstalledResItem (constResItemPtr resItem);
           virtual constResItemPtr findResItem (constChannelPtr channel, const char *name) const;
-          virtual constResItemPtr findResItemWithConstraint (constChannelPtr channel, const char *name, constDependencyPtr constraint, bool is_and) const;
+          virtual constResItemPtr findResItemWithConstraint (constChannelPtr channel, const char *name, const Capability & constraint, bool is_and) const;
       
           // Iterate over resItems
       
@@ -116,9 +117,9 @@ class MultiWorld : public World {
       
           // Iterate across provides or requirement
       
-          virtual int foreachProvidingResItem (constDependencyPtr dep, ResItemAndSpecFn fn, void *data);
-          virtual int foreachRequiringResItem (constDependencyPtr dep, ResItemAndDepFn fn, void *data);
-          virtual int foreachConflictingResItem (constDependencyPtr dep, ResItemAndDepFn fn, void *data);
+          virtual int foreachProvidingResItem (const Capability & dep, ResItemAndDepFn fn, void *data);
+          virtual int foreachRequiringResItem (const Capability & dep, ResItemAndDepFn fn, void *data);
+          virtual int foreachConflictingResItem (const Capability & dep, ResItemAndDepFn fn, void *data);
       
           // locks
       
diff --git a/zypp/solver/detail/OrDependency.cc b/zypp/solver/detail/OrDependency.cc
deleted file mode 100644 (file)
index 1661acd..0000000
+++ /dev/null
@@ -1,297 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* OrDependency.cc
- *
- * Copyright (C) 2000-2002 Ximian, Inc.
- * Copyright (C) 2005 SUSE Linux Products GmbH
- *
- * Definition of 'or dependency'
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-
-#include <y2util/stringutil.h>
-
-#include <zypp/solver/detail/OrDependency.h>
-#include <zypp/solver/detail/Dependency.h>
-
-
-/////////////////////////////////////////////////////////////////////////
-namespace zypp 
-{ ///////////////////////////////////////////////////////////////////////
-  ///////////////////////////////////////////////////////////////////////
-  namespace solver
-  { /////////////////////////////////////////////////////////////////////
-    /////////////////////////////////////////////////////////////////////
-    namespace detail
-    { ///////////////////////////////////////////////////////////////////
-      
-      using namespace std;
-      
-      IMPL_BASE_POINTER(OrDependency);
-      
-      OrDependency::OrDependencyTable OrDependency::_or_dep_table;
-      
-      //---------------------------------------------------------------------------
-      
-      string
-      OrDependency::asString ( void ) const
-      {
-          return toString (*this);
-      }
-      
-      
-      string
-      OrDependency::toString ( const OrDependency & dependency )
-      {
-          string res ("<ordependency/>");
-      
-          return res;
-      }
-      
-      
-      ostream &
-      OrDependency::dumpOn( ostream & str ) const
-      {
-          str << asString();
-          return str;
-      }
-      
-      
-      ostream&
-      operator<<( ostream & os, const OrDependency & dependency)
-      {
-          return os << dependency.asString();
-      }
-      
-      //---------------------------------------------------------------------------
-      
-      OrDependency::OrDependency (string & dep, const CDependencyList & split_ors)
-          : _or_dep (dep)
-          , _split_ors (split_ors)
-          , _ref(1)
-      {
-      }
-      
-      
-      OrDependency::OrDependency (constXmlNodePtr node)
-      {
-      }
-      
-      
-      OrDependency::~OrDependency()
-      {
-      }
-      
-      
-      //---------------------------------------------------------------------------
-      
-      OrDependencyPtr
-      OrDependency::fromDependencyList (const CDependencyList & deplist)
-      {
-          string depstr = dependencyListToString(deplist);
-      
-          OrDependencyTable::iterator pos = _or_dep_table.find(depstr);
-          if (pos != _or_dep_table.end()) {
-       (*pos).second->incRef();
-       return (*pos).second;
-          }
-      
-          OrDependencyPtr or_dep = new OrDependency (depstr, deplist);
-          _or_dep_table[depstr] = or_dep;
-          return or_dep;
-      }
-      
-      
-      OrDependencyPtr
-      OrDependency::fromString (const char *dep)
-      {
-          string depstr = string (dep);
-      
-          OrDependencyTable::iterator pos = _or_dep_table.find(depstr);
-          if (pos != _or_dep_table.end()) {
-       (*pos).second->incRef();
-       return (*pos).second;
-          }
-      
-          CDependencyList deplist = stringToDependencyList (dep);
-          OrDependencyPtr or_dep = new OrDependency (depstr, deplist);
-          _or_dep_table[depstr] = or_dep;
-          return or_dep;
-      
-      }
-      
-      
-      string
-      OrDependency::dependencyListToString (const CDependencyList & deplist)
-      {
-          string str ("(||");
-      
-          for (CDependencyList::const_iterator dep = deplist.begin(); dep != deplist.end(); dep++) {
-       if (dep != deplist.begin())
-           str += "|";
-      
-       str += (*dep)->name();
-      
-       Rel relation = (*dep)->relation();
-      
-       if (relation != Rel::ANY) {
-           str += "&";
-           str += relation.asString();
-           str += "&";
-      
-           if ((*dep)->epoch() >= 0) {
-               str += stringutil::form("%d:", (*dep)->epoch());
-           }
-      
-           str += (*dep)->version();
-      
-           string rel = (*dep)->release();
-           if (!rel.empty()) {
-               str += "-";
-               str += rel;
-           }
-       }
-      
-          }
-      
-          str += ")";
-      
-          return str;
-      }
-      
-      
-      CDependencyList
-      OrDependency::stringToDependencyList (const char *s)
-      {
-          const char *p, *zz;
-          CDependencyList out_dep;
-          bool have_more = true;
-      
-          if (strncmp (s, "(||", 3)) {
-       fprintf (stderr, "'%s' is not a 'munged or' string!\n", s);
-       return out_dep;
-          }
-      
-          s += 3;
-      
-          zz = strchr (s, ')');
-      
-          if (!zz)
-       return out_dep;
-      
-          /* s now points to the start of the first thing */
-          do {
-       char *z;
-       SpecPtr spec;
-       char *name;
-       Rel relation = Rel::ANY;
-       zypp::Edition edition;
-      
-       /* grab the name */
-      
-       z = strchr (s, '|');
-       p = strchr (s, '&');
-      
-       if (!z) {
-           have_more = false;
-       }
-       else {
-           /* We don't want to get a p from a later element. */
-           if (p > z)
-               p = NULL;
-       }
-      
-       name = strndup (s, p ? p - s : (z ? z - s : zz - s));
-      
-       if (p) {
-           char *e;
-           char op[4];
-           char *vstr;
-      
-           /* We need to parse version things */
-           p++;
-           e = strchr (p, '&');
-           if (!e || e-p > 3) {
-               /* Bad. */
-               fprintf (stderr, "Couldn't parse ver str [%s]\n", p);
-           }
-      
-           /* text between p and e is an operator */
-           strncpy (op, p, e - p);
-           op[e - p] = 0;
-           relation = Rel(op);
-      
-           e++;
-           if (z) {
-               p = z;
-           } else {
-               p = zz;
-           }
-      
-           /* e .. p is the epoch:version-release */
-           vstr = strndup (e, p - e);
-      
-           Edition edition(vstr);
-      
-           free ((void *)vstr);
-      
-       }
-
-        
-       DependencyPtr dep = new Dependency (name, relation, ResTraits<zypp::Package>::kind, NULL, edition );
-
-       out_dep.push_back (dep);
-       free ((void *)name);
-      
-       s = z + 1;
-      
-       if (p == zz)
-           have_more = false;
-          } while (have_more);
-      
-          return out_dep;
-      }
-      
-      
-      void
-      OrDependency::addCreatedProvide (constDependencyPtr dep)
-      {
-          _created_provides.push_back (dep);
-      }
-      
-      
-      constDependencyPtr
-      OrDependency::find (const char *dep)
-      {
-          string depstr (dep);
-      
-          OrDependencyTable::iterator pos = _or_dep_table.find(depstr);
-          if (pos != _or_dep_table.end()) {
-       return new Dependency ((*pos).second);
-          }
-      
-          return NULL;
-      }
-        
-      ///////////////////////////////////////////////////////////////////
-    };// namespace detail
-    /////////////////////////////////////////////////////////////////////
-    /////////////////////////////////////////////////////////////////////
-  };// namespace solver
-  ///////////////////////////////////////////////////////////////////////
-  ///////////////////////////////////////////////////////////////////////
-};// namespace zypp
-/////////////////////////////////////////////////////////////////////////
-
diff --git a/zypp/solver/detail/OrDependency.h b/zypp/solver/detail/OrDependency.h
deleted file mode 100644 (file)
index 6e5090a..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* OrDependency.h
- * Copyright (C) 2000-2002 Ximian, Inc.
- * Copyright (C) 2005 SUSE Linux Products GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-
-#ifndef _OrDependency_h
-#define _OrDependency_h
-
-#include <list>
-#include <map>
-#include <iosfwd>
-#include <string.h>
-
-#include <y2util/Ustring.h>
-
-#include <zypp/solver/detail/OrDependencyPtr.h>
-#include <zypp/solver/detail/Dependency.h>
-#include <zypp/solver/detail/XmlNode.h>
-
-/////////////////////////////////////////////////////////////////////////
-namespace zypp 
-{ ///////////////////////////////////////////////////////////////////////
-  ///////////////////////////////////////////////////////////////////////
-  namespace solver
-  { /////////////////////////////////////////////////////////////////////
-    /////////////////////////////////////////////////////////////////////
-    namespace detail
-    { ///////////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////
-      //
-      //       CLASS NAME : OrDependency
-      /**
-       *
-       **/
-      
-      class OrDependency : public CountedRep {
-          REP_BODY(OrDependency);
-      
-        private:
-          typedef std::map<std::string, OrDependencyPtr> OrDependencyTable;
-      
-          static OrDependencyTable _or_dep_table;
-      
-          std::string _or_dep;
-          CDependencyList _split_ors;
-          CDependencyList _created_provides;
-          int _ref;
-      
-          OrDependency (std::string & dep, const CDependencyList & split_ors);
-      
-          static std::string dependencyListToString (const CDependencyList & deplist);
-          static CDependencyList stringToDependencyList (const char *s);
-      
-          void incRef() { _ref++; }
-          void decRef() { _ref--; }
-      
-        public:
-      
-          OrDependency (constXmlNodePtr node);
-      
-          virtual ~OrDependency();
-      
-          // ---------------------------------- I/O
-      
-          const xmlNodePtr asXmlNode (void) const;
-      
-          static std::string toString ( const OrDependency & ordep );
-      
-          virtual std::ostream & dumpOn( std::ostream & str ) const;
-      
-          friend std::ostream& operator<<( std::ostream&, const OrDependency & ordep );
-      
-          std::string asString ( void ) const;
-      
-          // ---------------------------------- accessors
-      
-          const char *name (void) const { return _or_dep.c_str(); }
-          void addCreatedProvide (constDependencyPtr dep);
-      
-          // ---------------------------------- methods
-      
-          static OrDependencyPtr fromDependencyList (const CDependencyList & deplist);
-          static OrDependencyPtr fromString (const char *dep);
-          static constDependencyPtr find (const char *dep);
-      };
-      
-      ///////////////////////////////////////////////////////////////////
-    };// namespace detail
-    /////////////////////////////////////////////////////////////////////
-    /////////////////////////////////////////////////////////////////////
-  };// namespace solver
-  ///////////////////////////////////////////////////////////////////////
-  ///////////////////////////////////////////////////////////////////////
-};// namespace zypp
-/////////////////////////////////////////////////////////////////////////
-#endif // _OrDependency_h
diff --git a/zypp/solver/detail/OrDependencyPtr.h b/zypp/solver/detail/OrDependencyPtr.h
deleted file mode 100644 (file)
index e5972ae..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* OrDependencyPtr.h
- *
- * Copyright (C) 2005 SUSE Linux Products GmbH
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-
-#ifndef _OrDependencyPtr_h
-#define _OrDependencyPtr_h
-
-#include <y2util/RepDef.h>
-
-/////////////////////////////////////////////////////////////////////////
-namespace zypp 
-{ ///////////////////////////////////////////////////////////////////////
-  ///////////////////////////////////////////////////////////////////////
-  namespace solver
-  { /////////////////////////////////////////////////////////////////////
-    /////////////////////////////////////////////////////////////////////
-    namespace detail
-    { ///////////////////////////////////////////////////////////////////
-
-      ///////////////////////////////////////////////////////////////////
-      //       CLASS NAME : OrDependencyPtr
-      //       CLASS NAME : constOrDependencyPtr
-      ///////////////////////////////////////////////////////////////////
-      DEFINE_BASE_POINTER(OrDependency);
-      
-      ///////////////////////////////////////////////////////////////////
-    };// namespace detail
-    /////////////////////////////////////////////////////////////////////
-    /////////////////////////////////////////////////////////////////////
-  };// namespace solver
-  ///////////////////////////////////////////////////////////////////////
-  ///////////////////////////////////////////////////////////////////////
-};// namespace zypp
-/////////////////////////////////////////////////////////////////////////
-
-#endif // _DependencyPtr_h
index 16d3ab5..605bff0 100644 (file)
 #include <zypp/Package.h>
 #include <zypp/detail/PackageImpl.h>
 #include <zypp/solver/detail/PackageUpdate.h>
-#include <zypp/solver/detail/Dependency.h>
 #include <zypp/solver/detail/World.h>
 #include <zypp/solver/detail/XmlNode.h>
 
+#include <zypp/CapFactory.h>
+#include <zypp/CapSet.h>
+
+
 /////////////////////////////////////////////////////////////////////////
 namespace zypp 
 { ///////////////////////////////////////////////////////////////////////
@@ -43,17 +46,53 @@ namespace zypp
       IMPL_DERIVED_POINTER(Package,ResItem);
       
       struct DepTable {
-          CDependencyList requires;
-          CDependencyList provides;
-          CDependencyList conflicts;
-          CDependencyList obsoletes;
-          CDependencyList children;
-          CDependencyList suggests;
-          CDependencyList recommends;
+          CapSet requires;
+          CapSet provides;
+          CapSet conflicts;
+          CapSet obsoletes;
+          CapSet children;
+          CapSet suggests;
+          CapSet recommends;
       };
       
       //---------------------------------------------------------------------------
+
+      static Capability 
+      parseXmlDep (constXmlNodePtr node) {
+          const char *tmp;
+          string epoch,version,release,name = "";
+          Arch arch = Arch_noarch;
+          Rel relation;
+          CapFactory  factory;                          
+      
+          if (!node->equals("dep")) {
+              fprintf (stderr, "parseXmlDep bad node\n");
+              abort();
+          }
+      
+          name = node->getProp ("name");
+          tmp = node->getProp ("op", NULL);
+          if (tmp) {
+              relation = Rel(tmp);
+              epoch = node->getIntValueDefault ("epoch", Edition::noepoch);
+              version = node->getProp ("version");
+              release = node->getProp ("release");
+          }
       
+          tmp = node->getProp ("arch", NULL);
+          if (tmp) {
+              arch = Arch(node->getProp ("arch"));
+          } else {
+              arch =  Arch();
+          }
+          
+          return  factory.parse ( ResTraits<zypp::Package>::kind,
+                                  name,
+                                  relation,
+                                  Edition (version, release, epoch),
+                                  arch);
+      }
+        
       static void
       extract_dep_info (constXmlNodePtr iter, struct DepTable & dep_table)
       {
@@ -68,7 +107,7 @@ namespace zypp
                continue;
            }
       
-           dep_table.requires.push_back(new Dependency (iter2));
+           dep_table.requires.insert(parseXmlDep (iter2));
            iter2 = iter2->next();
        }
       
@@ -83,7 +122,7 @@ namespace zypp
                continue;
            }
       
-           dep_table.recommends.push_back (new Dependency (iter2));
+           dep_table.recommends.insert (parseXmlDep (iter2));
            iter2 = iter2->next();
        }
       
@@ -98,7 +137,7 @@ namespace zypp
                continue;
            }
       
-           dep_table.suggests.push_back (new Dependency (iter2));
+           dep_table.suggests.insert (parseXmlDep (iter2));
            iter2 = iter2->next();
        }
       
@@ -122,7 +161,7 @@ namespace zypp
                continue;
            }
       
-           DependencyPtr dep = new Dependency (iter2);
+           Capability dep = parseXmlDep(iter2);
       
            if (! all_are_obs) {
                this_is_obs = false;
@@ -134,9 +173,9 @@ namespace zypp
            }
                
            if (all_are_obs || this_is_obs) {
-               dep_table.obsoletes.push_back (dep);
+               dep_table.obsoletes.insert (dep);
            } else {
-               dep_table.conflicts.push_back (dep);
+               dep_table.conflicts.insert (dep);
            }
                
            iter2 = iter2->next();
@@ -153,7 +192,7 @@ namespace zypp
                continue;
            }
       
-           dep_table.obsoletes.push_back (new Dependency (iter2));
+           dep_table.obsoletes.insert (parseXmlDep (iter2));
            iter2 = iter2->next();
        }
       
@@ -168,7 +207,7 @@ namespace zypp
                continue;
            }
       
-           dep_table.provides.push_back (new Dependency (iter2));
+           dep_table.provides.insert (parseXmlDep (iter2));
            iter2 = iter2->next();
        }
       
@@ -183,7 +222,7 @@ namespace zypp
                continue;
            }
       
-           dep_table.children.push_back (new Dependency (iter2));
+           dep_table.children.insert (parseXmlDep (iter2));
            iter2 = iter2->next();
        }
           }
@@ -378,38 +417,45 @@ namespace zypp
               // treat them as normal requires
               //
 #warning Children are handled as requires
-              CDependencyList::const_iterator iter;
+              CapSet::const_iterator iter;
               for (iter = dep_table.children.begin(); iter != dep_table.children.end(); iter++)
               {
-                  dep_table.requires.push_back (*iter);
+                  dep_table.requires.insert (*iter);
               }
           }
       
       
           // check if we're already listed in the provides
           // if not, provide ourself
-      
-          CDependencyList::const_iterator piter;
+          CapFactory  factory;                                    
+          Capability selfdep = factory.parse ( ResTraits<zypp::Package>::kind,
+                                             name,
+                                             Rel::EQ,
+                                             Edition( version, release, zypp::str::numstring(epoch)),
+                                             arch);      
+
+          
+          CapSet::const_iterator piter;
           for (piter = dep_table.provides.begin(); piter != dep_table.provides.end(); piter++) {
-              if ((*piter)->relation() == Rel::EQ
-                  && ((*piter)->name() == name))
+              if ((*piter) == selfdep)
               {
                   break;
               }
           }
           if (piter == dep_table.provides.end()) {                     // no self provide found, construct one
-              constDependencyPtr selfdep = new Dependency (name, Rel::EQ, ResTraits<zypp::Package>::kind, this->channel(), Edition( version, release, zypp::str::numstring(epoch) ));
-              if (getenv ("RC_SPEW")) fprintf (stderr, "Adding self-provide [%s]\n", selfdep->asString().c_str());
-              dep_table.provides.push_front (selfdep);
+              if (getenv ("RC_SPEW")) fprintf (stderr, "Adding self-provide [%s]\n", selfdep.asString().c_str());
+              dep_table.provides.insert (selfdep);
           }
       
-          setRequires (dep_table.requires);
-          setProvides (dep_table.provides);
-          setConflicts (dep_table.conflicts);
-          setObsoletes (dep_table.obsoletes);
-          setSuggests (dep_table.suggests);
-          setRecommends (dep_table.recommends);
-      
+          Dependencies deps;
+          deps.setRequires          (dep_table.requires);
+          deps.setProvides          (dep_table.provides);
+          deps.setConflicts         (dep_table.conflicts);
+          deps.setObsoletes         (dep_table.obsoletes);
+          deps.setSuggests          (dep_table.suggests);
+          deps.setRecommends        (dep_table.recommends);
+          setDependencies (deps);
+          
           if (!_history.empty()) {
       
               /* If possible, we grab the version info from the most
@@ -421,13 +467,15 @@ namespace zypp
               version = update->package()->version();
               release = update->package()->release();
       
-          } else {
+          }
+#if 0 //Is this really needed ?          
+          else {
        
               /* Otherwise, try to find where the package provides itself,
                  and use that version info. */
        
               if (!provides().empty())
-                  for (CDependencyList::const_iterator iter = provides().begin(); iter != provides().end(); iter++) {      
+                  for (CapSet::const_iterator iter = provides().begin(); iter != provides().end(); iter++) {       
                       if ((*iter)->relation() == Rel::EQ &&
                           ((*iter)->name() == name))
                       {
@@ -438,6 +486,7 @@ namespace zypp
                       }
                   }
           }
+#endif
           
           Edition     _edition( version, release, zypp::str::numstring(epoch) );
           shared_ptr<zypp::detail::PackageImpl> pkgImpl;
index a4b5d45..2bc9f54 100644 (file)
@@ -30,7 +30,6 @@
 #include <zypp/solver/detail/ResolverContextPtr.h>
 #include <zypp/solver/detail/ResolverInfo.h>
 #include <zypp/solver/detail/ResItem.h>
-#include <zypp/solver/detail/Dependency.h>
 #include <zypp/solver/detail/Channel.h>
 
 /////////////////////////////////////////////////////////////////////////
index 6b33733..638c9d4 100644 (file)
@@ -28,7 +28,6 @@
 
 #include <zypp/solver/detail/QueueItemBranchPtr.h>
 #include <zypp/solver/detail/ResItem.h>
-#include <zypp/solver/detail/Dependency.h>
 #include <zypp/solver/detail/Channel.h>
 
 /////////////////////////////////////////////////////////////////////////
index 0b125fa..b4842b3 100644 (file)
@@ -31,6 +31,9 @@
 #include <zypp/solver/detail/ResolverInfoConflictsWith.h>
 #include <zypp/solver/detail/ResolverInfoMisc.h>
 #include <zypp/solver/detail/ResolverInfoObsoletes.h>
+#include <zypp/CapFactory.h>
+#include <zypp/CapSet.h>
+
 
 /////////////////////////////////////////////////////////////////////////
 namespace zypp 
@@ -59,7 +62,7 @@ namespace zypp
       QueueItemConflict::toString ( const QueueItemConflict & item)
       {
           string res = "[Conflict: ";
-          res += item._dep->asString();
+          res += item._dep.asString();
           res += ", Triggered by ";
           res += item._conflicting_resItem->asString();
           if (item._actually_an_obsolete) res += ", Obsolete !";
@@ -84,7 +87,7 @@ namespace zypp
       
       //---------------------------------------------------------------------------
       
-      QueueItemConflict::QueueItemConflict (WorldPtr world, constDependencyPtr dep, constResItemPtr resItem)
+      QueueItemConflict::QueueItemConflict (WorldPtr world, const Capability & dep, constResItemPtr resItem)
           : QueueItem (QUEUE_ITEM_TYPE_CONFLICT, world)
           , _dep (dep)
           , _conflicting_resItem (resItem)
@@ -114,9 +117,9 @@ namespace zypp
       
       
       static bool
-      upgrade_candidates_cb (constResItemPtr resItem, constSpecPtr spec, void *data)
+      upgrade_candidates_cb (constResItemPtr resItem, const Capability & cap, void *data)
       {
-      //fprintf (stderr, "upgrade_candidates_cb(%s,%s)\n", resItem->asString().c_str(), spec->asString().c_str());
+      //fprintf (stderr, "upgrade_candidates_cb(%s,%s)\n", resItem->asString().c_str(), cap.asString().c_str());
           UpgradeCandidateInfo *info = (UpgradeCandidateInfo *)data;
           if (info->context->getStatus (resItem) == RESOLVABLE_STATUS_UNINSTALLED) {
        info->upgrades.push_back (resItem);
@@ -130,7 +133,7 @@ namespace zypp
       typedef struct {
           WorldPtr world;
           constResItemPtr conflicting_resItem;
-          constDependencyPtr dep;
+          const Capability dep;
           ResolverContextPtr context;
           QueueItemList & new_items;
       
@@ -142,23 +145,24 @@ namespace zypp
       
       
       static bool
-      conflict_process_cb (constResItemPtr resItem, constSpecPtr spec, void *data)
+      conflict_process_cb (constResItemPtr resItem, const Capability & cap, void *data)
       {
           ConflictProcessInfo *info = (ConflictProcessInfo *)data;
           ResItemStatus status;
-          string pkg_str, spec_str, msg;
+          string pkg_str, cap_str, msg;
           ResolverInfoPtr log_info;
+          CapFactory  factory;                              
       
-          if (getenv ("RC_SPEW")) fprintf (stderr, "conflict_process_cb (resolvable[%s], spec[%s], info [%s]\n", resItem->asString().c_str(), spec->asString().c_str(), info->conflicting_resItem->asString().c_str());
-          if (getenv ("RC_SPEW")) fprintf (stderr, "conflict_process_cb (resolvable equals spec: %s, info->dep [%s]\n", resItem->equals(spec->kind(), spec->name(), spec->edition()) ? "YES" : "NO", info->dep->asString().c_str());
+          if (getenv ("RC_SPEW")) fprintf (stderr, "conflict_process_cb (resolvable[%s], cap[%s], info [%s]\n", resItem->asString().c_str(), cap.asString().c_str(), info->conflicting_resItem->asString().c_str());
+          if (getenv ("RC_SPEW")) fprintf (stderr, "conflict_process_cb (info->dep [%s]\n", info->dep.asString().c_str());
       
           /* We conflict with ourself.  For the purpose of installing ourself, we
            * just ignore it, but it's Debian's way of saying that one and only one
            * resItem with this provide may exist on the system at a time. */
       
           if (info->conflicting_resItem
-       && resItem->equals (info->conflicting_resItem)) {
-       return true;
+              && resItem->equals (info->conflicting_resItem)) {
+              return true;
           }
       
           /* FIXME: This should probably be a GVersion capability. */
@@ -167,15 +171,20 @@ namespace zypp
            * as the resItem that's providing it.  This, of course, only
            * applies to RPM, since it's the only one with obsoletes right
            * now. */
+          Capability capTest =  factory.parse ( resItem->kind(),
+                                                resItem->name(),
+                                                Rel::EQ,
+                                                resItem->edition(),
+                                                resItem->arch());
       
           if (info->actually_an_obsolete
-       && !(resItem->equals(spec->kind(), spec->name(), spec->edition())))
+              && capTest != cap)
           {
-       return true;
+              return true;
           }
       
           pkg_str = resItem->asString();
-          spec_str = spec->asString();
+          cap_str = cap.asString();
       
           status = info->context->getStatus (resItem);
       
@@ -183,106 +192,111 @@ namespace zypp
       
           switch (status) {
        
-          case RESOLVABLE_STATUS_INSTALLED:
-          case RESOLVABLE_STATUS_TO_BE_INSTALLED_SOFT: {
-       QueueItemUninstallPtr uninstall;
-       ResolverInfoPtr log_info;
+              case RESOLVABLE_STATUS_INSTALLED:
+              case RESOLVABLE_STATUS_TO_BE_INSTALLED_SOFT: {
+                  QueueItemUninstallPtr uninstall;
+                  ResolverInfoPtr log_info;
       
-      #if PHI
-       // maybe an upgrade can resolve the conflict ?
-       //        check if other resItem is available which upgrades
+#if PHI
+                  // maybe an upgrade can resolve the conflict ?
+                  //        check if other resItem is available which upgrades
       
-       // find non-installed packages which provide the conflicting name
+                  // find non-installed packages which provide the conflicting name
       
-       UpgradeCandidateInfo upgrade_info;
-       upgrade_info.context = info->context;
+                  UpgradeCandidateInfo upgrade_info;
+                  upgrade_info.context = info->context;
       
-       DependencyPtr maybe_upgrade_dep = new Dependency (resItem->name(), Rel::ANY, ResTraits<zypp::Package>::kind, new Channel (CHANNEL_TYPE_NONSYSTEM), Edition::noepoch);
-       info->world->foreachProvidingResItem (maybe_upgrade_dep, upgrade_candidates_cb, (void *)&upgrade_info);
+                  Capability maybe_upgrade_dep =  factory.parse ( resItem->kind(),
+                                                                  resItem->name(),
+                                                                  Rel::ANY,
+                                                                  Edition::noepoch,
+                                                                  resItem->arch());
+
+                  info->world->foreachProvidingResItem (maybe_upgrade_dep, upgrade_candidates_cb, (void *)&upgrade_info);
       
-      #endif
+#endif
       
-       uninstall = new QueueItemUninstall (info->world, resItem, "conflict");
-       uninstall->setDependency (info->dep);
+                  uninstall = new QueueItemUninstall (info->world, resItem, "conflict");
+                  uninstall->setDependency (info->dep);
       
-       if (info->actually_an_obsolete) {
-           uninstall->setDueToObsolete ();
-           log_info = new ResolverInfoObsoletes (resItem, info->conflicting_resItem);
-       } else {
-           uninstall->setDueToConflict ();
-           log_info = new ResolverInfoConflictsWith (resItem, info->conflicting_resItem);
-       }
+                  if (info->actually_an_obsolete) {
+                      uninstall->setDueToObsolete ();
+                      log_info = new ResolverInfoObsoletes (resItem, info->conflicting_resItem);
+                  } else {
+                      uninstall->setDueToConflict ();
+                      log_info = new ResolverInfoConflictsWith (resItem, info->conflicting_resItem);
+                  }
       
-       uninstall->addInfo (log_info);
+                  uninstall->addInfo (log_info);
       
-      #if PHI
-       if (upgrade_info.upgrades.empty ()) {
-      #endif
+#if PHI
+                  if (upgrade_info.upgrades.empty ()) {
+#endif
       
-           info->new_items.push_back (uninstall);
+                      info->new_items.push_back (uninstall);
       
-      #if PHI
-       }
-       else {
-           // there are upgrade candidates for the conflicting resItem
-           // branch to: 1. uninstall, 2. upgrade (for each upgrading resItem)
+#if PHI
+                  }
+                  else {
+                      // there are upgrade candidates for the conflicting resItem
+                      // branch to: 1. uninstall, 2. upgrade (for each upgrading resItem)
       
-           QueueItemBranchPtr branch = new QueueItemBranch (info->world);
+                      QueueItemBranchPtr branch = new QueueItemBranch (info->world);
       
-           branch->addItem (uninstall);                        // try uninstall
+                      branch->addItem (uninstall);                     // try uninstall
       
-           for (CResItemList::const_iterator iter = upgrade_info.upgrades.begin(); iter != upgrade_info.upgrades.end(); iter++) {
-               QueueItemInstallPtr upgrade = new QueueItemInstall (info->world, *iter);
-               upgrade->setUpgrades (resItem);
-               branch->addItem (upgrade);                      // try upgrade
-           }
-           info->new_items.push_back (branch);
-       }
-      #endif
+                      for (CResItemList::const_iterator iter = upgrade_info.upgrades.begin(); iter != upgrade_info.upgrades.end(); iter++) {
+                          QueueItemInstallPtr upgrade = new QueueItemInstall (info->world, *iter);
+                          upgrade->setUpgrades (resItem);
+                          branch->addItem (upgrade);                   // try upgrade
+                      }
+                      info->new_items.push_back (branch);
+                  }
+#endif
       
-       break;
-          }
+                  break;
+              }
       
-          case RESOLVABLE_STATUS_TO_BE_INSTALLED: {
-       msg = string ("A conflict over ") + info->dep_str + " (" + spec_str + ") requires the removal of the to-be-installed resolvable " + pkg_str;
+              case RESOLVABLE_STATUS_TO_BE_INSTALLED: {
+                  msg = string ("A conflict over ") + info->dep_str + " (" + cap_str + ") requires the removal of the to-be-installed resolvable " + pkg_str;
       
-       ResolverInfoMiscPtr misc_info = new ResolverInfoMisc (resItem,RESOLVER_INFO_PRIORITY_VERBOSE, msg);
+                  ResolverInfoMiscPtr misc_info = new ResolverInfoMisc (resItem,RESOLVER_INFO_PRIORITY_VERBOSE, msg);
       
-       misc_info->flagAsError ();
-       if (info->conflicting_resItem) {
-           misc_info->addRelatedResItem (info->conflicting_resItem);
-       }
-       info->context->addInfo (misc_info);
+                  misc_info->flagAsError ();
+                  if (info->conflicting_resItem) {
+                      misc_info->addRelatedResItem (info->conflicting_resItem);
+                  }
+                  info->context->addInfo (misc_info);
       
-       break;
-          }
+                  break;
+              }
       
-          case RESOLVABLE_STATUS_UNINSTALLED: {
-       info->context->setStatus (resItem, RESOLVABLE_STATUS_TO_BE_UNINSTALLED);
-       msg = string ("Marking ") + pkg_str + " as uninstallable due to conflicts over " + info->dep_str + " (" + spec_str + ")";
-       if (!(info->pkg_str.empty())) {
-           msg += " from ";
-           msg += info->pkg_str;
-       }
+              case RESOLVABLE_STATUS_UNINSTALLED: {
+                  info->context->setStatus (resItem, RESOLVABLE_STATUS_TO_BE_UNINSTALLED);
+                  msg = string ("Marking ") + pkg_str + " as uninstallable due to conflicts over " + info->dep_str + " (" + cap_str + ")";
+                  if (!(info->pkg_str.empty())) {
+                      msg += " from ";
+                      msg += info->pkg_str;
+                  }
       
-       ResolverInfoMiscPtr misc_info = new ResolverInfoMisc (NULL, RESOLVER_INFO_PRIORITY_VERBOSE, msg);
+                  ResolverInfoMiscPtr misc_info = new ResolverInfoMisc (NULL, RESOLVER_INFO_PRIORITY_VERBOSE, msg);
       
-       misc_info->addRelatedResItem (resItem);
-       if (info->conflicting_resItem) {
-           misc_info->addRelatedResItem(info->conflicting_resItem);
-       }
-       info->context->addInfo (misc_info);
+                  misc_info->addRelatedResItem (resItem);
+                  if (info->conflicting_resItem) {
+                      misc_info->addRelatedResItem(info->conflicting_resItem);
+                  }
+                  info->context->addInfo (misc_info);
       
-       break;
-          }
+                  break;
+              }
       
-          case RESOLVABLE_STATUS_TO_BE_UNINSTALLED:
-          case RESOLVABLE_STATUS_TO_BE_UNINSTALLED_DUE_TO_OBSOLETE:
-       /* This is the easy case -- we do nothing. */
-       break;
+              case RESOLVABLE_STATUS_TO_BE_UNINSTALLED:
+              case RESOLVABLE_STATUS_TO_BE_UNINSTALLED_DUE_TO_OBSOLETE:
+                  /* This is the easy case -- we do nothing. */
+                  break;
       
-          default:
-       abort();
+              default:
+                  abort();
           }
       
           return true;
@@ -300,14 +314,7 @@ namespace zypp
        info.pkg_str = _conflicting_resItem->asString();
           }
 
-          if (_dep->relation().asString() != "ANY")
-          {
-              info.dep_str = _dep->relation().asString() + " " + ((constSpecPtr)_dep)->asString();
-          }
-          else
-          {
-              info.dep_str = " " + ((constSpecPtr)_dep)->asString();              
-          }
+          info.dep_str = _dep.asString();
       
           world()->foreachProvidingResItem (_dep, conflict_process_cb, (void *)&info);
                                        
@@ -336,14 +343,13 @@ namespace zypp
       {
           int cmp = this->compare (item);              // assures equal type
           if (cmp != 0)
-       return cmp;
+              return cmp;
       
           constQueueItemConflictPtr conflict = item;
-          cmp = Spec::compare ((constSpecPtr) _dep, ((constSpecPtr)(conflict->dependency())));
-          if (cmp)
-       return cmp;
-      
-          return _dep->relation() == conflict->dependency()->relation();
+          if ( _dep != conflict->dependency())
+              cmp = -1;
+
+          return cmp;
       }
 
       ///////////////////////////////////////////////////////////////////
index 2376a1c..f1744e2 100644 (file)
@@ -28,8 +28,8 @@
 
 #include <zypp/solver/detail/QueueItemConflictPtr.h>
 #include <zypp/solver/detail/ResItem.h>
-#include <zypp/solver/detail/Dependency.h>
 #include <zypp/solver/detail/Channel.h>
+#include <zypp/Capability.h>
 
 /////////////////////////////////////////////////////////////////////////
 namespace zypp 
@@ -49,14 +49,14 @@ namespace zypp
           REP_BODY(QueueItemConflict);
       
         private:
-          constDependencyPtr _dep;
+          const Capability  _dep;
           constResItemPtr _conflicting_resItem;
       
           bool _actually_an_obsolete;
       
         public:
       
-          QueueItemConflict (WorldPtr world, constDependencyPtr dep, constResItemPtr resItem);
+          QueueItemConflict (WorldPtr world, const Capability & dep, constResItemPtr resItem);
           virtual ~QueueItemConflict();
       
           // ---------------------------------- I/O
@@ -71,7 +71,7 @@ namespace zypp
       
           // ---------------------------------- accessors
       
-          constDependencyPtr dependency (void) const { return _dep; }
+          const Capability & dependency (void) const { return _dep; }
           bool actuallyAnObsolete (void) const { return _actually_an_obsolete; }
           void setActuallyAnObsolete (void) { _actually_an_obsolete = true; }
       
index 91f8745..8f1e151 100644 (file)
@@ -28,7 +28,6 @@
 
 #include <zypp/solver/detail/QueueItemGroupPtr.h>
 #include <zypp/solver/detail/ResItem.h>
-#include <zypp/solver/detail/Dependency.h>
 #include <zypp/solver/detail/Channel.h>
 
 /////////////////////////////////////////////////////////////////////////
index 8afd074..2e20ca5 100644 (file)
@@ -33,6 +33,7 @@
 #include <zypp/solver/detail/ResItem.h>
 #include <zypp/solver/detail/World.h>
 #include <zypp/solver/detail/ResItemAndDependency.h>
+#include <zypp/CapSet.h>
 
 /////////////////////////////////////////////////////////////////////////
 namespace zypp 
@@ -63,16 +64,21 @@ namespace zypp
           string ret = "[Install: ";
           ret += item._resItem->asString();
           if (item._upgrades != NULL) {
-       ret += ", Upgrades ";
-       ret += item._upgrades->asString();
+              ret += ", Upgrades ";
+              ret += item._upgrades->asString();
           }
           if (!item._deps_satisfied_by_this_install.empty()) {
-       ret += ", Satisfies ";
-       ret += Dependency::toString(item._deps_satisfied_by_this_install);
+              ret += ", Satisfies [";
+              for (CapSet::const_iterator iter = item._deps_satisfied_by_this_install.begin();
+                   iter != item._deps_satisfied_by_this_install.end(); iter++) {
+                  if (iter != item._deps_satisfied_by_this_install.begin()) ret += ", ";
+                  ret += (*iter).asString();
+              }        
+              ret += "]";
           }
           if (!item._needed_by.empty()) {
-       ret += ", Needed by ";
-       ret += ResItem::toString(item._needed_by);
+              ret += ", Needed by ";
+              ret += ResItem::toString(item._needed_by);
           }
           if (item._explicitly_requested) ret += ", Explicit !";
           ret += "]";
@@ -130,7 +136,7 @@ namespace zypp
       // Handle system resItem's that conflict with us -> uninstall them
       
       static bool
-      build_conflict_list (constResItemPtr resItem, constDependencyPtr dep, void *data)
+      build_conflict_list (constResItemPtr resItem, const Capability & dep, void *data)
       {
           CResItemList *rl = (CResItemList *)data;
           rl->push_front (resItem);
@@ -147,7 +153,7 @@ namespace zypp
           string msg;
           ResItemStatus status = context->getStatus (resItem);
       
-          CDependencyList deps;
+          CapSet deps;
           CResItemList conflicts;
       
           /* If we are trying to upgrade resItem A with resItem B and they both have the
@@ -252,10 +258,10 @@ namespace zypp
           /* Construct require items for each of the resItem's requires that is still unsatisfied. */
       
           deps = resItem->requires();
-          for (CDependencyList::const_iterator iter = deps.begin(); iter != deps.end(); iter++) {
-       constDependencyPtr dep = *iter;
+          for (CapSet::const_iterator iter = deps.begin(); iter != deps.end(); iter++) {
+       const Capability dep = *iter;
        if (!context->requirementIsMet (dep, false)) {
-           if (getenv("RC_SPEW")) fprintf (stderr, "this requires %s\n", dep->asString().c_str());
+           if (getenv("RC_SPEW")) fprintf (stderr, "this requires %s\n", dep.asString().c_str());
            QueueItemRequirePtr req_item = new QueueItemRequire (world(), dep);
            req_item->addResItem (resItem);
            qil.push_front (req_item);
@@ -265,9 +271,9 @@ namespace zypp
           /* Construct conflict items for each of the resItem's conflicts. */
       
           deps = resItem->conflicts();
-          for (CDependencyList::const_iterator iter = deps.begin(); iter != deps.end(); iter++) {
-       constDependencyPtr dep = *iter;
-       if (getenv("RC_SPEW")) fprintf (stderr, "this conflicts with '%s'\n", dep->asString().c_str());
+          for (CapSet::const_iterator iter = deps.begin(); iter != deps.end(); iter++) {
+       const Capability dep = *iter;
+       if (getenv("RC_SPEW")) fprintf (stderr, "this conflicts with '%s'\n", dep.asString().c_str());
        QueueItemConflictPtr conflict_item = new QueueItemConflict (world(), dep, resItem);
        qil.push_front (conflict_item);
           }
@@ -275,9 +281,9 @@ namespace zypp
           /* Construct conflict items for each of the resItem's obsoletes. */
       
           deps = resItem->obsoletes();
-          for (CDependencyList::const_iterator iter = deps.begin(); iter != deps.end(); iter++) {
-       constDependencyPtr dep = *iter;
-       if (getenv("RC_SPEW")) fprintf (stderr, "this obsoletes %s\n", dep->asString().c_str());
+          for (CapSet::const_iterator iter = deps.begin(); iter != deps.end(); iter++) {
+       const Capability dep = *iter;
+       if (getenv("RC_SPEW")) fprintf (stderr, "this obsoletes %s\n", dep.asString().c_str());
        QueueItemConflictPtr conflict_item = new QueueItemConflict (world(), dep, resItem);
        conflict_item->setActuallyAnObsolete();
        qil.push_front (conflict_item);
@@ -286,8 +292,8 @@ namespace zypp
           /* Construct uninstall items for system resItem's that conflict with us. */
       
           deps = resItem->provides();
-          for (CDependencyList::const_iterator iter = deps.begin(); iter != deps.end(); iter++) {
-       constDependencyPtr dep = *iter;
+          for (CapSet::const_iterator iter = deps.begin(); iter != deps.end(); iter++) {
+       const Capability dep = *iter;
        world()->foreachConflictingResItem (dep, build_conflict_list, &conflicts);
           }
       
@@ -328,7 +334,7 @@ namespace zypp
           ((QueueItemPtr)new_install)->copy((constQueueItemPtr)this);
       
           new_install->_upgrades = _upgrades;
-          new_install->_deps_satisfied_by_this_install = CDependencyList(_deps_satisfied_by_this_install.begin(), _deps_satisfied_by_this_install.end());
+          new_install->_deps_satisfied_by_this_install = CapSet(_deps_satisfied_by_this_install.begin(), _deps_satisfied_by_this_install.end());
           new_install->_needed_by = CResItemList (_needed_by.begin(), _needed_by.end());
           new_install->_channel_priority = _channel_priority;
           new_install->_other_penalty = _other_penalty;
@@ -351,9 +357,9 @@ namespace zypp
       //---------------------------------------------------------------------------
       
       void 
-      QueueItemInstall::addDependency (constDependencyPtr dep)
+      QueueItemInstall::addDependency (const Capability & dep)
       {
-          _deps_satisfied_by_this_install.push_front (dep);
+          _deps_satisfied_by_this_install.insert (dep);
       }
       
       
index 4f8d0e4..09f0e5e 100644 (file)
@@ -28,8 +28,8 @@
 
 #include <zypp/solver/detail/QueueItemInstallPtr.h>
 #include <zypp/solver/detail/ResItem.h>
-#include <zypp/solver/detail/Dependency.h>
 #include <zypp/solver/detail/Channel.h>
+#include <zypp/CapSet.h>
 
 /////////////////////////////////////////////////////////////////////////
 namespace zypp 
@@ -51,7 +51,7 @@ namespace zypp
         private:
           constResItemPtr _resItem;
           constResItemPtr _upgrades;
-          CDependencyList _deps_satisfied_by_this_install;
+          CapSet _deps_satisfied_by_this_install;
           CResItemList _needed_by;
           int _channel_priority;
           int _other_penalty;
@@ -97,8 +97,8 @@ namespace zypp
           virtual bool isRedundant (ResolverContextPtr context) const { return false; }
           virtual bool isSatisfied (ResolverContextPtr context) const;
       
-          void addDependency (constDependencyPtr dep);
-          void addNeededBy (constResItemPtr resItem);
+          void addDependency (const Capability & dep);
+          void addNeededBy (const constResItemPtr resItem);
       
       };
       
index 7d71711..edad977 100644 (file)
@@ -31,6 +31,7 @@
 #include <zypp/solver/detail/ResolverInfoMisc.h>
 #include <zypp/solver/detail/ResolverInfoNeededBy.h>
 #include <zypp/solver/detail/World.h>
+#include <zypp/CapSet.h>
 
 /////////////////////////////////////////////////////////////////////////
 namespace zypp 
@@ -59,7 +60,7 @@ namespace zypp
       QueueItemRequire::toString ( const QueueItemRequire & item)
       {
           string ret = "[Require: ";
-          ret += item._dep->asString();
+          ret += item._dep.asString();
           if (item._requiring_resItem != NULL) {
        ret += ", Required by ";
        ret += item._requiring_resItem->asString();
@@ -96,7 +97,7 @@ namespace zypp
       
       //---------------------------------------------------------------------------
       
-      QueueItemRequire::QueueItemRequire (WorldPtr world, constDependencyPtr dep)
+      QueueItemRequire::QueueItemRequire (WorldPtr world, const Capability & dep)
           : QueueItem (QUEUE_ITEM_TYPE_REQUIRE, world)
           , _dep (dep)
           , _requiring_resItem (NULL)
@@ -128,7 +129,7 @@ namespace zypp
       
       typedef struct {
           constResItemPtr resItem;
-          constSpecPtr dep;
+          const Capability *dep;
           ResolverContextPtr context;
           WorldPtr world;
           CResItemList providers;
@@ -137,19 +138,19 @@ namespace zypp
       
       
       static bool
-      require_process_cb (constResItemPtr resItem, constSpecPtr spec, void *data)
+      require_process_cb (constResItemPtr resItem, const Capability & cap, void *data)
       {
           RequireProcessInfo *info = (RequireProcessInfo *)data;
           ResItemStatus status;
       
           status = info->context->getStatus (resItem);
-      //fprintf (stderr, "require_process_cb(res: %s, spec %s, status %s)\n", resItem->asString().c_str(), spec->asString().c_str(), ResolverContext::toString(status).c_str());
+      //fprintf (stderr, "require_process_cb(res: %s, spec %s, status %s)\n", resItem->asString().c_str(), cap.asString().c_str(), ResolverContext::toString(status).c_str());
       //fprintf (stderr, "require_process_cb(info->dep: %s)\n", info->dep ? info->dep->asString().c_str() : "(null)");
       //fprintf (stderr, "require_process_cb(resItemIsPossible -> %d)\n", info->context->resItemIsPossible (resItem));
           /* info->dep is set for resItem set childern only. If it is set
              allow only exactly required version */
           if (info->dep != NULL
-       && !info->dep->equals(spec)) {
+              && *(info->dep) != cap) {
        return true;
           }
       
@@ -168,7 +169,7 @@ namespace zypp
       
       
       static bool
-      no_installable_providers_info_cb (constResItemPtr resItem, constSpecPtr spec, void *data)
+      no_installable_providers_info_cb (constResItemPtr resItem, const Capability & cap, void *data)
       {
           RequireProcessInfo *info = (RequireProcessInfo *)data;
           ResItemStatus status;
@@ -177,13 +178,13 @@ namespace zypp
           status = info->context->getStatus (resItem);
       
           if (resItem_status_is_to_be_uninstalled (status)) {
-       msg_str = resItem->name() + " provides " + spec->asString() + ", but is scheduled to be uninstalled.";
+       msg_str = resItem->name() + " provides " + cap.asString() + ", but is scheduled to be uninstalled.";
           } else if (info->context->isParallelInstall (resItem)) {
-       msg_str = resItem->name() + " provides " + spec->asString() + ", but another version of that resItem is already installed.";
+       msg_str = resItem->name() + " provides " + cap.asString() + ", but another version of that resItem is already installed.";
           } else if (! info->context->resItemIsPossible (resItem)) {
-       msg_str = resItem->name() + " provides " + spec->asString() + ", but it is uninstallable.  Try installing it on its own for more details.";
+       msg_str = resItem->name() + " provides " + cap.asString() + ", but it is uninstallable.  Try installing it on its own for more details.";
           } else if (info->world->resItemIsLocked (resItem)) {
-       msg_str = resItem->name() + " provides " + spec->asString() + ", but it is locked.";
+       msg_str = resItem->name() + " provides " + cap.asString() + ", but it is locked.";
           }
       
           if (!msg_str.empty()) {
@@ -245,7 +246,7 @@ namespace zypp
           RequireProcessInfo info;
       
           info.resItem = _requiring_resItem;
-          info.dep = _is_child ? _dep : NULL;
+          info.dep = _is_child ? &_dep : NULL;
           info.context = context;
           info.world = world();
           info.uniq = new UniqTable();         //FIXME: op: g_hash_table_new (rc_resItem_spec_hash, rc_resItem_spec_equal);
@@ -274,7 +275,7 @@ namespace zypp
        if (_upgraded_resItem == NULL) {
            ResolverInfoPtr err_info;
       
-           msg = string ("There are no ") + (_remove_only ? "alternative installed" : "installable") + " providers of " + _dep->asString();
+           msg = string ("There are no ") + (_remove_only ? "alternative installed" : "installable") + " providers of " + _dep.asString();
            if (_requiring_resItem != NULL) {
                msg += " for ";
                msg += _requiring_resItem->asString();
@@ -304,7 +305,7 @@ namespace zypp
                req_str = _requiring_resItem->asString();
                up_str  = _upgraded_resItem->asString();
       
-               label = string ("for requiring ") + _dep->asString() + " for " + req_str + " when upgrading " + up_str;
+               label = string ("for requiring ") + _dep.asString() + " for " + req_str + " when upgrading " + up_str;
                branch_item->setLabel (label);
       //fprintf (stderr, "Branching: %s\n", label.c_str());
                for (CResItemList::const_iterator iter = upgrade_list.begin(); iter != upgrade_list.end(); iter++) {
@@ -325,10 +326,10 @@ namespace zypp
                        //   FIXME: should we also look at conflicts here?
       
                        if (explore_uninstall_branch) {
-                           CDependencyList requires = upgrade_resItem->requires();
-                           CDependencyList::const_iterator iter = requires.begin();
+                           CapSet requires = upgrade_resItem->requires();
+                           CapSet::const_iterator iter = requires.begin();
                            for (; iter != requires.end(); iter++) {
-                               constDependencyPtr req = *iter;
+                               const Capability req = *iter;
                                if (! context->requirementIsMet (req, false)) {
                                        break;
                                }
@@ -404,7 +405,7 @@ namespace zypp
            new_items.push_front (branch_item);
        } else {
            // We can't do anything to resolve the missing requirement, so we fail.
-           string msg = string ("Can't satisfy requirement '") + _dep->asString() + "'";
+           string msg = string ("Can't satisfy requirement '") + _dep.asString() + "'";
            
            context->addErrorString (NULL, msg);
        }
@@ -472,15 +473,15 @@ namespace zypp
       {
           int cmp = this->compare (item);              // assures equal type
           if (cmp != 0)
-       return cmp;
+              return cmp;
       
           constQueueItemRequirePtr require = item;
-      
-          cmp = Spec::compare ((constSpecPtr) _dep, ((constSpecPtr)(require->dependency())));
-          if (cmp)
-       return cmp;
-      
-          return _dep->relation() == require->dependency()->relation();
+
+          if (_dep != require->dependency())
+          {
+              cmp = -1;
+          }
+          return cmp;
       }
         
       ///////////////////////////////////////////////////////////////////
index ef9f057..2d52a56 100644 (file)
@@ -28,7 +28,7 @@
 
 #include <zypp/solver/detail/QueueItemRequirePtr.h>
 #include <zypp/solver/detail/ResItem.h>
-#include <zypp/solver/detail/Dependency.h>
+#include <zypp/Capability.h>
 #include <zypp/solver/detail/Channel.h>
 
 /////////////////////////////////////////////////////////////////////////
@@ -49,7 +49,7 @@ namespace zypp
           REP_BODY(QueueItemRequire);
       
         private:
-          constDependencyPtr _dep;
+          const Capability _dep;
           constResItemPtr _requiring_resItem;
           constResItemPtr _upgraded_resItem;
           constResItemPtr _lost_resItem;
@@ -58,7 +58,7 @@ namespace zypp
       
         public:
       
-          QueueItemRequire (WorldPtr world, constDependencyPtr dep);
+          QueueItemRequire (WorldPtr world, const Capability & dep);
           virtual ~QueueItemRequire();
       
           // ---------------------------------- I/O
@@ -73,7 +73,7 @@ namespace zypp
       
           // ---------------------------------- accessors
       
-          constDependencyPtr dependency (void) const { return _dep; }
+          const Capability & dependency (void) const { return _dep; }
       
           void setRemoveOnly (void) { _remove_only = true; }
           void setUpgradedResItem (constResItemPtr upgraded_resItem) { _upgraded_resItem = upgraded_resItem; }
index 1977511..0057d33 100644 (file)
@@ -25,6 +25,7 @@
 #include <zypp/solver/detail/ResolverContext.h>
 #include <zypp/solver/detail/ResolverInfoMissingReq.h>
 #include <zypp/solver/detail/World.h>
+#include <zypp/CapSet.h>
 
 /////////////////////////////////////////////////////////////////////////
 namespace zypp 
@@ -133,7 +134,7 @@ namespace zypp
       
       
       static bool
-      unlink_check_cb (constResItemPtr resItem, constDependencyPtr dep, void *data)
+      unlink_check_cb (constResItemPtr resItem, const Capability & dep, void *data)
       {
           UnlinkCheckInfo *info = (UnlinkCheckInfo *)data;
       
@@ -162,7 +163,7 @@ namespace zypp
       
       
       static bool
-      uninstall_process_cb (constResItemPtr resItem, constDependencyPtr dep, void *data)
+      uninstall_process_cb (constResItemPtr resItem, const Capability & dep, void *data)
       {
           UninstallProcessInfo *info = (UninstallProcessInfo *)data;
       
@@ -226,8 +227,8 @@ namespace zypp
            info.context = context;
            info.cancel_unlink = false;
       
-           CDependencyList provides = _resItem->provides();
-           for (CDependencyList::const_iterator iter = provides.begin(); iter != provides.end() && ! info.cancel_unlink; iter++) {
+           CapSet provides = _resItem->provides();
+           for (Capset::const_iterator iter = provides.begin(); iter != provides.end() && ! info.cancel_unlink; iter++) {
                world()->foreachRequiringResItem (*iter, unlink_check_cb, &info);
            }
       
@@ -266,8 +267,8 @@ namespace zypp
            context->addInfo (info);
        }
       
-       CDependencyList provides = _resItem->provides();
-       for (CDependencyList::const_iterator iter = provides.begin(); iter != provides.end(); iter++) {
+       CapSet provides = _resItem->provides();
+       for (CapSet::const_iterator iter = provides.begin(); iter != provides.end(); iter++) {
            UninstallProcessInfo info;
       
            info.world = world();
index 730a343..ca2e11a 100644 (file)
@@ -28,7 +28,7 @@
 
 #include <zypp/solver/detail/QueueItemUninstallPtr.h>
 #include <zypp/solver/detail/ResItem.h>
-#include <zypp/solver/detail/Dependency.h>
+#include <zypp/Capability.h>
 #include <zypp/solver/detail/Channel.h>
 
 /////////////////////////////////////////////////////////////////////////
@@ -51,7 +51,7 @@ namespace zypp
         private:
           constResItemPtr _resItem;
           const std::string _reason;
-          constDependencyPtr _dep_leading_to_uninstall;
+          Capability _dep_leading_to_uninstall;
           constResItemPtr _upgraded_to;
       
           bool _explicitly_requested;
@@ -77,7 +77,7 @@ namespace zypp
       
           // ---------------------------------- accessors
       
-          void setDependency (constDependencyPtr dep) { _dep_leading_to_uninstall = dep; }
+          void setDependency (const Capability & dep) { _dep_leading_to_uninstall = dep; }
           void setExplicitlyRequested (void) { _explicitly_requested = true; }
           void setRemoveOnly (void) { _remove_only = true; }
           void setUpgradedTo (constResItemPtr resItem) { _upgraded_to = resItem; }
index 268a742..83b808a 100644 (file)
@@ -55,7 +55,19 @@ namespace zypp
       IMPL_BASE_POINTER(ResItem);
       
       //---------------------------------------------------------------------------
-      
+
+      string
+      capSetToString (const CapSet & dl)
+      {
+          string res("[");
+          for (CapSet::const_iterator iter = dl.begin(); iter != dl.end(); iter++) {
+              if (iter != dl.begin()) res += ", ";
+              res += (*iter).asString();
+          }
+          return res + "]";
+      }
+
+        
       string
       ResItem::asString ( bool full ) const
       {
@@ -108,33 +120,33 @@ namespace zypp
       
           if (!resItem.requires().empty()) {
        res += ", Requires: ";
-       res += Dependency::toString(resItem.requires());
+       res += capSetToString(resItem.requires());
           }
       
           if (!resItem.provides().empty()) {
        res += ", Provides: ";
-       res += Dependency::toString(resItem.provides());
+       res += capSetToString(resItem.provides());
           }
           if (!resItem.conflicts().empty()) {
        res += ", Conflicts: ";
-       res += Dependency::toString(resItem.conflicts());
+       res += capSetToString(resItem.conflicts());
           }
           if (!resItem.obsoletes().empty()) {
        res += ", Obsoletes: ";
-       res += Dependency::toString(resItem.obsoletes());
+       res += capSetToString(resItem.obsoletes());
           }
       
           if (!resItem.suggests().empty()) {
        res += ", Suggests: ";
-       res += Dependency::toString(resItem.suggests());
+       res += capSetToString(resItem.suggests());
           }
           if (!resItem.recommends().empty()) {
        res += ", Recommends: ";
-       res += Dependency::toString(resItem.recommends());
+       res += capSetToString(resItem.recommends());
           }
           if (!resItem.freshens().empty()) {
        res += ", Freshens: ";
-       res += Dependency::toString(resItem.freshens());
+       res += capSetToString(resItem.freshens());
           }
           return res;
       }
index fadd711..8fc6439 100644 (file)
 
 #include <zypp/solver/detail/ResItemPtr.h>
 #include <zypp/solver/detail/StoreWorldPtr.h>
-#include <zypp/solver/detail/Dependency.h>
+#include <zypp/CapSet.h>
 #include <zypp/solver/detail/Channel.h>
 #include <zypp/ResObject.h>
 #include <zypp/Edition.h>
+#include <zypp/Dependencies.h>
 
 /////////////////////////////////////////////////////////////////////////
 namespace zypp 
@@ -49,8 +50,7 @@ namespace zypp
       typedef bool (*ResItemFn) (ResItemPtr r, void *data);
       typedef bool (*CResItemFn) (constResItemPtr r, void *data);
       typedef bool (*ResItemPairFn) (constResItemPtr r1, constResItemPtr r2, void *data);
-      typedef bool (*ResItemAndSpecFn) (constResItemPtr r, constSpecPtr spec, void *data);
-      typedef bool (*ResItemAndDepFn) (constResItemPtr r, constDependencyPtr dep, void *data);
+      typedef bool (*ResItemAndDepFn) (constResItemPtr r, const Capability & dep, void *data);
       
       ///////////////////////////////////////////////////////////////////
       //
@@ -72,15 +72,6 @@ namespace zypp
           size_t _file_size;
           size_t _installed_size;
       
-          CDependencyList _requires;
-          CDependencyList _provides;
-          CDependencyList _conflicts;
-          CDependencyList _obsoletes;
-      
-          CDependencyList _suggests;
-          CDependencyList _recommends;
-          CDependencyList _freshens;
-      
         protected:
       
           // ---------------------------------- accessors
@@ -130,26 +121,16 @@ namespace zypp
           size_t installedSize() const { return _installed_size; }
           void setInstalledSize (size_t installed_size) { _installed_size = installed_size; }
       
-          const CDependencyList & requires() const { return _requires; }
-          void setRequires (const CDependencyList & requires) { _requires = requires; }
-      
-          const CDependencyList & provides() const { return _provides; }
-          void setProvides (const CDependencyList & provides) { _provides = provides; }
-      
-          const CDependencyList & conflicts() const { return _conflicts; }
-          void setConflicts (const CDependencyList & conflicts) { _conflicts = conflicts; }
-      
-          const CDependencyList & obsoletes() const { return _obsoletes; }
-          void setObsoletes (const CDependencyList & obsoletes) { _obsoletes = obsoletes; }
-      
-          const CDependencyList & suggests() const { return _suggests; }
-          void setSuggests (const CDependencyList & suggests) { _suggests = suggests; }
-      
-          const CDependencyList & recommends() const { return _recommends; }
-          void setRecommends (const CDependencyList & recommends) { _recommends = recommends; }
-      
-          const CDependencyList & freshens() const { return _freshens; }
-          void setFreshens (const CDependencyList & freshens) { _freshens = freshens; }
+          const CapSet & requires() const { return _resObject->deps().requires(); }
+          const CapSet & provides() const { return _resObject->deps().provides(); }
+          const CapSet & conflicts() const { return _resObject->deps().conflicts(); }
+          const CapSet & obsoletes() const { return _resObject->deps().obsoletes(); }
+          const CapSet & suggests() const { return _resObject->deps().suggests(); }
+          const CapSet & recommends() const { return _resObject->deps().recommends(); }
+          const CapSet & freshens() const { return _resObject->deps().freshens(); }
+
+          void setDependencies (const Dependencies & dependencies) { _resObject->setDeps(dependencies); }
+          
 
           // Spec definitions
           
index 25b1f96..a19e8ae 100644 (file)
@@ -42,7 +42,7 @@ namespace zypp
       
       //---------------------------------------------------------------------------
       
-      ResItemAndDependency::ResItemAndDependency (constResItemPtr resItem, constDependencyPtr dependency)
+      ResItemAndDependency::ResItemAndDependency (constResItemPtr resItem, const Capability & dependency)
           : _resItem(resItem)
           , _dependency(dependency)
       {
@@ -63,7 +63,7 @@ namespace zypp
           string res ("{");
           res += r_and_d._resItem->asString(full);
           res += ", ";
-          res += r_and_d._dependency->asString();
+          res += r_and_d._dependency.asString();
           res += "}";
           return res;
       }
@@ -89,17 +89,21 @@ namespace zypp
       /* FIXME: rc_resItem_dep_verify_relation already checks the channel */
       
       bool
-      ResItemAndDependency::verifyRelation (constDependencyPtr dep) const
+      ResItemAndDependency::verifyRelation (const Capability & dep) const
       {
       #if PHI
           // don't check the channel, thereby honoring conflicts from installed resItems to to-be-installed resItems
-          return dep->verifyRelation (_dependency);
+          return dep.matches (_dependency);
       #else
-          if (!dep->verifyRelation (_dependency)) {
+          if (!dep.matches (_dependency)) {
        return false;
           }
+#if 0
           if (getenv ("SPEW_DEP")) fprintf (stderr, "ResItemAndDependency::verifyRelation _resItem->channel() %s, dep->channel() %s\n", _resItem->channel()->asString().c_str(), dep->channel()->asString().c_str());
           return _resItem->channel()->equals (dep->channel());
+#else
+          return true;
+#endif
       #endif
       }
         
index 690e316..9844784 100644 (file)
@@ -29,7 +29,7 @@
 
 #include <zypp/solver/detail/ResItemAndDependencyPtr.h>
 #include <zypp/solver/detail/ResItem.h>
-#include <zypp/solver/detail/Dependency.h>
+#include <zypp/Capability.h>
 
 /////////////////////////////////////////////////////////////////////////
 namespace zypp 
@@ -57,11 +57,11 @@ typedef std::multimap<const std::string, constResItemPtr> ResItemTable;
       
         private:
           constResItemPtr _resItem;
-          constDependencyPtr _dependency;
+          const Capability _dependency;
       
         public:
       
-          ResItemAndDependency (constResItemPtr resItem, constDependencyPtr dependency);
+          ResItemAndDependency (constResItemPtr resItem, const Capability & dependency);
           ~ResItemAndDependency () {}
       
           // ---------------------------------- I/O
@@ -77,11 +77,11 @@ typedef std::multimap<const std::string, constResItemPtr> ResItemTable;
           // ---------------------------------- accessors
       
           constResItemPtr resItem() const { return _resItem; }
-          constDependencyPtr dependency() const { return _dependency; }
+          const Capability & dependency() const { return _dependency; }
       
           // ---------------------------------- methods
       
-          bool verifyRelation (constDependencyPtr dep) const;
+          bool verifyRelation (const Capability & dep) const;
       };
         
       ///////////////////////////////////////////////////////////////////
index 6e064ff..28656cf 100644 (file)
@@ -144,13 +144,13 @@ namespace zypp
       }
       
       void
-      Resolver::addExtraDependency (constDependencyPtr dependency)
+      Resolver::addExtraDependency (const Capability & dependency)
       {
           _extra_deps.push_front (dependency);
       }
       
       void
-      Resolver::addExtraConflict (constDependencyPtr dependency)
+      Resolver::addExtraConflict (const Capability & dependency)
       {
           _extra_conflicts.push_front (dependency);
       }
@@ -315,11 +315,11 @@ namespace zypp
        initial_queue->addResItemToVerify (*iter);
           }
       
-          for (CDependencyList::const_iterator iter = _extra_deps.begin(); iter != _extra_deps.end(); iter++) {
+          for (CapSet::const_iterator iter = _extra_deps.begin(); iter != _extra_deps.end(); iter++) {
        initial_queue->addExtraDependency (*iter);
           }
       
-          for (CDependencyList::const_iterator iter = _extra_conflicts.begin(); iter != _extra_conflicts.end(); iter++) {
+          for (CapSet::const_iterator iter = _extra_conflicts.begin(); iter != _extra_conflicts.end(); iter++) {
        initial_queue->addExtraConflict (*iter);
           }
       
index 9e9c84e..d73149f 100644 (file)
@@ -29,8 +29,8 @@
 #include <zypp/solver/detail/ResolverPtr.h>
 #include <zypp/solver/detail/ResolverQueue.h>
 #include <zypp/solver/detail/ResItem.h>
-#include <zypp/solver/detail/Dependency.h>
 #include <zypp/solver/detail/Channel.h>
+#include <zypp/CapSet.h>
 
 /////////////////////////////////////////////////////////////////////////
 namespace zypp 
@@ -62,8 +62,8 @@ namespace zypp
           CResItemList _resItems_to_remove;
           CResItemList _resItems_to_verify;
       
-          CDependencyList _extra_deps;
-          CDependencyList _extra_conflicts;
+          CapSet _extra_deps;
+          CapSet _extra_conflicts;
       
           ResolverQueueList _pending_queues;
           ResolverQueueList _pruned_queues;
@@ -121,8 +121,8 @@ namespace zypp
       
           void addResItemToVerify (constResItemPtr resItem);
       
-          void addExtraDependency (constDependencyPtr dependency);
-          void addExtraConflict (constDependencyPtr dependency);
+          void addExtraDependency (const CapSet & dependency);
+          void addExtraConflict (const CapSet & dependency);
       
           void verifySystem (void);
           void resolveDependencies (void);
index 527a313..bb4849c 100644 (file)
@@ -26,6 +26,7 @@
 #include <zypp/solver/detail/ResolverContext.h>
 #include <zypp/solver/detail/ResolverInfoMisc.h>
 #include <zypp/solver/detail/World.h>
+#include <zypp/CapSet.h>
 
 /////////////////////////////////////////////////////////////////////////
 namespace zypp 
@@ -960,7 +961,7 @@ namespace zypp
       
       
       bool
-      ResolverContext::requirementIsMet (constDependencyPtr dependency, bool is_child)
+      ResolverContext::requirementIsMet (const Capability & dependency, bool is_child)
       {
           RequirementMetInfo info;
       
@@ -993,7 +994,7 @@ namespace zypp
       
       
       bool
-      ResolverContext::requirementIsPossible (constDependencyPtr dep)
+      ResolverContext::requirementIsPossible (const Capability & dep)
       {
           RequirementMetInfo info;
       
@@ -1009,8 +1010,8 @@ namespace zypp
       bool
       ResolverContext::resItemIsPossible (constResItemPtr resItem)
       {
-          CDependencyList requires = resItem->requires();
-          for (CDependencyList::iterator iter = requires.begin(); iter !=  requires.end(); iter++) {
+          CapSet requires = resItem->requires();
+          for (CapSet::iterator iter = requires.begin(); iter !=  requires.end(); iter++) {
            if (! requirementIsPossible (*iter)) {
                return false;
            }
index f8619e4..6a3813a 100644 (file)
@@ -31,6 +31,7 @@
 #include <zypp/solver/detail/ResolverInfo.h>
 #include <zypp/solver/detail/ResItem.h>
 #include <zypp/solver/detail/Channel.h>
+#include <zypp/Capability.h>
 
 /////////////////////////////////////////////////////////////////////////
 namespace zypp 
@@ -166,8 +167,8 @@ namespace zypp
           void spew (void);
           void spewInfo (void);
       
-          bool requirementIsMet (constDependencyPtr dep, bool is_child);
-          bool requirementIsPossible (constDependencyPtr dep);
+          bool requirementIsMet (const Capability & dep, bool is_child);
+          bool requirementIsPossible (const Capability & dep);
           bool resItemIsPossible (constResItemPtr resItem);
           bool isParallelInstall (constResItemPtr resItem);
       
index 4a495ba..8e085a3 100644 (file)
@@ -76,7 +76,7 @@ namespace zypp
       
       //---------------------------------------------------------------------------
       
-      ResolverInfoMissingReq::ResolverInfoMissingReq (constResItemPtr resItem, constDependencyPtr missing_req)
+      ResolverInfoMissingReq::ResolverInfoMissingReq (constResItemPtr resItem, const Capability & missing_req)
           : ResolverInfo (RESOLVER_INFO_TYPE_MISSING_REQ, resItem, RESOLVER_INFO_PRIORITY_USER)
           , _missing_req (missing_req)
       {
index 270d1c1..e620cd1 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <zypp/solver/detail/ResolverInfoMissingReqPtr.h>
 #include <zypp/solver/detail/ResolverInfo.h>
+#include <zypp/Capability.h>
 
 /////////////////////////////////////////////////////////////////////////
 namespace zypp 
@@ -45,11 +46,11 @@ namespace zypp
       
         private:
       
-          constDependencyPtr _missing_req;
+          const Capability  _missing_req;
       
         public:
       
-          ResolverInfoMissingReq (constResItemPtr resItem, constDependencyPtr missing_req);
+          ResolverInfoMissingReq (constResItemPtr resItem, const Capability & missing_req);
           virtual ~ResolverInfoMissingReq();
       
           // ---------------------------------- I/O
index 1472351..33a70b7 100644 (file)
@@ -29,6 +29,7 @@
 #include <zypp/solver/detail/QueueItemRequire.h>
 #include <zypp/solver/detail/QueueItemUninstall.h>
 #include <zypp/solver/detail/ResolverContext.h>
+#include <zypp/CapSet.h>
 
 #include <y2util/stringutil.h>
 
@@ -143,15 +144,15 @@ namespace zypp
           
           world = _context->world ();
       
-          CDependencyList requires = resItem->requires();
-          for (CDependencyList::const_iterator iter = requires.begin(); iter != requires.end(); iter++) {
+          CapSet requires = resItem->requires();
+          for (CapSet::const_iterator iter = requires.begin(); iter != requires.end(); iter++) {
        QueueItemRequirePtr item = new QueueItemRequire (world, *iter);
        item->addResItem (resItem);
        addItem (item);
           }
       
-          CDependencyList conflicts = resItem->conflicts();
-          for (CDependencyList::const_iterator iter = conflicts.begin(); iter != conflicts.end(); iter++) {
+          CapSet conflicts = resItem->conflicts();
+          for (CapSet::const_iterator iter = conflicts.begin(); iter != conflicts.end(); iter++) {
        QueueItemConflictPtr item = new QueueItemConflict (world, *iter, resItem);
        addItem (item);
           }
@@ -159,7 +160,7 @@ namespace zypp
       
       
       void
-      ResolverQueue::addExtraDependency (constDependencyPtr dep)
+      ResolverQueue::addExtraDependency (const Capability & dep)
       {
           QueueItemRequirePtr item = new QueueItemRequire (_context->world(), dep);
           addItem (item);
@@ -167,7 +168,7 @@ namespace zypp
       
       
       void
-      ResolverQueue::addExtraConflict (constDependencyPtr dep)
+      ResolverQueue::addExtraConflict (const Capability & dep)
       {
           QueueItemConflictPtr item = new QueueItemConflict (_context->world(), dep, NULL);
           addItem (item);
index 0cead07..2c370b5 100644 (file)
@@ -31,7 +31,7 @@
 #include <zypp/solver/detail/ResolverContextPtr.h>
 #include <zypp/solver/detail/QueueItem.h>
 #include <zypp/solver/detail/ResItemPtr.h>
-#include <zypp/solver/detail/DependencyPtr.h>
+#include <zypp/Capability.h>
 
 /////////////////////////////////////////////////////////////////////////
 namespace zypp 
@@ -80,8 +80,8 @@ namespace zypp
           void addResItemToInstall (constResItemPtr resItem);
           void addResItemToRemove (constResItemPtr resItem, bool remove_only_mode);
           void addResItemToVerify (constResItemPtr resItem);
-          void addExtraDependency (constDependencyPtr dep);
-          void addExtraConflict (constDependencyPtr dep);
+          void addExtraDependency (const Capability & dep);
+          void addExtraConflict (const Capability & dep);
           void addItem (QueueItemPtr item);
       
           bool isEmpty () const { return _items.empty(); }
index 287ed66..ff12c45 100644 (file)
@@ -28,6 +28,7 @@
 #include <zypp/solver/detail/ResItemAndDependency.h>
 #include <zypp/solver/detail/debug.h>
 #include <zypp/Arch.h>
+#include <zypp/CapSet.h>
 
 /////////////////////////////////////////////////////////////////////////
 namespace zypp 
@@ -187,34 +188,34 @@ namespace zypp
           _resItems_by_name.insert (ResItemTable::value_type (resItem->name(), resItem));
       
           /* StoreWorld all of the resItem's provides in a hash by name. */
-          for (CDependencyList::const_iterator i = resItem->provides().begin(); i != resItem->provides().end(); i++) {
+          for (CapSet::const_iterator i = resItem->provides().begin(); i != resItem->provides().end(); i++) {
        r_and_d = new ResItemAndDependency (resItem, *i);
       
-       _provides_by_name.insert (ResItemAndDependencyTable::value_type (r_and_d->dependency()->name(), r_and_d));
+       _provides_by_name.insert (ResItemAndDependencyTable::value_type (r_and_d->dependency().name(), r_and_d));
           }
       
           /* StoreWorld all of the resItem's requires in a hash by name. */
       
-          for (CDependencyList::const_iterator i = resItem->requires().begin(); i != resItem->requires().end(); i++) {
+          for (CapSet::const_iterator i = resItem->requires().begin(); i != resItem->requires().end(); i++) {
        r_and_d = new ResItemAndDependency (resItem, *i);
       
-       _requires_by_name.insert (ResItemAndDependencyTable::value_type (r_and_d->dependency()->name(), r_and_d));
+       _requires_by_name.insert (ResItemAndDependencyTable::value_type (r_and_d->dependency().name(), r_and_d));
           }
       
           /* "Recommends" are treated as requirements. */
       #warning Recommends are treated as requirements
       
-          for (CDependencyList::const_iterator i = resItem->recommends().begin(); i != resItem->recommends().end(); i++) {
+          for (CapSet::const_iterator i = resItem->recommends().begin(); i != resItem->recommends().end(); i++) {
        r_and_d = new ResItemAndDependency (resItem, *i);
       
-       _requires_by_name.insert (ResItemAndDependencyTable::value_type (r_and_d->dependency()->name(), r_and_d));
+       _requires_by_name.insert (ResItemAndDependencyTable::value_type (r_and_d->dependency().name(), r_and_d));
           }
       
           /* StoreWorld all of the resItem's conflicts in a hash by name. */
       
-          for (CDependencyList::const_iterator i = resItem->conflicts().begin(); i != resItem->conflicts().end(); i++) {
+          for (CapSet::const_iterator i = resItem->conflicts().begin(); i != resItem->conflicts().end(); i++) {
        r_and_d = new ResItemAndDependency (resItem, *i);
-       _conflicts_by_name.insert (ResItemAndDependencyTable::value_type (r_and_d->dependency()->name(), r_and_d));
+       _conflicts_by_name.insert (ResItemAndDependencyTable::value_type (r_and_d->dependency().name(), r_and_d));
           }
           
        finished:
@@ -357,7 +358,7 @@ namespace zypp
       
       
       constResItemPtr
-      StoreWorld::findResItemWithConstraint (constChannelPtr channel, const char *name, constDependencyPtr constraint, bool is_and) const
+      StoreWorld::findResItemWithConstraint (constChannelPtr channel, const char *name, const Capability & constraint, bool is_and) const
       {
        fprintf (stderr, "StoreWorld::findResItemWithConstraint() not implemented\n");
           return 0;
@@ -479,12 +480,12 @@ namespace zypp
       typedef std::map<constResItemPtr, constResItemAndDependencyPtr> InstalledTable;
       
       int
-      StoreWorld::foreachProvidingResItem (constDependencyPtr dep, ResItemAndSpecFn fn, void *data)
+      StoreWorld::foreachProvidingResItem (const Capability & dep, ResItemAndDepFn fn, void *data)
       {
           int count = 0;
           InstalledTable installed;
       //fprintf (stderr, "StoreWorld::foreachProvidingResItem(%s)\n", dep->asString().c_str());
-          for (ResItemAndDependencyTable::const_iterator iter = _provides_by_name.lower_bound(dep->name()); iter != _provides_by_name.upper_bound(dep->name()); iter++) {
+          for (ResItemAndDependencyTable::const_iterator iter = _provides_by_name.lower_bound(dep.name()); iter != _provides_by_name.upper_bound(dep.name()); iter++) {
        constResItemAndDependencyPtr r_and_d = iter->second;
        constResItemPtr res = r_and_d->resItem();
       //fprintf (stderr, "StoreWorld::foreachProvidingResItem(): %s\n", res->asString(true).c_str());
@@ -493,7 +494,7 @@ namespace zypp
        }
           }
       
-          for (ResItemAndDependencyTable::const_iterator iter = _provides_by_name.lower_bound(dep->name()); iter != _provides_by_name.upper_bound(dep->name()); iter++) {
+          for (ResItemAndDependencyTable::const_iterator iter = _provides_by_name.lower_bound(dep.name()); iter != _provides_by_name.upper_bound(dep.name()); iter++) {
        constResItemAndDependencyPtr r_and_d = iter->second;
       
        if (r_and_d && r_and_d->verifyRelation (dep)) {
@@ -521,13 +522,13 @@ namespace zypp
       }
       
       int
-      StoreWorld::foreachRequiringResItem (constDependencyPtr dep, ResItemAndDepFn fn, void *data)
+      StoreWorld::foreachRequiringResItem (const Capability & dep, ResItemAndDepFn fn, void *data)
       {
           int count = 0;
           InstalledTable installed;
       
       
-          for (ResItemAndDependencyTable::const_iterator iter = _requires_by_name.lower_bound(dep->name()); iter != _requires_by_name.upper_bound(dep->name()); iter++) {
+          for (ResItemAndDependencyTable::const_iterator iter = _requires_by_name.lower_bound(dep.name()); iter != _requires_by_name.upper_bound(dep.name()); iter++) {
        constResItemAndDependencyPtr r_and_d = iter->second;
        constResItemPtr res = r_and_d->resItem();
        if (res != NULL && res->isInstalled ()) {
@@ -536,10 +537,10 @@ namespace zypp
        }
           }
       
-          for (ResItemAndDependencyTable::const_iterator iter = _requires_by_name.lower_bound(dep->name()); iter != _requires_by_name.upper_bound(dep->name()); iter++) {
+          for (ResItemAndDependencyTable::const_iterator iter = _requires_by_name.lower_bound(dep.name()); iter != _requires_by_name.upper_bound(dep.name()); iter++) {
        constResItemAndDependencyPtr r_and_d = iter->second;
       
-       if (r_and_d && r_and_d->dependency()->verifyRelation (dep)) {
+       if (r_and_d && r_and_d->dependency().matches (dep)) {
       
            /* Skip dups if one of them in installed. */
            if (r_and_d->resItem()->isInstalled()
@@ -563,12 +564,12 @@ namespace zypp
       
       
       int
-      StoreWorld::foreachConflictingResItem (constDependencyPtr dep, ResItemAndDepFn fn, void *data)
+      StoreWorld::foreachConflictingResItem (const Capability & dep, ResItemAndDepFn fn, void *data)
       {
           int count = 0;
           InstalledTable installed;
       //fprintf (stderr, "StoreWorld::foreachConflictingResItem (%s)\n", dep->name().c_str());
-          for (ResItemAndDependencyTable::const_iterator iter = _conflicts_by_name.lower_bound(dep->name()); iter != _conflicts_by_name.upper_bound(dep->name()); iter++) {
+          for (ResItemAndDependencyTable::const_iterator iter = _conflicts_by_name.lower_bound(dep.name()); iter != _conflicts_by_name.upper_bound(dep.name()); iter++) {
        constResItemAndDependencyPtr r_and_d = iter->second;
        constResItemPtr res = r_and_d->resItem();
       //fprintf (stderr, "==> %s\n", res->asString().c_str());
@@ -577,7 +578,7 @@ namespace zypp
        }
           }
       
-          for (ResItemAndDependencyTable::const_iterator iter = _conflicts_by_name.lower_bound(dep->name()); iter != _conflicts_by_name.upper_bound(dep->name()); iter++) {
+          for (ResItemAndDependencyTable::const_iterator iter = _conflicts_by_name.lower_bound(dep.name()); iter != _conflicts_by_name.upper_bound(dep.name()); iter++) {
        constResItemAndDependencyPtr r_and_d = iter->second;
       
        if (r_and_d)
index cc01cf7..8fcc9c2 100644 (file)
@@ -33,7 +33,7 @@
 #include <zypp/solver/detail/World.h>
 #include <zypp/solver/detail/ResItem.h>
 #include <zypp/solver/detail/Match.h>
-
+#include <zypp/Capability.h>
 
 /////////////////////////////////////////////////////////////////////////
 namespace zypp 
@@ -102,9 +102,9 @@ namespace zypp
       
           // Iterate across provides or requirement
       
-          virtual int foreachProvidingResItem (constDependencyPtr dep, ResItemAndSpecFn fn, void *data);
-          virtual int foreachRequiringResItem (constDependencyPtr dep, ResItemAndDepFn fn, void *data);
-          virtual int foreachConflictingResItem (constDependencyPtr dep, ResItemAndDepFn fn, void *data);
+          virtual int foreachProvidingResItem (const Capability & dep, ResItemAndDepFn fn, void *data);
+          virtual int foreachRequiringResItem (const Capability & dep, ResItemAndDepFn fn, void *data);
+          virtual int foreachConflictingResItem (const Capability & dep, ResItemAndDepFn fn, void *data);
       
           // Channels
       
@@ -123,7 +123,7 @@ namespace zypp
       
           virtual constResItemPtr findInstalledResItem (constResItemPtr resItem);
           virtual constResItemPtr findResItem (constChannelPtr channel, const char *name) const;
-          virtual constResItemPtr findResItemWithConstraint (constChannelPtr channel, const char *name, constDependencyPtr constraint, bool is_and) const;
+          virtual constResItemPtr findResItemWithConstraint (constChannelPtr channel, const char *name, const Capability & constraint, bool is_and) const;
           virtual ChannelPtr guessResItemChannel (constResItemPtr resItem) const;
       
       };
index 6861d6d..ba3a60f 100644 (file)
@@ -35,6 +35,7 @@
 #include <zypp/solver/detail/Packman.h>
 #include <zypp/solver/detail/Package.h>
 #include <zypp/solver/detail/PackageUpdate.h>
+#include <zypp/Capability.h>
 
 /////////////////////////////////////////////////////////////////////////
 namespace zypp 
@@ -85,8 +86,7 @@ namespace zypp
       typedef void             (*WorldClearLockFn) (constWorldPtr world);
       
       typedef int              (*WorldForeachResItemFn) (constWorldPtr world, const char *name, constChannelPtr channel, ResItemFn callback, void *user_data);
-      typedef int              (*WorldForeachPackageSpecFn) (constWorldPtr world, constDependencyPtr dep, ResItemAndSpecFn callback, void *user_data);
-      typedef int              (*WorldForeachPackageDepFn) (constWorldPtr world, constDependencyPtr dep, ResItemAndDepFn callback, void *user_data);
+      typedef int              (*WorldForeachPackageDepFn) (constWorldPtr world, const Capability & dep, ResItemAndDepFn callback, void *user_data);
       
       typedef void             (*WorldSerializeFn) (constWorldPtr world, constXmlNodePtr root);
       typedef void             (*WorldUnserializeFn) (constWorldPtr world, constXmlNodePtr node);
@@ -210,7 +210,7 @@ namespace zypp
       
           virtual constResItemPtr findInstalledResItem (constResItemPtr resItem) = 0;
           virtual constResItemPtr findResItem (constChannelPtr channel, const char *name) const = 0;
-          virtual constResItemPtr findResItemWithConstraint (constChannelPtr channel, const char *name, constDependencyPtr constraint, bool is_and) const = 0;
+          virtual constResItemPtr findResItemWithConstraint (constChannelPtr channel, const char *name, const Capability &  constraint, bool is_and) const = 0;
           virtual ChannelPtr guessResItemChannel (constResItemPtr resItem) const = 0;
       
           // Iterate across resItems
@@ -221,9 +221,9 @@ namespace zypp
       
           // Iterate across provides or requirement
       
-          virtual int foreachProvidingResItem (constDependencyPtr dep, ResItemAndSpecFn fn, void *user_data) = 0;
-          virtual int foreachRequiringResItem (constDependencyPtr dep, ResItemAndDepFn fn, void *user_data) = 0;
-          virtual int foreachConflictingResItem (constDependencyPtr dep, ResItemAndDepFn fn, void *user_data) = 0;
+          virtual int foreachProvidingResItem (const Capability & dep, ResItemAndDepFn fn, void *user_data) = 0;
+          virtual int foreachRequiringResItem (const Capability & dep, ResItemAndDepFn fn, void *user_data) = 0;
+          virtual int foreachConflictingResItem (const Capability & dep, ResItemAndDepFn fn, void *user_data) = 0;
       
           // upgrades
       
@@ -234,7 +234,7 @@ namespace zypp
       
           // provider
       
-          bool getSingleProvider (constDependencyPtr dep, constChannelPtr channel, constResItemPtr *resItem);
+          bool getSingleProvider (const Capability & dep, constChannelPtr channel, constResItemPtr *resItem);
       
           // Transacting
       
index e737f5d..6648630 100644 (file)
 #include <ctype.h>
 #include <assert.h>
 #include <zypp/solver/detail/XmlParser.h>
-#include <zypp/solver/detail/Dependency.h>
-#include <zypp/solver/detail/OrDependency.h>
 #include <zypp/solver/detail/PackageUpdate.h>
 #include <zypp/solver/detail/utils.h>
 
 #include <zypp/solver/detail/debug.h>
 #include <zypp/ResObject.h>
 
+#include <zypp/CapFactory.h>
+#include <zypp/CapSet.h>
+#include <zypp/Dependencies.h>
+
 /////////////////////////////////////////////////////////////////////////
 namespace zypp 
 { ///////////////////////////////////////////////////////////////////////
   ///////////////////////////////////////////////////////////////////////
-  namespace solver
-  { /////////////////////////////////////////////////////////////////////
-    /////////////////////////////////////////////////////////////////////
-    namespace detail
-    { ///////////////////////////////////////////////////////////////////
+    namespace solver
+    { /////////////////////////////////////////////////////////////////////
+        /////////////////////////////////////////////////////////////////////
+        namespace detail
+        { ///////////////////////////////////////////////////////////////////
               
-      using namespace std;
-      
-      //---------------------------------------------------------------------------
-      
-      static DependencyPtr
-      parse_dep_attrs(bool *is_obsolete, const xmlChar **attrs)
-      {
-          int i;
-          bool op_present = false;
-          /* Temporary variables dependent upon the presense of an 'op' attribute */
-          const char *name = NULL;
-          int epoch = Edition::noepoch;
-          string version;
-          string release;
-          string arch = "";
-          Rel relation = Rel::ANY;
-      
-          *is_obsolete = false;
-      
-          for (i = 0; attrs[i]; i++) {
-       const char *attr = (const char *)attrs[i++];
-       const char *value = (const char *)attrs[i];
-      
-       if (!strcasecmp(attr, "name"))              name = value;
-       else if (!strcasecmp(attr, "op")) {         op_present = true; relation = Rel(value); }
-       else if (!strcasecmp(attr, "epoch"))        epoch = atoi (value);
-       else if (!strcasecmp(attr, "version"))      version = value;
-       else if (!strcasecmp(attr, "release"))      release = value;
-       else if (!strcasecmp(attr, "arch"))         arch = value;
-       else if (!strcasecmp (attr, "obsoletes"))   *is_obsolete = true;
-       else {
-           if (getenv ("RC_SPEW_XML")) rc_debug (RC_DEBUG_LEVEL_ALWAYS, "! Unknown attribute: %s = %s", attr, value);
-       }
-      
-          }
-      
-          /* FIXME: should get Channel from XML */
-          /* FIXME: should get Kind from XML */
-          if ( std::strlen(arch.c_str()) > 0)
-          {
-              return new Dependency (name, relation, ResTraits<zypp::Package>::kind, new Channel(CHANNEL_TYPE_ANY), epoch, version, release, Arch(arch));
-          }
-          else
-          {
-              return new Dependency (name, relation, ResTraits<zypp::Package>::kind, new Channel(CHANNEL_TYPE_ANY), epoch, version, release, Arch_noarch);
-          }              
-      }
-      
-      
-      //---------------------------------------------------------------------------
-      // SAX callbacks
-      
-      static void
-      sax_start_document(void *ptr)
-      {
-          XmlParser *ctx = (XmlParser *)ptr;
-          if (ctx->processing()) return;
-      
-      //    if (getenv ("RC_SPEW_XML")) rc_debug (RC_DEBUG_LEVEL_ALWAYS, "* Start document");
-      
-          ctx->setProcessing (true);
-      }
-      
-      
-      static void
-      sax_end_document(void *ptr)
-      {
-          XmlParser *ctx = (XmlParser *)ptr;
-          if (!ctx->processing()) return;
-      
-      //    if (getenv ("RC_SPEW_XML")) rc_debug (RC_DEBUG_LEVEL_ALWAYS, "* End document");
-      
-          ctx->setProcessing (false);
-      }
-      
-      
-      static void
-      sax_start_element(void *ptr, const xmlChar *name, const xmlChar **attrs)
-      {
-          XmlParser *ctx = (XmlParser *)ptr;
-      
-          ctx->releaseBuffer();
-      
-      #if 0
-      //    if (getenv ("RC_SPEW_XML"))        rc_debug (RC_DEBUG_LEVEL_ALWAYS, "* Start element (%s)", (const char *)name);
-      
-          if (attrs) {
-       for (int i = 0; attrs[i]; i += 2) {
-           if (getenv ("RC_SPEW_XML")) rc_debug (RC_DEBUG_LEVEL_ALWAYS, "   - Attribute (%s=%s)", (const char *)attrs[i], (const char *)attrs[i+1]);
-       }
-          }
-      #endif
-          if (!strcmp((const char *)name, "channel") || !strcmp((const char *)name, "subchannel")) {
-       /* Unneeded container tags.  Ignore */
-       return;
-          }
-      
-          return ctx->startElement ((const char *)name, attrs);
-      
-      }
-      
-      
-      static void
-      sax_end_element(void *ptr, const xmlChar *name)
-      {
-          XmlParser *ctx = (XmlParser *)ptr;
-      
-      //    if (getenv ("RC_SPEW_XML"))        rc_debug (RC_DEBUG_LEVEL_ALWAYS, "* End element (%s)", (const char *)name);
+            using namespace std;
+      
+            //---------------------------------------------------------------------------
+      
+            static Capability
+            parse_dep_attrs(bool *is_obsolete, const xmlChar **attrs)
+            {
+                CapFactory  factory;                
+                int i;
+                bool op_present = false;
+                /* Temporary variables dependent upon the presense of an 'op' attribute */
+                const char *name = NULL;
+                int epoch = Edition::noepoch;
+                string version;
+                string release;
+                string arch = "";
+                Rel relation = Rel::ANY;
+      
+                *is_obsolete = false;
+      
+                for (i = 0; attrs[i]; i++) {
+                    const char *attr = (const char *)attrs[i++];
+                    const char *value = (const char *)attrs[i];
+      
+                    if (!strcasecmp(attr, "name"))                 name = value;
+                    else if (!strcasecmp(attr, "op")) {            op_present = true; relation = Rel(value); }
+                    else if (!strcasecmp(attr, "epoch"))           epoch = atoi (value);
+                    else if (!strcasecmp(attr, "version"))      version = value;
+                    else if (!strcasecmp(attr, "release"))         release = value;
+                    else if (!strcasecmp(attr, "arch"))            arch = value;
+                    else if (!strcasecmp (attr, "obsoletes"))   *is_obsolete = true;
+                    else {
+                        if (getenv ("RC_SPEW_XML"))    rc_debug (RC_DEBUG_LEVEL_ALWAYS, "! Unknown attribute: %s = %s", attr, value);
+                    }
+      
+                }
+      
+                /* FIXME: should get Channel from XML */
+                /* FIXME: should get Kind from XML */
+                if ( std::strlen(arch.c_str()) > 0)
+                {
+                    return  factory.parse ( ResTraits<zypp::Package>::kind,
+                                            name,
+                                            relation,
+                                            Edition (version, release, epoch),
+                                            Arch(arch));
+                }
+                else
+                {
+                    return  factory.parse ( ResTraits<zypp::Package>::kind,
+                                            name,
+                                            relation,
+                                            Edition (version, release, epoch),
+                                            Arch_noarch);                    
+                }              
+            }
+      
+      
+            //---------------------------------------------------------------------------
+            // SAX callbacks
+      
+            static void
+            sax_start_document(void *ptr)
+            {
+                XmlParser *ctx = (XmlParser *)ptr;
+                if (ctx->processing()) return;
+      
+                //    if (getenv ("RC_SPEW_XML")) rc_debug (RC_DEBUG_LEVEL_ALWAYS, "* Start document");
+      
+                ctx->setProcessing (true);
+            }
+      
+      
+            static void
+            sax_end_document(void *ptr)
+            {
+                XmlParser *ctx = (XmlParser *)ptr;
+                if (!ctx->processing()) return;
+      
+                //    if (getenv ("RC_SPEW_XML")) rc_debug (RC_DEBUG_LEVEL_ALWAYS, "* End document");
+      
+                ctx->setProcessing (false);
+            }
+      
+      
+            static void
+            sax_start_element(void *ptr, const xmlChar *name, const xmlChar **attrs)
+            {
+                XmlParser *ctx = (XmlParser *)ptr;
+      
+                ctx->releaseBuffer();
+      
+#if 0
+                //    if (getenv ("RC_SPEW_XML"))      rc_debug (RC_DEBUG_LEVEL_ALWAYS, "* Start element (%s)", (const char *)name);
+      
+                if (attrs) {
+                    for (int i = 0; attrs[i]; i += 2) {
+                        if (getenv ("RC_SPEW_XML")) rc_debug (RC_DEBUG_LEVEL_ALWAYS, "   - Attribute (%s=%s)", (const char *)attrs[i], (const char *)attrs[i+1]);
+                    }
+                }
+#endif
+                if (!strcmp((const char *)name, "channel") || !strcmp((const char *)name, "subchannel")) {
+                    /* Unneeded container tags.  Ignore */
+                    return;
+                }
+      
+                return ctx->startElement ((const char *)name, attrs);
+      
+            }
+      
+      
+            static void
+            sax_end_element(void *ptr, const xmlChar *name)
+            {
+                XmlParser *ctx = (XmlParser *)ptr;
+      
+                //    if (getenv ("RC_SPEW_XML"))      rc_debug (RC_DEBUG_LEVEL_ALWAYS, "* End element (%s)", (const char *)name);
           
-          if (!strcmp((const char *)name, "channel") || !strcmp((const char *)name, "subchannel")) {
-       /* Unneeded container tags.  Ignore */
-       name = NULL;
-          }
-      
-          return ctx->endElement ((const char *)name);
-      }
-      
-      
-      static void
-      sax_characters(void *ptr, const xmlChar *ch, int len)
-      {
-          XmlParser *ctx = (XmlParser *)ptr;
-      
-          ctx->toBuffer ((const char *)ch, len);
-          return;
-      }
-      
-      
-      static void
-      sax_warning(void *ptr, const char *msg, ...)
-      {
-          va_list args;
-          char tmp[2048];
-      
-          va_start(args, msg);
-      
-          if (vsnprintf(tmp, 2048, msg, args) >= 2048) fprintf (stderr, "vsnprintf overflow\n");
-          rc_debug (RC_DEBUG_LEVEL_WARNING, "* SAX Warning: %s", tmp);
-      
-          va_end(args);
-      }
-      
-      
-      static void
-      sax_error(void *ptr, const char *msg, ...)
-      {
-          va_list args;
-          char tmp[2048];
-      
-          va_start(args, msg);
-      
-          if (vsnprintf(tmp, 2048, msg, args) >= 2048) fprintf (stderr, "vsnprintf overflow\n");
-          rc_debug (RC_DEBUG_LEVEL_ERROR, "* SAX Error: %s", tmp);
-      
-          va_end(args);
-      }
-      
-      
-      static xmlSAXHandler sax_handler = {
-          NULL,                /* internalSubset */
-          NULL,                /* isStandalone */
-          NULL,                /* hasInternalSubset */
-          NULL,                /* hasExternalSubset */
-          NULL,                /* resolveEntity */
-          NULL,                /* getEntity */
-          NULL,                /* entityDecl */
-          NULL,                /* notationDecl */
-          NULL,                /* attributeDecl */
-          NULL,                /* elementDecl */
-          NULL,                /* unparsedEntityDecl */
-          NULL,                /* setDocumentLocator */
-          sax_start_document,  /* startDocument */
-          sax_end_document,    /* endDocument */
-          sax_start_element,   /* startElement */
-          sax_end_element,     /* endElement */
-          NULL,                /* reference */
-          sax_characters,     /* characters */
-          NULL,                /* ignorableWhitespace */
-          NULL,                /* processingInstruction */
-          NULL,                /* comment */
-          sax_warning, /* warning */
-          sax_error,           /* error */
-          sax_error            /* fatalError */
-      };
-      
-      //---------------------------------------------------------------------------
-      
-      XmlParser::XmlParser (constChannelPtr channel)
-          : _channel (channel)
-          , _processing (false)
-          , _xml_context (NULL)
-          , _state (PARSER_TOPLEVEL)
-          , _current_package_stored(true)
-          , _current_update (NULL)
-          , _toplevel_dep_list (NULL)
-          , _current_dep_list (NULL)
-          , _text_buffer (NULL)
-          , _text_buffer_size (0)
-      {
-      //    if (getenv ("RC_SPEW_XML")) rc_debug (RC_DEBUG_LEVEL_ALWAYS, "* Context created (%p)", this);
-      }
-      
-      
-      XmlParser::~XmlParser()
-      {
-          releaseBuffer ();
-      }
-      
-      //---------------------------------------------------------------------------
-      
-      string
-      XmlParser::asString ( void ) const
-      {
-          return toString (*this);
-      }
-      
-      
-      string
-      XmlParser::toString ( const XmlParser & context )
-      {
-          return "<XmlParser/>";
-      }
-      
-      
-      ostream &
-      XmlParser::dumpOn( ostream & str ) const
-      {
-          str << asString();
-          return str;
-      }
-      
-      
-      ostream&
-      operator<<( ostream& os, const XmlParser& context)
-      {
-          return os << context.asString();
-      }
-      
-      //---------------------------------------------------------------------------
-      
-      void
-      XmlParser::toBuffer (const char *data, size_t size)
-      {
-          _text_buffer = (char *)realloc (_text_buffer, _text_buffer_size + size + 1);
-          strncpy (_text_buffer + _text_buffer_size, (char *)data, size);
-          _text_buffer_size += size;
-          _text_buffer[_text_buffer_size] = 0;
-      
-      //    if (getenv ("RC_SPEW_XML"))        fprintf (stderr, "XmlParser[%p]::toBuffer(%.32s...,%ld)\n", this, data, (long)size);
-      }
-      
-      
-      void
-      XmlParser::releaseBuffer ()
-      {
-          if (_text_buffer)
-       free (_text_buffer);
-          _text_buffer = NULL;
-          _text_buffer_size = 0;
-      //    if (getenv ("RC_SPEW_XML"))        fprintf (stderr, "XmlParser[%p]::releaseBuffer()\n", this);
-      }
-      
-      
-      void
-      XmlParser::parseChunk(const char *xmlbuf, size_t size)
-      {
-          if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::parseChunk(%.32s...,%ld)\n", xmlbuf, (long)size);
-      
-          xmlSubstituteEntitiesDefault(true);
+                if (!strcmp((const char *)name, "channel") || !strcmp((const char *)name, "subchannel")) {
+                    /* Unneeded container tags.  Ignore */
+                    name = NULL;
+                }
+      
+                return ctx->endElement ((const char *)name);
+            }
+      
+      
+            static void
+            sax_characters(void *ptr, const xmlChar *ch, int len)
+            {
+                XmlParser *ctx = (XmlParser *)ptr;
+      
+                ctx->toBuffer ((const char *)ch, len);
+                return;
+            }
+      
+      
+            static void
+            sax_warning(void *ptr, const char *msg, ...)
+            {
+                va_list args;
+                char tmp[2048];
+      
+                va_start(args, msg);
+      
+                if (vsnprintf(tmp, 2048, msg, args) >= 2048) fprintf (stderr, "vsnprintf overflow\n");
+                rc_debug (RC_DEBUG_LEVEL_WARNING, "* SAX Warning: %s", tmp);
+      
+                va_end(args);
+            }
+      
+      
+            static void
+            sax_error(void *ptr, const char *msg, ...)
+            {
+                va_list args;
+                char tmp[2048];
+      
+                va_start(args, msg);
+      
+                if (vsnprintf(tmp, 2048, msg, args) >= 2048) fprintf (stderr, "vsnprintf overflow\n");
+                rc_debug (RC_DEBUG_LEVEL_ERROR, "* SAX Error: %s", tmp);
+      
+                va_end(args);
+            }
+      
+      
+            static xmlSAXHandler sax_handler = {
+                NULL,          /* internalSubset */
+                NULL,          /* isStandalone */
+                NULL,          /* hasInternalSubset */
+                NULL,          /* hasExternalSubset */
+                NULL,          /* resolveEntity */
+                NULL,          /* getEntity */
+                NULL,          /* entityDecl */
+                NULL,          /* notationDecl */
+                NULL,          /* attributeDecl */
+                NULL,          /* elementDecl */
+                NULL,          /* unparsedEntityDecl */
+                NULL,          /* setDocumentLocator */
+                sax_start_document,    /* startDocument */
+                sax_end_document,      /* endDocument */
+                sax_start_element,     /* startElement */
+                sax_end_element,       /* endElement */
+                NULL,          /* reference */
+                sax_characters,     /* characters */
+                NULL,          /* ignorableWhitespace */
+                NULL,          /* processingInstruction */
+                NULL,          /* comment */
+                sax_warning,   /* warning */
+                sax_error,             /* error */
+                sax_error              /* fatalError */
+            };
+      
+            //---------------------------------------------------------------------------
+      
+            XmlParser::XmlParser (constChannelPtr channel)
+                : _channel (channel)
+                , _processing (false)
+                , _xml_context (NULL)
+                , _state (PARSER_TOPLEVEL)
+                , _current_package_stored(true)
+                , _current_update (NULL)
+                , _toplevel_dep_list (NULL)
+                , _current_dep_list (NULL)
+                , _text_buffer (NULL)
+                , _text_buffer_size (0)
+            {
+                //    if (getenv ("RC_SPEW_XML")) rc_debug (RC_DEBUG_LEVEL_ALWAYS, "* Context created (%p)", this);
+            }
+      
+      
+            XmlParser::~XmlParser()
+            {
+                releaseBuffer ();
+            }
+      
+            //---------------------------------------------------------------------------
+      
+            string
+            XmlParser::asString ( void ) const
+            {
+                return toString (*this);
+            }
+      
+      
+            string
+            XmlParser::toString ( const XmlParser & context )
+            {
+                return "<XmlParser/>";
+            }
+      
+      
+            ostream &
+            XmlParser::dumpOn( ostream & str ) const
+            {
+                str << asString();
+                return str;
+            }
+      
+      
+            ostream&
+            operator<<( ostream& os, const XmlParser& context)
+            {
+                return os << context.asString();
+            }
+      
+            //---------------------------------------------------------------------------
+      
+            void
+            XmlParser::toBuffer (const char *data, size_t size)
+            {
+                _text_buffer = (char *)realloc (_text_buffer, _text_buffer_size + size + 1);
+                strncpy (_text_buffer + _text_buffer_size, (char *)data, size);
+                _text_buffer_size += size;
+                _text_buffer[_text_buffer_size] = 0;
+      
+                //    if (getenv ("RC_SPEW_XML"))      fprintf (stderr, "XmlParser[%p]::toBuffer(%.32s...,%ld)\n", this, data, (long)size);
+            }
+      
+      
+            void
+            XmlParser::releaseBuffer ()
+            {
+                if (_text_buffer)
+                    free (_text_buffer);
+                _text_buffer = NULL;
+                _text_buffer_size = 0;
+                //    if (getenv ("RC_SPEW_XML"))      fprintf (stderr, "XmlParser[%p]::releaseBuffer()\n", this);
+            }
+      
+      
+            void
+            XmlParser::parseChunk(const char *xmlbuf, size_t size)
+            {
+                if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::parseChunk(%.32s...,%ld)\n", xmlbuf, (long)size);
+      
+                xmlSubstituteEntitiesDefault(true);
           
-          if (!_xml_context) {
-       _xml_context = xmlCreatePushParserCtxt(&sax_handler, this, NULL, 0, NULL);
-          }
+                if (!_xml_context) {
+                    _xml_context = xmlCreatePushParserCtxt(&sax_handler, this, NULL, 0, NULL);
+                }
       
-          xmlParseChunk(_xml_context, xmlbuf, size, 0);
-      }
+                xmlParseChunk(_xml_context, xmlbuf, size, 0);
+            }
       
       
-      PackageList
-      XmlParser::done()
-      {
-      //    if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::done()\n");
+            PackageList
+            XmlParser::done()
+            {
+                //    if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::done()\n");
       
-          if (_processing)
-       xmlParseChunk(_xml_context, NULL, 0, 1);
+                if (_processing)
+                    xmlParseChunk(_xml_context, NULL, 0, 1);
       
-          if (_xml_context)
-       xmlFreeParserCtxt(_xml_context);
+                if (_xml_context)
+                    xmlFreeParserCtxt(_xml_context);
           
-          if (!_current_package_stored) {
-       fprintf (stderr, "Incomplete package lost\n");
-          }
-      
-          if (_current_update) {
-       fprintf (stderr, "Incomplete update lost");
-          }
-      
-          return _all_packages;
-      }
-      
-      
-      //---------------------------------------------------------------------------
-      // Parser state callbacks
-      
-      void
-      XmlParser::startElement(const char *name, const xmlChar **attrs)
-      {
-      //    if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::startElement(%s)\n", name);
-      
-          switch (_state) {
-          case PARSER_TOPLEVEL:
-       toplevelStart(name, attrs);
-       break;
-          case PARSER_PACKAGE:
-       packageStart(name, attrs);
-       break;
-          case PARSER_HISTORY:
-       historyStart(name, attrs);
-       break;
-          case PARSER_DEP:
-       dependencyStart(name, attrs);
-       break;
-          default:
-       break;
-          }
-      
-          return;
-      }
-      
-      
-      void
-      XmlParser::endElement(const char *name)
-      {
-      //    if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::endElement(%s)\n", name);
-      
-          if (name != NULL) {                  // sax_end_element might set name to NULL
-       switch (_state) {
-           case PARSER_PACKAGE:
-               packageEnd(name);
-               break;
-           case PARSER_HISTORY:
-               historyEnd(name);
-               break;
-           case PARSER_UPDATE:
-               updateEnd(name);
-               break;
-           case PARSER_DEP:
-               dependencyEnd(name);
-               break;
-           default:
-               break;
-       }
-          }
-      
-          releaseBuffer();
-      
-          return;
-      }
-      
-      
-      void
-      XmlParser::toplevelStart(const char * name, const xmlChar **attrs)
-      {
-          //    if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::toplevelStart(%s)\n", name);
-      
-          if (!strcmp(name, "package")) {
+                if (!_current_package_stored) {
+                    fprintf (stderr, "Incomplete package lost\n");
+                }
+      
+                if (_current_update) {
+                    fprintf (stderr, "Incomplete update lost");
+                }
+      
+                return _all_packages;
+            }
+      
+      
+            //---------------------------------------------------------------------------
+            // Parser state callbacks
+      
+            void
+            XmlParser::startElement(const char *name, const xmlChar **attrs)
+            {
+                //    if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::startElement(%s)\n", name);
+      
+                switch (_state) {
+                    case PARSER_TOPLEVEL:
+                        toplevelStart(name, attrs);
+                        break;
+                    case PARSER_PACKAGE:
+                        packageStart(name, attrs);
+                        break;
+                    case PARSER_HISTORY:
+                        historyStart(name, attrs);
+                        break;
+                    case PARSER_DEP:
+                        dependencyStart(name, attrs);
+                        break;
+                    default:
+                        break;
+                }
+      
+                return;
+            }
+      
+      
+            void
+            XmlParser::endElement(const char *name)
+            {
+                //    if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::endElement(%s)\n", name);
+      
+                if (name != NULL) {                    // sax_end_element might set name to NULL
+                    switch (_state) {
+                        case PARSER_PACKAGE:
+                            packageEnd(name);
+                            break;
+                        case PARSER_HISTORY:
+                            historyEnd(name);
+                            break;
+                        case PARSER_UPDATE:
+                            updateEnd(name);
+                            break;
+                        case PARSER_DEP:
+                            dependencyEnd(name);
+                            break;
+                        default:
+                            break;
+                    }
+                }
+      
+                releaseBuffer();
+      
+                return;
+            }
+      
+      
+            void
+            XmlParser::toplevelStart(const char * name, const xmlChar **attrs)
+            {
+                //    if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::toplevelStart(%s)\n", name);
+      
+                if (!strcmp(name, "package")) {
             
-              _state = PARSER_PACKAGE;
-      
-              _current_package_stored = false;
-              _current_package_name = "";
-              _current_package_prettyName = "";
-              _current_package_summary = "";
-              _current_package_description = "";
-              _current_package_section = "";
-              _current_package_kind = ResTraits<zypp::Package>::kind;
-              _current_package_arch = Arch_noarch;
-              _current_package_edition = Edition::noedition;
-              _current_package_fileSize = 0;
-              _current_package_installedSize = 0;
-              _current_package_installOnly = false;
-              _current_package_packageSet = false;
-              _current_package_packageUpdateList.clear();
+                    _state = PARSER_PACKAGE;
+      
+                    _current_package_stored = false;
+                    _current_package_name = "";
+                    _current_package_prettyName = "";
+                    _current_package_summary = "";
+                    _current_package_description = "";
+                    _current_package_section = "";
+                    _current_package_kind = ResTraits<zypp::Package>::kind;
+                    _current_package_arch = Arch_noarch;
+                    _current_package_edition = Edition::noedition;
+                    _current_package_fileSize = 0;
+                    _current_package_installedSize = 0;
+                    _current_package_installOnly = false;
+                    _current_package_packageSet = false;
+                    _current_package_packageUpdateList.clear();
               
-              _current_requires.clear();
-              _current_provides.clear();
-              _current_conflicts.clear();
-              _current_children.clear();
-              _current_recommends.clear();
-              _current_suggests.clear();
-              _current_obsoletes.clear();
-      
-          }
-          else {
-              if (getenv ("RC_SPEW_XML")) rc_debug (RC_DEBUG_LEVEL_ALWAYS, "! Not handling %s at toplevel", (const char *)name);
-          }
-      }
-      
-      
-      void
-      XmlParser::packageStart(const char * name, const xmlChar **attrs)
-      {
-      //    if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::packageStart(%s)\n", name);
-      
-          /* Only care about the containers here */
-          if (!strcmp((const char *)name, "history")) {
-       _state = PARSER_HISTORY;
-          }
-          else if (!strcmp (name, "deps")) {
-       /*
-        * We can get a <deps> tag surrounding the actual package
-        * dependency sections (requires, provides, conflicts, etc).
-        * In this case, we'll just ignore this tag quietly.
-        */
-          }
-          else if (!strcmp(name, "requires")) {
-       _state = PARSER_DEP;
-       _current_dep_list = _toplevel_dep_list = &_current_requires;
-          }
-          else if (!strcmp(name, "recommends")) {
-       _state = PARSER_DEP;
-       _current_dep_list = _toplevel_dep_list = &_current_recommends;
-          }
-          else if (!strcmp(name, "suggests")) {
-       _state = PARSER_DEP;
-       _current_dep_list = _toplevel_dep_list = &_current_suggests;
-          }
-          else if (!strcmp(name, "conflicts")) {
-       bool is_obsolete = false;
-       int i;
-      
-       _state = PARSER_DEP;
-      
-       for (i = 0; attrs && attrs[i] && !is_obsolete; i += 2) {
-      
-           if (!strcasecmp ((const char *)(attrs[i]), "obsoletes"))
-               is_obsolete = true;
-       }
-      
-       if (is_obsolete)
-           _current_dep_list = _toplevel_dep_list = &_current_obsoletes;
-       else {
-           _current_dep_list = _toplevel_dep_list = &_current_conflicts;
-       }
-          }
-          else if (!strcmp(name, "obsoletes")) {
-       _state = PARSER_DEP;
-       _current_dep_list = _toplevel_dep_list = &_current_obsoletes;
-          }
-          else if (!strcmp(name, "provides")) {
-       _state = PARSER_DEP;
-       _current_dep_list = _toplevel_dep_list = &_current_provides;
-          }
-          else if (!strcmp(name, "children")) {
-       _state = PARSER_DEP;
-       _current_dep_list = _toplevel_dep_list = &_current_children;
-          } 
-          else {
-      //       if (getenv ("RC_SPEW_XML")) rc_debug (RC_DEBUG_LEVEL_ALWAYS, "! Not handling %s in package start", name);
-          }
-      }
-      
-      
-      void
-      XmlParser::historyStart(const char * name, const xmlChar **attrs)
-      {
-      //    if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::historyStart(%s)\n", name);
-      
-          if (!strcmp(name, "update")) {
-       assert(_current_update == NULL);
-      
-       _current_update = new PackageUpdate(_current_package_name);
-      
-       _state = PARSER_UPDATE;
-          }
-          else {
-       if (getenv ("RC_SPEW_XML")) rc_debug (RC_DEBUG_LEVEL_ALWAYS, "! Not handling %s in history", name);
-          }
-      }
-      
-      
-      void
-      XmlParser::dependencyStart(const char *name, const xmlChar **attrs)
-      {
-      //    if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::dependencyStart(%s)\n", name);
-      
-          if (!strcmp(name, "dep")) {
-       DependencyPtr dep;
-       bool is_obsolete;
-      
-       dep = parse_dep_attrs(&is_obsolete, attrs);
-      
-       if (is_obsolete)
-           _current_obsoletes.push_back (dep);
-       else {
-           _current_dep_list->push_back (dep);
-       }
-          }
-          else if (!strcmp(name, "or"))
-       _current_dep_list = new CDependencyList;
-          else {
-       if (getenv ("RC_SPEW_XML")) rc_debug (RC_DEBUG_LEVEL_ALWAYS, "! Not handling %s in dependency", name);
-          }
-      }
-      
-      
-      //---------------------------------------------------------------------------
-      
-      
-      void
-      XmlParser::packageEnd(const char *name)
-      {
-          //    if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::packageEnd(%s)\n", name);
-      
-          if (!strcmp(name, "package")) {
-              PackageUpdatePtr update = NULL;
-      
-              /* If possible, grab the version info from the most recent update.
-               * Otherwise, try to find where the package provides itself and use
-               * that version info.
-               */
-              if (!_current_package_packageUpdateList.empty())
-                  update = _current_package_packageUpdateList.back();
-      
-              if (update) {
-                  _current_package_name = update->name();
-                  _current_package_kind = update->kind();
-                  _current_package_edition = update->edition();
-                  _current_package_fileSize = update->packageSize();
-                  _current_package_installedSize = update->installedSize();
-              }
-              else {
-                  for (CDependencyList::const_iterator iter = _current_provides.begin(); iter != _current_provides.end(); iter++) {
-                      if ((*iter)->relation() == Rel::EQ
-                          && ((*iter)->name() == _current_package_name))
-                      {
-                          _current_package_kind = (*iter)->kind();
-                          _current_package_edition = (*iter)->edition();
-                          break;
-                      }
-                  }
-              }
+                    _current_requires.clear();
+                    _current_provides.clear();
+                    _current_conflicts.clear();
+                    _current_children.clear();
+                    _current_recommends.clear();
+                    _current_suggests.clear();
+                    _current_obsoletes.clear();
+      
+                }
+                else {
+                    if (getenv ("RC_SPEW_XML")) rc_debug (RC_DEBUG_LEVEL_ALWAYS, "! Not handling %s at toplevel", (const char *)name);
+                }
+            }
+      
+      
+            void
+            XmlParser::packageStart(const char * name, const xmlChar **attrs)
+            {
+                //    if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::packageStart(%s)\n", name);
+      
+                /* Only care about the containers here */
+                if (!strcmp((const char *)name, "history")) {
+                    _state = PARSER_HISTORY;
+                }
+                else if (!strcmp (name, "deps")) {
+                    /*
+                     * We can get a <deps> tag surrounding the actual package
+                     * dependency sections (requires, provides, conflicts, etc).
+                     * In this case, we'll just ignore this tag quietly.
+                     */
+                }
+                else if (!strcmp(name, "requires")) {
+                    _state = PARSER_DEP;
+                    _current_dep_list = _toplevel_dep_list = &_current_requires;
+                }
+                else if (!strcmp(name, "recommends")) {
+                    _state = PARSER_DEP;
+                    _current_dep_list = _toplevel_dep_list = &_current_recommends;
+                }
+                else if (!strcmp(name, "suggests")) {
+                    _state = PARSER_DEP;
+                    _current_dep_list = _toplevel_dep_list = &_current_suggests;
+                }
+                else if (!strcmp(name, "conflicts")) {
+                    bool is_obsolete = false;
+                    int i;
+      
+                    _state = PARSER_DEP;
+      
+                    for (i = 0; attrs && attrs[i] && !is_obsolete; i += 2) {
+      
+                        if (!strcasecmp ((const char *)(attrs[i]), "obsoletes"))
+                            is_obsolete = true;
+                    }
+      
+                    if (is_obsolete)
+                        _current_dep_list = _toplevel_dep_list = &_current_obsoletes;
+                    else {
+                        _current_dep_list = _toplevel_dep_list = &_current_conflicts;
+                    }
+                }
+                else if (!strcmp(name, "obsoletes")) {
+                    _state = PARSER_DEP;
+                    _current_dep_list = _toplevel_dep_list = &_current_obsoletes;
+                }
+                else if (!strcmp(name, "provides")) {
+                    _state = PARSER_DEP;
+                    _current_dep_list = _toplevel_dep_list = &_current_provides;
+                }
+                else if (!strcmp(name, "children")) {
+                    _state = PARSER_DEP;
+                    _current_dep_list = _toplevel_dep_list = &_current_children;
+                } 
+                else {
+                    // if (getenv ("RC_SPEW_XML")) rc_debug (RC_DEBUG_LEVEL_ALWAYS, "! Not handling %s in package start", name);
+                }
+            }
+      
+      
+            void
+            XmlParser::historyStart(const char * name, const xmlChar **attrs)
+            {
+                //    if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::historyStart(%s)\n", name);
+      
+                if (!strcmp(name, "update")) {
+                    assert(_current_update == NULL);
+      
+                    _current_update = new PackageUpdate(_current_package_name);
+      
+                    _state = PARSER_UPDATE;
+                }
+                else {
+                    if (getenv ("RC_SPEW_XML")) rc_debug (RC_DEBUG_LEVEL_ALWAYS, "! Not handling %s in history", name);
+                }
+            }
+      
+      
+            void
+            XmlParser::dependencyStart(const char *name, const xmlChar **attrs)
+            {
+                //    if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::dependencyStart(%s)\n", name);
+      
+                if (!strcmp(name, "dep")) {
+                    Capability dep;
+                    bool is_obsolete;
+      
+                    dep = parse_dep_attrs(&is_obsolete, attrs);
+      
+                    if (is_obsolete)
+                        _current_obsoletes.insert (dep);
+                    else {
+                        _current_dep_list->insert (dep);
+                    }
+                }
+                else if (!strcmp(name, "or"))
+                    _current_dep_list->clear();
+                else {
+                    if (getenv ("RC_SPEW_XML")) rc_debug (RC_DEBUG_LEVEL_ALWAYS, "! Not handling %s in dependency", name);
+                }
+            }
+      
+      
+            //---------------------------------------------------------------------------
+      
+      
+            void
+            XmlParser::packageEnd(const char *name)
+            {
+                //    if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::packageEnd(%s)\n", name);
+      
+                if (!strcmp(name, "package")) {
+                    PackageUpdatePtr update = NULL;
+      
+                    /* If possible, grab the version info from the most recent update.
+                     * Otherwise, try to find where the package provides itself and use
+                     * that version info.
+                     */
+                    if (!_current_package_packageUpdateList.empty())
+                        update = _current_package_packageUpdateList.back();
+      
+                    if (update) {
+                        _current_package_name = update->name();
+                        _current_package_kind = update->kind();
+                        _current_package_edition = update->edition();
+                        _current_package_fileSize = update->packageSize();
+                        _current_package_installedSize = update->installedSize();
+                    }
+#if 0 //Is this really needed ?
+                    else {
+                        for (CapSet::const_iterator iter = _current_provides.begin(); iter != _current_provides.end(); iter++) {
+                            if ((*iter)->relation() == Rel::EQ
+                                && ((*iter)->name() == _current_package_name))
+                            {
+                                _current_package_kind = (*iter)->kind();
+                                _current_package_edition = (*iter)->edition();
+                                break;
+                            }
+                        }
+                    }
+#endif
+                    // check if we provide ourselfs properly
 
-              // check if we provide ourselfs properly
-      
-              CDependencyList::const_iterator piter;
-              for (piter = _current_provides.begin(); piter != _current_provides.end(); piter++) {
-                  if ((*piter)->relation() == Rel::EQ
-                      && ((*piter)->name() == _current_package_name))
-                  {
-                      break;
-                  }
-              }
-      
-              if (piter == _current_provides.end()) {                  // no self provide found, construct one
-                  constDependencyPtr selfdep = new Dependency (_current_package_name, Rel::EQ, _current_package_kind, _channel, _current_package_edition);
-                  //if (getenv ("RC_SPEW")) fprintf (stderr, "Adding self-provide [%s]\n", selfdep->asString().c_str());
-                  _current_provides.push_front (selfdep);
-              }
+                    CapFactory  factory;                                    
+                    Capability selfdep = factory.parse ( ResTraits<zypp::Package>::kind,
+                                                       _current_package_name,
+                                                       Rel::EQ,
+                                                       _current_package_edition,
+                                                       _current_package_arch);      
+                    CapSet::const_iterator piter;
+                    for (piter = _current_provides.begin(); piter != _current_provides.end(); piter++) {
+                        if ((*piter) == selfdep)
+                        {
+                            break;
+                        }
+                    }
+      
+                    if (piter == _current_provides.end()) {                    // no self provide found, construct one
+                        //if (getenv ("RC_SPEW")) fprintf (stderr, "Adding self-provide [%s]\n", selfdep->asString().c_str());
+                        _current_provides.insert (selfdep);
+                    }
 
-              PackagePtr package = new Package ( _channel,
-                                                 _current_package_name,
-                                                 _current_package_edition,
-                                                 _current_package_arch);
-              package->setRequires      (_current_requires);
-              package->setProvides      (_current_provides);
-              package->setConflicts     (_current_conflicts);
-              package->setObsoletes     (_current_obsoletes);
-              package->setSuggests      (_current_suggests);
-              package->setRecommends    (_current_recommends);
-              package->setPrettyName    (_current_package_prettyName);
-              package->setSummary       (_current_package_summary);
-              package->setDescription   (_current_package_description);
-              package->setSection       (new Section(_current_package_section.c_str()));
-              package->setFileSize      (_current_package_fileSize);
-              package->setInstalledSize (_current_package_installedSize);
-              package->setInstallOnly   (_current_package_installOnly);
-              package->setPackageSet    (_current_package_packageSet);
-              for (PackageUpdateList::iterator iter = _current_package_packageUpdateList.begin();
-                   iter != _current_package_packageUpdateList.end();
-                   iter++) {
-                  PackageUpdatePtr update = *iter;
-                  update->setPackage (package);
-                  package->addUpdate (update);
-              }
-              _all_packages.push_back (package);
+                    PackagePtr package = new Package ( _channel,
+                                                       _current_package_name,
+                                                       _current_package_edition,
+                                                       _current_package_arch);
+
+                    Dependencies deps;
+                    deps.setRequires          (_current_requires);
+                    deps.setProvides          (_current_provides);
+                    deps.setConflicts         (_current_conflicts);
+                    deps.setObsoletes         (_current_obsoletes);
+                    deps.setSuggests          (_current_suggests);
+                    deps.setRecommends        (_current_recommends);
+                    package->setDependencies  (deps);
+                    package->setPrettyName    (_current_package_prettyName);
+                    package->setSummary       (_current_package_summary);
+                    package->setDescription   (_current_package_description);
+                    package->setSection       (new Section(_current_package_section.c_str()));
+                    package->setFileSize      (_current_package_fileSize);
+                    package->setInstalledSize (_current_package_installedSize);
+                    package->setInstallOnly   (_current_package_installOnly);
+                    package->setPackageSet    (_current_package_packageSet);
+                    for (PackageUpdateList::iterator iter = _current_package_packageUpdateList.begin();
+                         iter != _current_package_packageUpdateList.end();
+                         iter++) {
+                        PackageUpdatePtr update = *iter;
+                        update->setPackage (package);
+                        package->addUpdate (update);
+                    }
+                    _all_packages.push_back (package);
        
-              if (getenv ("RC_SPEW")) fprintf (stderr, "%s\n", package->asString(true).c_str());
-              if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::packageEnd done: '%s'\n", package->asString(true).c_str());
-              //       if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::packageEnd now %ld packages\n", _all_packages.size());
-              _current_package_stored = true;
-              _state = PARSER_TOPLEVEL;
-          }
-          else if (!strcmp(name, "name")) {                    _current_package_name = strstrip (_text_buffer);
-          } else if (!strcmp(name, "pretty_name")) {           _current_package_prettyName = strstrip (_text_buffer);
-          } else if (!strcmp(name, "summary")) {               _current_package_summary = strstrip (_text_buffer);
-          } else if (!strcmp(name, "description")) {           _current_package_description = strstrip (_text_buffer);
-          } else if (!strcmp(name, "section")) {               _current_package_section = strstrip (_text_buffer);
-          } else if (!strcmp(name, "arch")) {                  _current_package_arch = Arch(strstrip (_text_buffer));
-          } else if (!strcmp(name, "filesize")) {              _current_package_fileSize = atoi(_text_buffer);
-          } else if (!strcmp(name, "installedsize")) {         _current_package_installedSize = atoi(_text_buffer);
-          } else if (!strcmp(name, "install_only")) {          _current_package_installOnly = true;
-          } else if (!strcmp(name, "package_set")) {           _current_package_packageSet = true;
-          } else {
-              if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::packageEnd(%s) unknown\n", name);
-          }
-      
-          //    if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::packageEnd(%s) done\n", name);
-      
-          releaseBuffer();
-      }
-      
-      
-      void
-      XmlParser::historyEnd(const char *name)
-      {
-      //    if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::historyEnd(%s)\n", name);
-      
-          if (!strcmp(name, "history")) {
-       assert(_current_update == NULL);
-      
-       _state = PARSER_PACKAGE;
-          }
-      }
-      
-      
-      void
-      XmlParser::updateEnd(const char *name)
-      {
-          //    if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::updateEnd(%s)\n", name);
-      
-          constChannelPtr channel;
-          const char *url_prefix = NULL;
-      
-          assert(_current_update != NULL);
-      
-          if (_channel != NULL) {
-              url_prefix = _channel->filePath ();
-          }
-      
-          if (!strcmp(name, "update")) {
-              _current_package_packageUpdateList.push_back(_current_update);
-      
-              _current_update = NULL;
-              _state = PARSER_HISTORY;
-      
-          } else if (!strcmp(name, "epoch")) {         _current_update->setEpoch (atoi(_text_buffer));
-          } else if (!strcmp(name, "version")) {               _current_update->setVersion (strstrip (_text_buffer));
-          } else if (!strcmp(name, "release")) {               _current_update->setRelease (strstrip (_text_buffer));
-          } else if (!strcmp(name, "arch")) {                  _current_update->setArch (strstrip (_text_buffer));
-          } else if (!strcmp(name, "filename")) {
-              strstrip (_text_buffer);
-              if (url_prefix) {
-                  _current_update->setPackageUrl (maybe_merge_paths(url_prefix, _text_buffer));
-              }
-              else {
-                  _current_update->setPackageUrl (_text_buffer);
-              }
-          } else if (!strcmp(name, "filesize")) {              _current_update->setPackageSize (atoi(_text_buffer));
-          } else if (!strcmp(name, "installedsize")) { _current_update->setInstalledSize (atoi (_text_buffer));
-          } else if (!strcmp(name, "signaturename")) {
-              strstrip (_text_buffer);
-              if (url_prefix) {
-                  _current_update->setSignatureUrl (maybe_merge_paths(url_prefix, _text_buffer));
-              }
-              else {
-                  _current_update->setSignatureUrl (_text_buffer);
-              }
-          } else if (!strcmp(name, "signaturesize")) { _current_update->setSignatureSize (atoi (_text_buffer));
-          } else if (!strcmp(name, "md5sum")) {                _current_update->setMd5sum (strstrip (_text_buffer));
-          } else if (!strcmp(name, "importance")) {            _current_update->setImportance (new Importance (strstrip (_text_buffer)));
-          } else if (!strcmp(name, "description")) {           _current_update->setDescription (strstrip (_text_buffer));
-          } else if (!strcmp(name, "hid")) {                   _current_update->setHid (atoi(_text_buffer));
-          } else if (!strcmp (name, "license")) {              _current_update->setLicense (strstrip (_text_buffer));
-          } else {
-              fprintf (stderr, "XmlParser::updateEnd(%s) unknown\n", name);
-          }
-      
-          //    if (_current_update != NULL && getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::updateEnd(%s) => '%s'\n", name, _current_update->asString().c_str());
-      
-          releaseBuffer();
-      
-      }
-      
-      
-      void
-      XmlParser::dependencyEnd(const char *name)
-      {
-      //    if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::dependencyEnd(%s)\n", name);
-      
-          if (!strcmp(name, "or")) {
-       OrDependencyPtr or_dep = OrDependency::fromDependencyList (*_current_dep_list);
-       DependencyPtr dep = new Dependency (or_dep);
-      
-       (*_current_dep_list).clear();
-      
-       (*_toplevel_dep_list).push_back (dep);
-       _current_dep_list = _toplevel_dep_list;
-          }
-          else if (!strcmp(name, "dep")) {
-       /* We handled everything we needed for dep in start */
-          }
-          else {
-       /* All of the dep lists (requires, provides, etc.) */
-       _toplevel_dep_list = NULL;
-       _current_dep_list = NULL;
-       _state = PARSER_PACKAGE;
-          }
-      }
-      
-      
-      
-      //===================================================================================================================
-      
-      #if 0
-      //---------------------------------------------------------------------------
-      
-      /* ------ */
-      
-      
-      static RCResItemDep *
-      rc_xml_node_to_resItem_dep_internal (const xmlNode *node)
-      {
-          gchar *name = NULL, *version = NULL, *release = NULL;
-          gboolean has_epoch = false;
-          guint32 epoch = 0;
-          RCResItemRelation relation;
-          RCResItemDep *dep;
+                    if (getenv ("RC_SPEW")) fprintf (stderr, "%s\n", package->asString(true).c_str());
+                    if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::packageEnd done: '%s'\n", package->asString(true).c_str());
+                    // if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::packageEnd now %ld packages\n", _all_packages.size());
+                    _current_package_stored = true;
+                    _state = PARSER_TOPLEVEL;
+                }
+                else if (!strcmp(name, "name")) {                      _current_package_name = strstrip (_text_buffer);
+                } else if (!strcmp(name, "pretty_name")) {             _current_package_prettyName = strstrip (_text_buffer);
+                } else if (!strcmp(name, "summary")) {         _current_package_summary = strstrip (_text_buffer);
+                } else if (!strcmp(name, "description")) {             _current_package_description = strstrip (_text_buffer);
+                } else if (!strcmp(name, "section")) {         _current_package_section = strstrip (_text_buffer);
+                } else if (!strcmp(name, "arch")) {                    _current_package_arch = Arch(strstrip (_text_buffer));
+                } else if (!strcmp(name, "filesize")) {                _current_package_fileSize = atoi(_text_buffer);
+                } else if (!strcmp(name, "installedsize")) {           _current_package_installedSize = atoi(_text_buffer);
+                } else if (!strcmp(name, "install_only")) {            _current_package_installOnly = true;
+                } else if (!strcmp(name, "package_set")) {             _current_package_packageSet = true;
+                } else {
+                    if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::packageEnd(%s) unknown\n", name);
+                }
+      
+                //    if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::packageEnd(%s) done\n", name);
+      
+                releaseBuffer();
+            }
+      
+      
+            void
+            XmlParser::historyEnd(const char *name)
+            {
+                //    if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::historyEnd(%s)\n", name);
+      
+                if (!strcmp(name, "history")) {
+                    assert(_current_update == NULL);
+      
+                    _state = PARSER_PACKAGE;
+                }
+            }
+      
+      
+            void
+            XmlParser::updateEnd(const char *name)
+            {
+                //    if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::updateEnd(%s)\n", name);
+      
+                constChannelPtr channel;
+                const char *url_prefix = NULL;
+      
+                assert(_current_update != NULL);
+      
+                if (_channel != NULL) {
+                    url_prefix = _channel->filePath ();
+                }
+      
+                if (!strcmp(name, "update")) {
+                    _current_package_packageUpdateList.push_back(_current_update);
+      
+                    _current_update = NULL;
+                    _state = PARSER_HISTORY;
+      
+                } else if (!strcmp(name, "epoch")) {           _current_update->setEpoch (atoi(_text_buffer));
+                } else if (!strcmp(name, "version")) {         _current_update->setVersion (strstrip (_text_buffer));
+                } else if (!strcmp(name, "release")) {         _current_update->setRelease (strstrip (_text_buffer));
+                } else if (!strcmp(name, "arch")) {                    _current_update->setArch (strstrip (_text_buffer));
+                } else if (!strcmp(name, "filename")) {
+                    strstrip (_text_buffer);
+                    if (url_prefix) {
+                        _current_update->setPackageUrl (maybe_merge_paths(url_prefix, _text_buffer));
+                    }
+                    else {
+                        _current_update->setPackageUrl (_text_buffer);
+                    }
+                } else if (!strcmp(name, "filesize")) {                _current_update->setPackageSize (atoi(_text_buffer));
+                } else if (!strcmp(name, "installedsize")) {   _current_update->setInstalledSize (atoi (_text_buffer));
+                } else if (!strcmp(name, "signaturename")) {
+                    strstrip (_text_buffer);
+                    if (url_prefix) {
+                        _current_update->setSignatureUrl (maybe_merge_paths(url_prefix, _text_buffer));
+                    }
+                    else {
+                        _current_update->setSignatureUrl (_text_buffer);
+                    }
+                } else if (!strcmp(name, "signaturesize")) {   _current_update->setSignatureSize (atoi (_text_buffer));
+                } else if (!strcmp(name, "md5sum")) {          _current_update->setMd5sum (strstrip (_text_buffer));
+                } else if (!strcmp(name, "importance")) {              _current_update->setImportance (new Importance (strstrip (_text_buffer)));
+                } else if (!strcmp(name, "description")) {             _current_update->setDescription (strstrip (_text_buffer));
+                } else if (!strcmp(name, "hid")) {                     _current_update->setHid (atoi(_text_buffer));
+                } else if (!strcmp (name, "license")) {                _current_update->setLicense (strstrip (_text_buffer));
+                } else {
+                    fprintf (stderr, "XmlParser::updateEnd(%s) unknown\n", name);
+                }
+      
+                //    if (_current_update != NULL && getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::updateEnd(%s) => '%s'\n", name, _current_update->asString().c_str());
+      
+                releaseBuffer();
+      
+            }
+      
+      
+            void
+            XmlParser::dependencyEnd(const char *name)
+            {
+                //    if (getenv ("RC_SPEW_XML")) fprintf (stderr, "XmlParser::dependencyEnd(%s)\n", name);
+      
+                if (!strcmp(name, "or")) {
+#if 0 
+                    OrDependencyPtr or_dep = OrDependency::fromDependencyList (*_current_dep_list);
+                    DependencyPtr dep = new Dependency (or_dep);
+      
+                    (*_current_dep_list).clear();
+      
+                    (*_toplevel_dep_list).push_back (dep);
+                    _current_dep_list = _toplevel_dep_list;
+#endif
+                }
+                else if (!strcmp(name, "dep")) {
+                    /* We handled everything we needed for dep in start */
+                }
+                else {
+                    /* All of the dep lists (requires, provides, etc.) */
+                    _toplevel_dep_list = NULL;
+                    _current_dep_list = NULL;
+                    _state = PARSER_PACKAGE;
+                }
+            }
+      
+      
+      
+            //===================================================================================================================
+      
+#if 0
+            //---------------------------------------------------------------------------
+      
+            /* ------ */
+      
+      
+            static RCResItemDep *
+            rc_xml_node_to_resItem_dep_internal (const xmlNode *node)
+            {
+                gchar *name = NULL, *version = NULL, *release = NULL;
+                gboolean has_epoch = false;
+                guint32 epoch = 0;
+                RCResItemRelation relation;
+                RCResItemDep *dep;
           
-          gchar *tmp;
+                gchar *tmp;
       
-          if (g_strcasecmp (node->name, "dep")) {
-       return (NULL);
-          }
+                if (g_strcasecmp (node->name, "dep")) {
+                    return (NULL);
+                }
       
-          name = xml_get_prop (node, "name");
-          tmp = xml_get_prop (node, "op");
-          if (tmp) {
-       relation = rc_resItem_relation_from_string (tmp);
+                name = xml_get_prop (node, "name");
+                tmp = xml_get_prop (node, "op");
+                if (tmp) {
+                    relation = rc_resItem_relation_from_string (tmp);
        
-       has_epoch = xml_get_guint32_value (node, "epoch", &epoch);
-      
-       version = xml_get_prop (node, "version");
-       release = xml_get_prop (node, "release");
-          } else {
-       relation = RC_RELATION_ANY;
-          }
-      
-          /* FIXME: should get channel from XML */
-          dep = rc_resItem_dep_new (name, has_epoch, epoch, version, release,
-                                relation, RC_TYPE_RESOLVABLE, RC_CHANNEL_ANY,
-                                false, false);
-      
-          g_free (tmp);
-          g_free (name);
-          g_free (version);
-          g_free (release);
-      
-          return dep;
-      } /* rc_xml_node_to_resItem_dep_internal */
-      
-      RCResItemDep *
-      rc_xml_node_to_resItem_dep (const xmlNode *node)
-      {
-          RCResItemDep *dep = NULL;
-      
-          if (!g_strcasecmp (node->name, "dep")) {
-       dep = rc_xml_node_to_resItem_dep_internal (node);
-       return (dep);
-          } else if (!g_strcasecmp (node->name, "or")) {
-       RCResItemDepSList *or_dep_slist = NULL;
-       RCDepOr *or;
-       xmlNode *iter = node->xmlChildrenNode;
-      
-       while (iter) {
-           if (iter->type == XML_ELEMENT_NODE) {
-               or_dep_slist = g_slist_append(
-                   or_dep_slist,
-                   rc_xml_node_to_resItem_dep_internal (iter));
-           }
-      
-           iter = iter->next;
-       }
-      
-       or = rc_dep_or_new (or_dep_slist);
-       dep = rc_dep_or_new_provide (or);
-          }
-      
-          return (dep);
-      } /* rc_xml_node_to_resItem_dep */
-      
-      /* ------ */
-      
-      /* This hack cleans 8-bit characters out of a string.  This is a very
-         problematic "solution" to the problem of non-UTF-8 package info. */
-      static gchar *
-      sanitize_string (const char *str)
-      {
-          gchar *dup = g_strdup (str);
-          gchar *c;
-      
-          return dup;
-      
-          if (dup) {
-       for (c = dup; *c; ++c) {
-           if ((guint)*c > 0x7f)
-               *c = '_';
-       }
-          }
-      
-          return dup;
-      }
-      
-      #endif
-      ///////////////////////////////////////////////////////////////////
-    };// namespace detail
-    /////////////////////////////////////////////////////////////////////
-    /////////////////////////////////////////////////////////////////////
-  };// namespace solver
-  ///////////////////////////////////////////////////////////////////////
-  ///////////////////////////////////////////////////////////////////////
+                    has_epoch = xml_get_guint32_value (node, "epoch", &epoch);
+      
+                    version = xml_get_prop (node, "version");
+                    release = xml_get_prop (node, "release");
+                } else {
+                    relation = RC_RELATION_ANY;
+                }
+      
+                /* FIXME: should get channel from XML */
+                dep = rc_resItem_dep_new (name, has_epoch, epoch, version, release,
+                                          relation, RC_TYPE_RESOLVABLE, RC_CHANNEL_ANY,
+                                          false, false);
+      
+                g_free (tmp);
+                g_free (name);
+                g_free (version);
+                g_free (release);
+      
+                return dep;
+            } /* rc_xml_node_to_resItem_dep_internal */
+      
+            RCResItemDep *
+            rc_xml_node_to_resItem_dep (const xmlNode *node)
+            {
+                RCResItemDep *dep = NULL;
+      
+                if (!g_strcasecmp (node->name, "dep")) {
+                    dep = rc_xml_node_to_resItem_dep_internal (node);
+                    return (dep);
+                } else if (!g_strcasecmp (node->name, "or")) {
+                    RCResItemDepSList *or_dep_slist = NULL;
+                    RCDepOr *or;
+                    xmlNode *iter = node->xmlChildrenNode;
+      
+                    while (iter) {
+                        if (iter->type == XML_ELEMENT_NODE) {
+                            or_dep_slist = g_slist_append(
+                                                          or_dep_slist,
+                                                          rc_xml_node_to_resItem_dep_internal (iter));
+                        }
+      
+                        iter = iter->next;
+                    }
+      
+                    or = rc_dep_or_new (or_dep_slist);
+                    dep = rc_dep_or_new_provide (or);
+                }
+      
+                return (dep);
+            } /* rc_xml_node_to_resItem_dep */
+      
+            /* ------ */
+      
+            /* This hack cleans 8-bit characters out of a string.  This is a very
+               problematic "solution" to the problem of non-UTF-8 package info. */
+            static gchar *
+            sanitize_string (const char *str)
+            {
+                gchar *dup = g_strdup (str);
+                gchar *c;
+      
+                return dup;
+      
+                if (dup) {
+                    for (c = dup; *c; ++c) {
+                        if ((guint)*c > 0x7f)
+                            *c = '_';
+                    }
+                }
+      
+                return dup;
+            }
+      
+#endif
+            ///////////////////////////////////////////////////////////////////
+        };// namespace detail
+        /////////////////////////////////////////////////////////////////////
+        /////////////////////////////////////////////////////////////////////
+    };// namespace solver
+    ///////////////////////////////////////////////////////////////////////
+    ///////////////////////////////////////////////////////////////////////
 };// namespace zypp
 /////////////////////////////////////////////////////////////////////////
index b866376..704524b 100644 (file)
@@ -29,7 +29,7 @@
 
 #include <zypp/solver/detail/Channel.h>
 #include <zypp/solver/detail/Package.h>
-#include <zypp/solver/detail/Dependency.h>
+#include <zypp/CapSet.h>
 #include <zypp/solver/detail/XmlNode.h>
 
 /////////////////////////////////////////////////////////////////////////
@@ -83,18 +83,18 @@ namespace zypp
           bool _current_package_packageSet;
           PackageUpdateList _current_package_packageUpdateList;
           
-          CDependencyList _current_requires;
-          CDependencyList _current_provides;
-          CDependencyList _current_conflicts;
-          CDependencyList _current_children;
-          CDependencyList _current_recommends;
-          CDependencyList _current_suggests;
-          CDependencyList _current_obsoletes;
+          CapSet _current_requires;
+          CapSet _current_provides;
+          CapSet _current_conflicts;
+          CapSet _current_children;
+          CapSet _current_recommends;
+          CapSet _current_suggests;
+          CapSet _current_obsoletes;
           PackageUpdatePtr _current_update;
       
           // these point to one of the above lists during dependency parsing
-          CDependencyList *_toplevel_dep_list;
-          CDependencyList *_current_dep_list;
+          CapSet *_toplevel_dep_list;
+          CapSet *_current_dep_list;
       
           char *_text_buffer;
           size_t _text_buffer_size;
index d361958..fb8a70f 100644 (file)
@@ -22,7 +22,6 @@
 #define _LIBzypp_H
 
 #include <zypp/solver/detail/Channel.h>
-#include <zypp/solver/detail/Dependency.h>
 #include <zypp/solver/detail/Match.h>
 #include <zypp/solver/detail/ResItem.h>
 #include <zypp/solver/detail/Spec.h>