return # of successfully commited resolvables from Target::committ()
authorKlaus Kaempf <kkaempf@suse.de>
Fri, 10 Feb 2006 15:21:17 +0000 (15:21 +0000)
committerKlaus Kaempf <kkaempf@suse.de>
Fri, 10 Feb 2006 15:21:17 +0000 (15:21 +0000)
(bug #149951)

zypp/Target.cc
zypp/Target.h
zypp/target/TargetImpl.cc
zypp/target/TargetImpl.h

index 517d557..eb03a51 100644 (file)
@@ -79,9 +79,9 @@ namespace zypp
   { _pimpl->enableStorage(root_r); }
 #endif
 
-  void Target::commit(ResPool pool_r, int medianr, PoolItemList & errors_r
+  int Target::commit(ResPool pool_r, int medianr, PoolItemList & errors_r
         , PoolItemList & remaining_r, PoolItemList & srcremaining_r)
-  { _pimpl->commit(pool_r, medianr, errors_r, remaining_r, srcremaining_r); }
+  { return _pimpl->commit(pool_r, medianr, errors_r, remaining_r, srcremaining_r); }
 
   bool Target::providesFile (const std::string & name_str, const std::string & path_str) const
   { return _pimpl->providesFile (name_str, path_str); }
index 6ccd92f..d780e6c 100644 (file)
@@ -58,8 +58,9 @@ namespace zypp
     /** Commit changes in the pool 
      *  \param medianr 0 = all/any media
      *                 > 0 means only the given media number
+     * return number of successfully committed resolvables
     */
-    void commit( ResPool pool_r, int medianr, PoolItemList & errors_r
+    int commit( ResPool pool_r, int medianr, PoolItemList & errors_r
         , PoolItemList & remaining_r, PoolItemList & srcremaining_r );
 
       /** If the package is installed and provides the file
index 022a686..2579572 100644 (file)
@@ -133,7 +133,7 @@ namespace zypp
     }
 
 
-    void TargetImpl::commit(ResPool pool_r, unsigned int medianr, PoolItemList & errors_r, PoolItemList & remaining_r, PoolItemList & srcremaining_r)
+    int TargetImpl::commit(ResPool pool_r, unsigned int medianr, PoolItemList & errors_r, PoolItemList & remaining_r, PoolItemList & srcremaining_r)
     {
       MIL << "TargetImpl::commit(<pool>, " << medianr << ")" << endl;
 
@@ -192,9 +192,9 @@ namespace zypp
           }
         }
         bad = commit (current_srcinstall);
-        srcremaining_r.insert(remaining_r.end(), bad.begin(), bad.end());
+        srcremaining_r.insert(srcremaining_r.end(), bad.begin(), bad.end());
       }
-      return;
+      return to_install.size() - remaining_r.size();
     }
 
 
index edb0351..3246774 100644 (file)
@@ -73,7 +73,7 @@ namespace zypp
       /** Commit changes in the pool
          media = 0 means any/all medias
          media > 0 means limit commits to this media */
-      void commit( ResPool pool_r, unsigned int medianr, PoolItemList & errors_r, PoolItemList & remaining_r, PoolItemList & srcremaining_r );
+      int commit( ResPool pool_r, unsigned int medianr, PoolItemList & errors_r, PoolItemList & remaining_r, PoolItemList & srcremaining_r );
 
       /** enables the storage target */
       bool isStorageEnabled() const;