Mailinglist Archive: zypp-commit (325 mails)

< Previous Next >
[zypp-commit] r7185 - in /trunk/libzypp: devel/devel.ma/Parse.cc package/libzypp.changes zypp/DiskUsageCounter.cc zypp/target/rpm/RpmPackageImpl.cc zypp/target/rpm/RpmPackageImpl.h
  • From: mlandres@xxxxxxxxxxxxxxxx
  • Date: Tue, 11 Sep 2007 13:01:52 -0000
  • Message-id: <20070911130153.2B6ED2E4B2@xxxxxxxxxxxxxxxx>
Author: mlandres
Date: Tue Sep 11 15:01:52 2007
New Revision: 7185

URL: http://svn.opensuse.org/viewcvs/zypp?rev=7185&view=rev
Log:
changes

Modified:
    trunk/libzypp/devel/devel.ma/Parse.cc
    trunk/libzypp/package/libzypp.changes
    trunk/libzypp/zypp/DiskUsageCounter.cc
    trunk/libzypp/zypp/target/rpm/RpmPackageImpl.cc
    trunk/libzypp/zypp/target/rpm/RpmPackageImpl.h

Modified: trunk/libzypp/devel/devel.ma/Parse.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/Parse.cc?rev=7185&r1=7184&r2=7185&view=diff
==============================================================================
--- trunk/libzypp/devel/devel.ma/Parse.cc (original)
+++ trunk/libzypp/devel/devel.ma/Parse.cc Tue Sep 11 15:01:52 2007
@@ -35,11 +35,12 @@
 #include "zypp/RepoInfo.h"
 
 #include "zypp/ui/PatchContents.h"
+#include "zypp/ResPoolProxy.h"
 
 using namespace std;
 using namespace zypp;
 using namespace zypp::functor;
-
+using namespace zypp::ui;
 using zypp::parser::TagParser;
 
 ///////////////////////////////////////////////////////////////////
@@ -48,14 +49,44 @@
 
 ///////////////////////////////////////////////////////////////////
 
+template<class _Res>
+Selectable::Ptr getSel( const std::string & name_r )
+{
+  ResPoolProxy uipool( getZYpp()->poolProxy() );
+  for_(it, uipool.byKindBegin<_Res>(), uipool.byKindEnd<_Res>() )
+  {
+    if ( (*it)->name() == name_r )
+      return (*it);
+  }
+  return 0;
+}
+
+void dbgDu( Selectable::Ptr sel )
+{
+  if ( sel->installedPoolItem() )
+  {
+    DBG << "i: " << sel->installedPoolItem() << endl
+        << sel->installedPoolItem()->diskusage() << endl;
+  }
+  if ( sel->candidatePoolItem() )
+  {
+    DBG << "c: " << sel->candidatePoolItem() << endl
+        << sel->candidatePoolItem()->diskusage() << endl;
+  }
+  INT << sel << endl
+      << getZYpp()->diskUsage() << endl;
+}
+
+///////////////////////////////////////////////////////////////////
+
 struct Xprint
 {
   bool operator()( const PoolItem & obj_r )
   {
-    //handle( asKind<Package>( obj_r ) );
-    //handle( asKind<Patch>( obj_r ) );
-    handle( asKind<Pattern>( obj_r ) );
-    handle( asKind<Product>( obj_r ) );
+     handle( asKind<Package>( obj_r ) );
+//     handle( asKind<Patch>( obj_r ) );
+//     handle( asKind<Pattern>( obj_r ) );
+//     handle( asKind<Product>( obj_r ) );
     return true;
   }
 
@@ -64,6 +95,7 @@
     if ( !p )
       return;
 
+    WAR << p->size() << endl;
     MIL << p->diskusage() << endl;
   }
 
@@ -425,6 +457,25 @@
 
   std::for_each( pool.begin(), pool.end(), Xprint() );
 
