make "establishPool()" return bool
authorKlaus Kaempf <kkaempf@suse.de>
Fri, 17 Feb 2006 13:02:57 +0000 (13:02 +0000)
committerKlaus Kaempf <kkaempf@suse.de>
Fri, 17 Feb 2006 13:02:57 +0000 (13:02 +0000)
zypp/Resolver.cc
zypp/Resolver.h
zypp/solver/detail/Resolver.cc
zypp/solver/detail/Resolver.h

index 7e97d3a..81b0abf 100644 (file)
@@ -58,8 +58,8 @@ namespace zypp
 
   bool Resolver::verifySystem ()
   { return _pimpl->verifySystem(); }
-  void Resolver::establishPool ()
-  { _pimpl->establishPool(); }
+  bool Resolver::establishPool ()
+  { return _pimpl->establishPool(); }
   bool Resolver::resolvePool ()
   { return _pimpl->resolvePool (); }
   void Resolver::undo()
index e43e55e..72b83ae 100644 (file)
@@ -59,8 +59,15 @@ namespace zypp
      * Must be called when dealing with non-package resolvables,
      * like Patches, Patterns, and Products
      *
+     * Must be called with a 'plain' pool, e.g. no additonal
+     * transacts set.
+     *
+     * return true if it was successful
+     * return false if not (this will only happen if other
+     *   transactions are in the pool which will lead to
+     *   no solution)
      **/
-    void establishPool (void);
+    bool establishPool (void);
 
     /**
      * Resolve package dependencies:
index 4f51f54..673f466 100644 (file)
@@ -416,7 +416,7 @@ Resolver::establishState (ResolverContext_Ptr context)
 }
 
 
-void
+bool
 Resolver::establishPool ()
 {
     establishState ();                                         // establish !
@@ -427,9 +427,10 @@ Resolver::establishPool ()
     }
     else {
        ERR << "establishState did not return a bestContext" << endl;
+       return false;
     }
 
-    return;
+    return true;
 }
 
 //---------------------------------------------------------------------------
index aa66b5b..d4cacb6 100644 (file)
@@ -173,7 +173,7 @@ class Resolver : public base::ReferenceCounted, private base::NonCopyable {
 
     bool verifySystem (void);
     void establishState (const ResolverContext_Ptr context = NULL);
-    void establishPool (void);
+    bool establishPool (void);
     bool resolveDependencies (const ResolverContext_Ptr context = NULL);
     bool resolvePool (void);