Mailinglist Archive: zypp-commit (301 mails)

< Previous Next >
[zypp-commit] r7532 - /branches/use-solv/libzypp/zypp/RepoManager.cc
  • From: matz@xxxxxxxxxxxxxxxx
  • Date: Mon, 15 Oct 2007 04:06:03 -0000
  • Message-id: <20071015040603.D46BF4565D@xxxxxxxxxxxxxxxx>
Author: matz
Date: Mon Oct 15 06:06:03 2007
New Revision: 7532

URL: http://svn.opensuse.org/viewcvs/zypp?rev=7532&view=rev
Log:
Keep SOLV file up to date.  This now stores nothing into zypp.db anymore
and doesn't use the libzypp parsers either.  Hence we miss summary,
description, sizes and some other stuff.

Modified:
    branches/use-solv/libzypp/zypp/RepoManager.cc

Modified: branches/use-solv/libzypp/zypp/RepoManager.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/use-solv/libzypp/zypp/RepoManager.cc?rev=7532&r1=7531&r2=7532&view=diff
==============================================================================
--- branches/use-solv/libzypp/zypp/RepoManager.cc (original)
+++ branches/use-solv/libzypp/zypp/RepoManager.cc Mon Oct 15 06:06:03 2007
@@ -10,6 +10,7 @@
  *
 */
 
+#include <cstdlib>
 #include <iostream>
 #include <fstream>
 #include <sstream>
@@ -696,7 +697,15 @@
     progress.toMin();
 
     if (needs_cleaning)
+    {
       cleanCacheInternal( store, info);
+      Pathname name = _pimpl->options.repoCachePath;
+      data::RecordId id = store.lookupRepository(info.alias());
+      ostringstream os;
+      os << id.get();
+      name += os.str() + ".solv";
+      unlink (name);
+    }
 
     MIL << info.alias() << " building cache..." << endl;
     data::RecordId id = store.lookupOrAppendRepository(info.alias());
@@ -718,6 +727,27 @@
     switch ( repokind.toEnum() )
     {
       case RepoType::RPMMD_e :
+      case RepoType::YAST2_e :
+      {
+        Pathname name = _pimpl->options.repoCachePath;
+       ostringstream os;
+       os << id.get();
+       name += os.str() + ".solv";
+        string cmd = "repo2solv.sh \"";
+       cmd += rawpath.asString() + "\" > " + name.asString();
+       int ret = system (cmd.c_str());
+        if (WIFEXITED (ret) && WEXITSTATUS (ret) != 0)
+         ZYPP_THROW(RepoUnknownTypeException());
+      }
+      break;
+      default:
+      break;
+    }
+    
+    switch ( repokind.toEnum() )
+    {
+      case RepoType::RPMMD_e :
+      if (0)
       {
         CombinedProgressData subprogrcv( progress, 100);
         parser::yum::RepoParser parser(id, store, parser::yum::RepoParserOpts(), subprogrcv);
@@ -726,6 +756,7 @@
       }
       break;
       case RepoType::YAST2_e :
+      if (0)
       {
         CombinedProgressData subprogrcv( progress, 100);
         parser::susetags::RepoParser parser(id, store, subprogrcv);
@@ -812,6 +843,12 @@
     cache::CacheStore store(_pimpl->options.repoCachePath);
     cleanCacheInternal( store, info, progressrcv );
     store.commit();
+    Pathname name = _pimpl->options.repoCachePath;
+    data::RecordId id = store.lookupRepository(info.alias());
+    ostringstream os;
+    os << id.get();
+    name += os.str() + ".solv";
+    unlink (name);
   }
 
   ////////////////////////////////////////////////////////////////////////////

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

< Previous Next >
This Thread
  • No further messages