+  DiskUsageCounter::MountPointSet fakePart;
+  fakePart.insert( DiskUsageCounter::MountPoint( "/", 1024, 10240, 5120, 0LL, false ) );
+  getZYpp()->setPartitions( fakePart );
+
+  USR << getZYpp()->getPartitions() << endl;
+  INT << getZYpp()->diskUsage() << endl;
+
+  Selectable::Ptr sel( getSel<Package>( "rpm" ) );
+  dbgDu( sel );
+
+  MIL << sel->set_status( ui::S_Del ) << endl;
+  dbgDu( sel );
+
+  MIL << sel->set_status( ui::S_Update ) << endl;
+  dbgDu( sel );
+
+  MIL << sel->set_status( ui::S_KeepInstalled ) << endl;
+  dbgDu( sel );
+
   ///////////////////////////////////////////////////////////////////
   INT << "===[END]============================================" << endl << endl;
   zypp::base::LogControl::instance().logNothing();

Modified: trunk/libzypp/package/libzypp.changes
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/package/libzypp.changes?rev=7185&r1=7184&r2=7185&view=diff
==============================================================================
--- trunk/libzypp/package/libzypp.changes (original)
+++ trunk/libzypp/package/libzypp.changes Tue Sep 11 15:01:52 2007
@@ -4,6 +4,7 @@
 - Don't fail if a product is deleted multiple times (e.g. due to
   obsoletes and an explicit deleted request). (#308746)
 - version 3.22.7
+- revision 7184
 
 -------------------------------------------------------------------
 Tue Sep 11 13:52:47 CEST 2007 - jkupec@xxxxxxx

Modified: trunk/libzypp/zypp/DiskUsageCounter.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/DiskUsageCounter.cc?rev=7185&r1=7184&r2=7185&view=diff
==============================================================================
--- trunk/libzypp/zypp/DiskUsageCounter.cc (original)
+++ trunk/libzypp/zypp/DiskUsageCounter.cc Tue Sep 11 15:01:52 2007
@@ -305,7 +305,11 @@
 
   std::ostream & operator<<( std::ostream & str, const DiskUsageCounter::MountPoint & obj )
   {
-    str << "dir:[" << obj.dir << "] [ bs: " << obj.block_size << " ts: " << obj.total_size << "]" << std::endl;
+    str << "dir:[" << obj.dir << "] [ bs: " << obj.block_size
+        << " ts: " << obj.total_size
+        << " us: " << obj.used_size
+        << " +-: " << obj.pkg_size
+        << "]" << std::endl;
     return str;
   }
 

Modified: trunk/libzypp/zypp/target/rpm/RpmPackageImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/target/rpm/RpmPackageImpl.cc?rev=7185&r1=7184&r2=7185&view=diff
==============================================================================
--- trunk/libzypp/zypp/target/rpm/RpmPackageImpl.cc (original)
+++ trunk/libzypp/zypp/target/rpm/RpmPackageImpl.cc Tue Sep 11 15:01:52 2007
@@ -56,6 +56,7 @@
   // we know we are reading english.
   _description.setText(data->tag_description(), Locale("en"));
   data->tag_du(_disk_usage);
+  SEC << _disk_usage << endl;
   _location.setDownloadSize(data->tag_archivesize());
 }
 
@@ -199,7 +200,7 @@
 }
 
 /** */
-const DiskUsage & RPMPackageImpl::diskUsage() const
+const DiskUsage & RPMPackageImpl::diskusage() const
 {
   return _disk_usage;
 }

Modified: trunk/libzypp/zypp/target/rpm/RpmPackageImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/target/rpm/RpmPackageImpl.h?rev=7185&r1=7184&r2=7185&view=diff
==============================================================================
--- trunk/libzypp/zypp/target/rpm/RpmPackageImpl.h (original)
+++ trunk/libzypp/zypp/target/rpm/RpmPackageImpl.h Tue Sep 11 15:01:52 2007
@@ -85,7 +85,7 @@
   /** */
   virtual std::string type() const;
   /** */
-  virtual const DiskUsage & diskUsage() const;
+  virtual const DiskUsage & diskusage() const;
   /** */
   virtual Repository repository() const;
 

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages