Mailinglist Archive: opensuse-commit (2092 mails)

< Previous Next >
commit libzypp
  • From: root@xxxxxxxxxxxxxxx (h_root)
  • Date: Fri, 17 Aug 2007 18:56:55 +0200
  • Message-id: <20070817165655.8392B678331@xxxxxxxxxxxxxxx>

Hello community,

here is the log from the commit of package libzypp
checked in at Fri Aug 17 18:56:55 CEST 2007.

--------
--- libzypp/libzypp.changes     2007-08-16 17:29:09.000000000 +0200
+++ /mounts/work_src_done/STABLE/libzypp/libzypp.changes        2007-08-17 12:34:25.829749000 +0200
@@ -1,0 +2,28 @@
+Fri Aug 17 12:30:55 CEST 2007 - kkaempf@xxxxxxx
+
+- add iterateResolvablesByKindsAndName
+- rev 6735, version 3.17.13
+
+-------------------------------------------------------------------
+Fri Aug 17 11:45:24 CEST 2007 - kkaempf@xxxxxxx
+
+- rename ResolvableQuery::queryByName to iterateResolvablesByName
+- fix reading of kind and repository in ResolvableQuery
+- add reverse lookups in CacheTypes
+- add iterateResolvablesByKind
+- rev 6733
+
+-------------------------------------------------------------------
+Fri Aug 17 10:37:56 CEST 2007 - schubi@xxxxxxx
+
+- shorten solver error messages Bug 259894
+- rev 6723 
+
+-------------------------------------------------------------------
+Thu Aug 16 23:43:50 CEST 2007 - kkaempf@xxxxxxx
+
+- fix ResolvableQuery::query(), add ResolvableQuery::queryByName()
+  install zypp/cache header files.
+- rev 6719, version 3.16.13
+
+-------------------------------------------------------------------

Old:
----
  libzypp-3.15.0.tar.bz2

New:
----
  libzypp-3.17.0.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libzypp.spec ++++++
--- /var/tmp/diff_new_pack.J15120/_old  2007-08-17 18:56:43.000000000 +0200
+++ /var/tmp/diff_new_pack.J15120/_new  2007-08-17 18:56:43.000000000 +0200
@@ -1,5 +1,5 @@
 #
-# spec file for package libzypp (Version 3.15.0)
+# spec file for package libzypp (Version 3.17.0)
 #
 # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
 # This file and all modifications and additions to the pristine
@@ -16,9 +16,9 @@
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Autoreqprov:    on
 Summary:        Package, Patch, Pattern, and Product Management
-Version:        3.15.0
-Release:        2
-Source:         libzypp-3.15.0.tar.bz2
+Version:        3.17.0
+Release:        1
+Source:         libzypp-3.17.0.tar.bz2
 Source1:        libzypp-rpmlintrc
 Prefix:         /usr
 Provides:       yast2-packagemanager
@@ -44,7 +44,7 @@
     Ladislav Slezak <lslezak@xxxxxxx>
 
 %package devel
-Requires:       libzypp == 3.15.0
+Requires:       libzypp == 3.17.0
 Requires:       libxml2-devel curl-devel openssl-devel rpm-devel glibc-devel zlib-devel
 Requires:       bzip2 popt-devel dbus-1-devel glib2-devel hal-devel boost-devel libstdc++-devel
 Requires:       cmake
@@ -125,6 +125,22 @@
 %{_libdir}/pkgconfig/libzypp.pc
 
 %changelog
+* Fri Aug 17 2007 - kkaempf@xxxxxxx
+- add iterateResolvablesByKindsAndName
+- rev 6735, version 3.17.13
+* Fri Aug 17 2007 - kkaempf@xxxxxxx
+- rename ResolvableQuery::queryByName to iterateResolvablesByName
+- fix reading of kind and repository in ResolvableQuery
+- add reverse lookups in CacheTypes
+- add iterateResolvablesByKind
+- rev 6733
+* Fri Aug 17 2007 - schubi@xxxxxxx
+- shorten solver error messages Bug 259894
+- rev 6723
+* Thu Aug 16 2007 - kkaempf@xxxxxxx
+- fix ResolvableQuery::query(), add ResolvableQuery::queryByName()
+  install zypp/cache header files.
+- rev 6719, version 3.16.13
 * Thu Aug 16 2007 - kkaempf@xxxxxxx
 - discard pattern files with incompatbile architecture, both
   for download and for parsing. (#298716)

++++++ libzypp-3.15.0.tar.bz2 -> libzypp-3.17.0.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.15.0/package/libzypp.changes new/libzypp-3.17.0/package/libzypp.changes
--- old/libzypp-3.15.0/package/libzypp.changes  2007-08-16 17:26:55.000000000 +0200
+++ new/libzypp-3.17.0/package/libzypp.changes  2007-08-17 12:32:28.000000000 +0200
@@ -1,4 +1,32 @@
 -------------------------------------------------------------------
+Fri Aug 17 12:30:55 CEST 2007 - kkaempf@xxxxxxx
+
+- add iterateResolvablesByKindsAndName
+- rev 6735, version 3.17.13
+
+-------------------------------------------------------------------
+Fri Aug 17 11:45:24 CEST 2007 - kkaempf@xxxxxxx
+
+- rename ResolvableQuery::queryByName to iterateResolvablesByName
+- fix reading of kind and repository in ResolvableQuery
+- add reverse lookups in CacheTypes
+- add iterateResolvablesByKind
+- rev 6733
+
+-------------------------------------------------------------------
+Fri Aug 17 10:37:56 CEST 2007 - schubi@xxxxxxx
+
+- shorten solver error messages Bug 259894
+- rev 6723 
+
+-------------------------------------------------------------------
+Thu Aug 16 23:43:50 CEST 2007 - kkaempf@xxxxxxx
+
+- fix ResolvableQuery::query(), add ResolvableQuery::queryByName()
+  install zypp/cache header files.
+- rev 6719, version 3.16.13
+
+-------------------------------------------------------------------
 Thu Aug 16 17:21:52 CEST 2007 - kkaempf@xxxxxxx
 
 - discard pattern files with incompatbile architecture, both
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.15.0/svn-commit.tmp new/libzypp-3.17.0/svn-commit.tmp
--- old/libzypp-3.15.0/svn-commit.tmp   1970-01-01 01:00:00.000000000 +0100
+++ new/libzypp-3.17.0/svn-commit.tmp   2007-08-17 12:32:29.000000000 +0200
@@ -0,0 +1,4 @@
+bump
+--This line, and those below, will be ignored--
+
+M    package/libzypp.changes
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.15.0/VERSION.cmake new/libzypp-3.17.0/VERSION.cmake
--- old/libzypp-3.15.0/VERSION.cmake    2007-08-16 17:26:57.000000000 +0200
+++ new/libzypp-3.17.0/VERSION.cmake    2007-08-17 12:32:31.000000000 +0200
@@ -45,6 +45,6 @@
 #
 
 SET(LIBZYPP_MAJOR "3")
-SET(LIBZYPP_MINOR "15")
+SET(LIBZYPP_MINOR "17")
 SET(LIBZYPP_COMPATMINOR "13")
 SET(LIBZYPP_PATCH "0")
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.15.0/zypp/cache/CacheTypes.cc new/libzypp-3.17.0/zypp/cache/CacheTypes.cc
--- old/libzypp-3.15.0/zypp/cache/CacheTypes.cc 2007-08-16 17:26:57.000000000 +0200
+++ new/libzypp-3.17.0/zypp/cache/CacheTypes.cc 2007-08-17 12:32:31.000000000 +0200
@@ -93,6 +93,17 @@
       return rel;
     
     }
+
+    data::RecordId CacheTypes::idForRelation( const Rel &rel )
+    {
+      std::map<data::RecordId, Rel>::const_iterator it;
+      for ( it = _rel_cache.begin(); it != _rel_cache.end(); ++it )
+      {
+        if ( rel == it->second )
+         return it->first;
+      }
+      ZYPP_THROW(Exception("Inconsistent Rel"));   
+    }
     
     Resolvable::Kind CacheTypes::kindFor( const data::RecordId &id )
     {
@@ -105,6 +116,17 @@
       
       return kind;
     }
+
+    data::RecordId CacheTypes::idForKind( const Resolvable::Kind & kind )
+    {
+      std::map<data::RecordId, Resolvable::Kind>::const_iterator it;
+      for ( it = _kind_cache.begin(); it != _kind_cache.end(); ++it )
+      {
+        if ( kind == it->second )
+         return it->first;
+      }
+      ZYPP_THROW(Exception("Inconsistent Kind"));   
+    }
     
     Dep CacheTypes::deptypeFor( const data::RecordId &id )
     {
@@ -117,6 +139,17 @@
         ZYPP_THROW(Exception("Inconsistent deptype"));
       }
     }
+
+    data::RecordId CacheTypes::idForDeptype( const Dep & dep )
+    {
+      std::map<data::RecordId, string>::const_iterator it;
+      for ( it = _deptype_cache.begin(); it != _deptype_cache.end(); ++it )
+      {
+        if ( dep.asString() == it->second )
+         return it->first;
+      }
+      ZYPP_THROW(Exception("Inconsistent deptype"));   
+    }
     
     Arch CacheTypes::archFor( const data::RecordId &id )
     {
@@ -131,6 +164,18 @@
       return arch;
     }
 
+    data::RecordId CacheTypes::idForArch( const Arch & arch )
+    {
+      std::map<data::RecordId, Arch>::const_iterator it;
+      for ( it = _arch_cache.begin(); it != _arch_cache.end(); ++it )
+      {
+        if ( arch == it->second )
+         return it->first;
+      }
+      ZYPP_THROW(Exception("Inconsistent Arch"));   
+    }
+
+
 
     ///////////////////////////////////////////////////////////////////
     //
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.15.0/zypp/cache/CacheTypes.h new/libzypp-3.17.0/zypp/cache/CacheTypes.h
--- old/libzypp-3.15.0/zypp/cache/CacheTypes.h  2007-08-16 17:26:57.000000000 +0200
+++ new/libzypp-3.17.0/zypp/cache/CacheTypes.h  2007-08-17 12:32:31.000000000 +0200
@@ -67,6 +67,15 @@
       Rel relationFor( const data::RecordId &id );
       
       /**
+       * Cache record id for Relation
+       *
+       * \param rel relation
+       *
+       * \throws Exception if the Relation is not valid
+       */
+      data::RecordId idForRelation( const Rel &rel );
+      
+      /**
        * Kind for a cache record id.
        *
        * \param id The id you got in a cache query
@@ -74,6 +83,15 @@
        * \throws Exception if the id is not a valid type
        */
       Resolvable::Kind kindFor( const data::RecordId &id );
+
+      /**
+       * Cache record id for Kind
+       *
+       * \param kind Kind
+       *
+       * \throws Exception if the Kind is not valid
+       */
+      data::RecordId idForKind( const Resolvable::Kind & kind );
       
       /**
        * Dependency type for a cache record id.
@@ -85,6 +103,15 @@
       Dep deptypeFor( const data::RecordId &id );
       
       /**
+       * Cache record id for Dep type
+       *
+       * \param dep Dep
+       *
+       * \throws Exception if the Dep is not valid
+       */
+      data::RecordId idForDeptype( const Dep & dep );
+      
+      /**
        * Architecture for a cache record id.
        *
        * \param id The id you got in a cache query
@@ -93,6 +120,15 @@
        */
       Arch archFor( const data::RecordId &id );
       
+      /**
+       * Cache record id for Arch
+       *
+       * \param arch Arch
+       *
+       * \throws Exception if the Arch is not valid
+       */
+      data::RecordId idForArch( const Arch & arch );
+      
     public:
 
     private:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.15.0/zypp/cache/ResolvableQuery.cc new/libzypp-3.17.0/zypp/cache/ResolvableQuery.cc
--- old/libzypp-3.15.0/zypp/cache/ResolvableQuery.cc    2007-08-16 17:26:57.000000000 +0200
+++ new/libzypp-3.17.0/zypp/cache/ResolvableQuery.cc    2007-08-17 12:32:31.000000000 +0200
@@ -43,6 +43,7 @@
     _cmd_disk_usage.reset( new sqlite3_command( _con, "select d.name,du.size,du.files from resolvable_disk_usage du,dir_names d where du.resolvable_id=:rid and du.dir_name_id=d.id;"));
     
     MIL << "Creating Resolvable query impl" << endl;
+    //         0   1     2        3        4      5     6     7               8             9             10          11            12
     _fields = "id, name, version, release, epoch, arch, kind, installed_size, archive_size, install_only, build_time, install_time, repository_id";
   }
 
@@ -51,13 +52,32 @@
       MIL << "Destroying Resolvable query impl" << endl;
   }
 
+  //
+  // convert regex ? and * operators to sql _ and % respectively
+  //  example: regex2sql( "*foo?bar*" ) => "%foo_bar%"
+  std::string regex2sql( const std::string & s)
+  {
+    std::string sql( s );
+    string::iterator it;
+    for (it = sql.begin(); it != sql.end(); ++it)
+    {
+      if (*it == '*') *it = '%';
+      else if (*it == '?') *it = '_';
+    }
+    return sql;
+  }
+
   data::ResObject_Ptr fromRow( sqlite3_reader &reader )
   {
     data::ResObject_Ptr ptr (new data::ResObject);
 
+    // see _fields definition above for the getXXX() numbers
+
     ptr->name = reader.getstring(1);
     ptr->edition = Edition( reader.getstring(2), reader.getstring(3), reader.getint(4));
     ptr->arch = _type_cache.archFor(reader.getint(5));
+    ptr->kind = _type_cache.kindFor( reader.getint(6) );
+    ptr->repository = reader.getint( 12 );
 
     // TODO get the rest of the data
 
@@ -68,17 +88,13 @@
   void query( const data::RecordId &id,
                   ProcessResolvable fnc )
   {
-    sqlite3_connection con((_dbdir + "zypp.db").asString().c_str());
-    //con.executenonquery("PRAGMA cache_size=8000;");
-    con.executenonquery("BEGIN;");
-    sqlite3_command cmd( con, "select " + _fields + " from resolvables where id=:id;");
+    sqlite3_command cmd( _con, "select " + _fields + " from resolvables where id=:id;");
     cmd.bind(":id", id);
     sqlite3_reader reader = cmd.executereader();
     while(reader.read())
     {
       fnc( id, fromRow(reader) );
     }
-    con.executenonquery("COMMIT;");
   }
 
 
@@ -86,17 +102,39 @@
               ProcessResolvable fnc  )
   {  
     
-    sqlite3_connection con((_dbdir + "zypp.db").asString().c_str());
-    //con.executenonquery("PRAGMA cache_size=8000;");
-    con.executenonquery("BEGIN;");
-    sqlite3_command cmd( con, "select " + _fields + " from resolvables where name like '%:name%';");
-    cmd.bind(":name", s);
+    sqlite3_command cmd( _con, "select " + _fields + " from resolvables where name like :name;");
+    cmd.bind( ":name", regex2sql( s ) );
+    sqlite3_reader reader = cmd.executereader();
+    while(reader.read())
+    {
+      fnc( reader.getint64(0), fromRow(reader) );
+    }
+  }
+
+  void iterateResolvablesByName( const std::string &name, int wild, ProcessResolvable fnc  )
+  {
+    std::string sqlcmd = "select " + _fields + " from resolvables where name ";
+    std::string s( name );
+    if (wild == 0)
+    {
+      sqlcmd += "=";
+    }
+    else
+    {
+      sqlcmd += "like";
+      s = regex2sql( s );
+    }
+    sqlite3_command cmd( _con, sqlcmd + " :name;");
+    if (wild & 1)
+      s += "%";
+    if (wild & 2)
+      s = string("%") + s;
+    cmd.bind( ":name", s );
     sqlite3_reader reader = cmd.executereader();
     while(reader.read())
     {
       fnc( reader.getint64(0), fromRow(reader) );
     }
-    con.executenonquery("COMMIT;");
   }
 
 
@@ -158,7 +196,73 @@
       du.add(entry);
     }
   }
+
+  std::string queryRepositoryAlias( const data::RecordId &repo_id )
+  {
+    std::string alias;
+    sqlite3_command cmd( _con, "select alias from repositories where id=:id;" );
+    cmd.bind( ":id", repo_id );
+    sqlite3_reader reader = cmd.executereader();
+    while( reader.read() )
+    {
+      alias = reader.getstring( 0 );
+      break;
+    }
+    return alias;
+  }
   
+  void iterateResolvablesByKind( zypp::Resolvable::Kind kind, ProcessResolvable fnc )
+  {
+    sqlite3_command cmd( _con, "select " + _fields + " from resolvables where kind=:kind;");
+    data::RecordId kind_id = _type_cache.idForKind( kind );
+    cmd.bind(":kind", kind_id);
+    sqlite3_reader reader = cmd.executereader();
+    while(reader.read())
+    {
+      fnc( reader.getint64(0), fromRow(reader) );
+    }
+  }
+  
+  void iterateResolvablesByKindsAndName( std::vector<zypp::Resolvable::Kind> kinds,
+                  const std::string &name, int wild, ProcessResolvable fnc )
+  {
+    std::string sqlcmd( "select " + _fields + " from resolvables where name " );
+    std::string s( name );
+    if (wild == 0)
+    {
+      sqlcmd += "=";
+    }
+    else
+    {
+      sqlcmd += "like";
+      s = regex2sql( s );
+    }
+    if (wild & 1)
+      s += "%";
+    if (wild & 2)
+      s = string("%") + s;
+
+    sqlcmd = sqlcmd + " :name AND kind IN (";
+
+    std::vector<zypp::Resolvable::Kind>::iterator it;
+    for (it = kinds.begin(); it != kinds.end(); it++)
+    {
+      if (it != kinds.begin())
+        sqlcmd += ", ";
+      char idbuf[16];
+      snprintf( idbuf, 15, "%d", (int)(_type_cache.idForKind( *it )) );
+      sqlcmd += idbuf;
+    }
+    sqlite3_command cmd( _con, sqlcmd + ")");
+    cmd.bind( ":name", s );
+
+    sqlite3_reader reader = cmd.executereader();
+    while(reader.read())
+    {
+      fnc( reader.getint64(0), fromRow(reader) );
+    }
+  }
+
 private:
 
   int queryNumericAttributeInternal( sqlite3_connection &con,
@@ -329,6 +433,26 @@
   _pimpl->queryDiskUsage(record_id, du);
 }
 
+std::string ResolvableQuery::queryRepositoryAlias( const data::RecordId &repo_id )
+{
+  return _pimpl->queryRepositoryAlias( repo_id );
+}
+
+void ResolvableQuery::iterateResolvablesByKind( zypp::Resolvable::Kind kind, ProcessResolvable fnc )
+{
+  return _pimpl->iterateResolvablesByKind( kind, fnc );
+}
+
+void ResolvableQuery::iterateResolvablesByName( const std::string &name, int wild, ProcessResolvable fnc  )
+{
+  _pimpl->iterateResolvablesByName( name, wild, fnc );
+}
+
+void ResolvableQuery::iterateResolvablesByKindsAndName( std::vector<zypp::Resolvable::Kind> kinds,
+                  const std::string &name, int wild, ProcessResolvable fnc )
+{
+  _pimpl->iterateResolvablesByKindsAndName( kinds, name, wild, fnc );
+}
 //////////////////////////////////////////////////////////////////////////////
 
 } } // namespace zypp::cache
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.15.0/zypp/cache/ResolvableQuery.h new/libzypp-3.17.0/zypp/cache/ResolvableQuery.h
--- old/libzypp-3.15.0/zypp/cache/ResolvableQuery.h     2007-08-16 17:26:57.000000000 +0200
+++ new/libzypp-3.17.0/zypp/cache/ResolvableQuery.h     2007-08-17 12:32:31.000000000 +0200
@@ -4,6 +4,7 @@
 
 #include <set>
 #include <list>
+#include <vector>
 #include "zypp/base/Function.h"
 #include "zypp/Pathname.h"
 #include "zypp/data/ResolvableData.h"
@@ -38,13 +39,6 @@
   namespace cache
   { /////////////////////////////////////////////////////////////////
 
-   /**
-    * The resolvable query class allows you to query for resolvable
-    * data and properties from the cache.
-    */
-    struct ResolvableQuery
-    {
-    public:
      /**
       * Callback definition
       * first parameter is the resolvable id.
@@ -53,6 +47,13 @@
       typedef function<bool( const data::RecordId &,
                              data::ResObject_Ptr )> ProcessResolvable;
 
+   /**
+    * The resolvable query class allows you to query for resolvable
+    * data and properties from the cache.
+    */
+    struct ResolvableQuery
+    {
+    public:
       /**
        * Constructor
        *
@@ -72,7 +73,7 @@
 
       /**
       * Query by matching text
-      * \param text text to match
+      * \param text text to match, wildcard operators like * and ? are allowed
       * \param fnc callback to send the data to. (Will be called once per result)
       */
       void query( const std::string &text,
@@ -220,6 +221,39 @@
        */
       void queryDiskUsage( const data::RecordId &record_id,
                            DiskUsage &du );
+
+      /**
+       * \short Query repo alias by id
+       */
+      std::string queryRepositoryAlias( const data::RecordId &repo_id );
+
+      /**
+      * Query by matching name
+      * \param name name to match, wildcard operators like * and ? are allowed if 'wild' param != 0
+      * \param wild append wildcard operators ?: 0 = no, 1 = trailing wild, 2 = leading wild, 3 = trailing & leading wild, 4 = name contains wildcards
+      * \param fnc callback to send the data to. (Will be called once per result)
+      *
+      * Examples:
+      *   iterateByName( "kernel", 0, cb ) => look for resovables matching "kernel" exactly
+      *   iterateByName( "kernel", 1, cb ) => look for resovables starting with "kernel" (wildcard operator will be appendend)
+      *   iterateByName( "devel", 2, cb ) => look for resovables ending in "devel" (wildcard operator will be prependend)
+      *   iterateByName( "foo??", 1, cb ) => look for resovables starting with "foo" and at least 5 characters
+      *   iterateByName( "fo*o", 4, cb ) => look for resovables matching "fo*o"
+      */
+      void iterateResolvablesByName( const std::string &name, int wild,
+                  ProcessResolvable fnc  );
+
+      /**
+       * \short Iterate resolvables by Kind
+       */
+      void iterateResolvablesByKind( zypp::Resolvable::Kind kind, ProcessResolvable fnc );
+
+      /**
+       * \short Iterate resolvables by Kinds and Name
+       */
+      void iterateResolvablesByKindsAndName( std::vector<zypp::Resolvable::Kind> kinds,
+                  const std::string &name, int wild, ProcessResolvable fnc );
+
     private:
       /** Implementation. */
       class Impl;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.15.0/zypp/CMakeLists.txt new/libzypp-3.17.0/zypp/CMakeLists.txt
--- old/libzypp-3.15.0/zypp/CMakeLists.txt      2007-08-16 17:26:56.000000000 +0200
+++ new/libzypp-3.17.0/zypp/CMakeLists.txt      2007-08-17 12:32:31.000000000 +0200
@@ -900,10 +900,10 @@
   cache/Utils.h
 )
 
-#INSTALL(  FILES
-#  ${zypp_cache_HEADERS}
-#  DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/cache
-#)
+INSTALL(  FILES
+  ${zypp_cache_HEADERS}
+  DESTINATION ${CMAKE_INSTALL_PREFIX}/include/zypp/cache
+)
 
 SET( zypp_cache_sqlite3x_SRCS
   cache/sqlite3x/sqlite3x_command.cpp
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.15.0/zypp/data/ResolvableData.h new/libzypp-3.17.0/zypp/data/ResolvableData.h
--- old/libzypp-3.15.0/zypp/data/ResolvableData.h       2007-08-16 17:26:56.000000000 +0200
+++ new/libzypp-3.17.0/zypp/data/ResolvableData.h       2007-08-17 12:32:31.000000000 +0200
@@ -22,6 +22,7 @@
 #include "zypp/data/RecordId.h"
 #include "zypp/capability/CapabilityImpl.h"
 #include "zypp/Pathname.h"
+#include "zypp/Resolvable.h"
 #include "zypp/NVR.h"
 #include "zypp/Edition.h"
 #include "zypp/ByteCount.h"
@@ -58,6 +59,8 @@
       Resolvable()
       {};
 
+      /** Kind */
+      zypp::Resolvable::Kind kind;
       /** Name */
       std::string name;
       /** Edition */
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.15.0/zypp/solver/detail/ResolverInfo.cc new/libzypp-3.17.0/zypp/solver/detail/ResolverInfo.cc
--- old/libzypp-3.15.0/zypp/solver/detail/ResolverInfo.cc       2007-08-16 17:26:56.000000000 +0200
+++ new/libzypp-3.17.0/zypp/solver/detail/ResolverInfo.cc       2007-08-17 12:32:31.000000000 +0200
@@ -138,24 +138,27 @@
 }
 
 string
-ResolverInfo::toString (PoolItem_Ref item)
+ResolverInfo::toString (PoolItem_Ref item, bool shortVersion)
 {
     ostringstream os;
     if (!item) return "";
 
     if (item->kind() != ResTraits<zypp::Package>::kind)
        os << item->kind() << ':';
-    os  << item->name() << '-' << item->edition();
-    if (item->arch() != "") {
-       os << '.' << item->arch();
-    }
-    Repository s = item->repository();
-    if (s) {
-       string alias = s.info().alias();
-       if (!alias.empty()
-           && alias != "@system")
-       {
-           os << '[' << s.info().alias() << ']';
+    os  << item->name();
+    if (!shortVersion) {
+       os << '-' << item->edition();
+       if (item->arch() != "") {
+           os << '.' << item->arch();
+       }
+       Repository s = item->repository();
+       if (s) {
+           string alias = s.info().alias();
+           if (!alias.empty()
+               && alias != "@system")
+           {
+               os << '[' << s.info().alias() << ']';
+           }
        }
     }
     return os.str();
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.15.0/zypp/solver/detail/ResolverInfo.h new/libzypp-3.17.0/zypp/solver/detail/ResolverInfo.h
--- old/libzypp-3.15.0/zypp/solver/detail/ResolverInfo.h        2007-08-16 17:26:56.000000000 +0200
+++ new/libzypp-3.17.0/zypp/solver/detail/ResolverInfo.h        2007-08-17 12:32:31.000000000 +0200
@@ -113,7 +113,7 @@
 
     // ---------------------------------- I/O
 
-    static std::string toString (PoolItem_Ref item);
+    static std::string toString (PoolItem_Ref item, bool shortVersion=false);
     static std::string toString (const Capability & capability);
 
     virtual std::ostream & dumpOn( std::ostream & str ) const;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/libzypp-3.15.0/zypp/solver/detail/Resolver_problems.cc new/libzypp-3.17.0/zypp/solver/detail/Resolver_problems.cc
--- old/libzypp-3.15.0/zypp/solver/detail/Resolver_problems.cc  2007-08-16 17:26:56.000000000 +0200
+++ new/libzypp-3.17.0/zypp/solver/detail/Resolver_problems.cc  2007-08-17 12:32:31.000000000 +0200
@@ -344,6 +344,7 @@
 
        if (item) {
            string who = ResolverInfo::toString( item );
+           string whoShort = ResolverInfo::toString( item, true ); // short version
            switch (info->type()) {
                case RESOLVER_INFO_TYPE_INVALID: {
                    what = _("Invalid information");
@@ -353,10 +354,10 @@
                    ResolverInfoNeededBy_constPtr needed_by = dynamic_pointer_cast<const ResolverInfoNeededBy>(info);
                    if (needed_by->items().size() >= 1)
                        // TranslatorExplanation %s = name of package, patch, selection ...
-                       what = str::form (_("%s is needed by other resolvables"), who.c_str());
+                       what = str::form (_("%s is needed by other resolvables"), whoShort.c_str());
                    else
                        // TranslatorExplanation %s = name of package, patch, selection ...                 
-                       what = str::form (_("%s is needed by %s"), who.c_str(), needed_by->itemsToString(true).c_str());
+                       what = str::form (_("%s is needed by %s"), whoShort.c_str(), needed_by->itemsToString(true).c_str());
                    details = str::form (_("%s is needed by:\n%s"), who.c_str(), needed_by->itemsToString(false).c_str());
                }
                    break;
@@ -364,10 +365,10 @@
                    ResolverInfoConflictsWith_constPtr conflicts_with = dynamic_pointer_cast<const ResolverInfoConflictsWith>(info);
                    if (conflicts_with->items().size() >= 1)
                        // TranslatorExplanation %s = name of package, patch, selection ...
-                       what = str::form (_("%s conflicts with other resolvables"), who.c_str() );
+                       what = str::form (_("%s conflicts with other resolvables"), whoShort.c_str() );
                    else
                        // TranslatorExplanation %s = name of package, patch, selection ...             
-                       what = str::form (_("%s conflicts with %s"), who.c_str(), conflicts_with->itemsToString(true).c_str());
+                       what = str::form (_("%s conflicts with %s"), whoShort.c_str(), conflicts_with->itemsToString(true).c_str());
                
                    details = str::form (_("%s conflicts with:\n%s"), who.c_str(), conflicts_with->itemsToString(false).c_str()) + "\n";
                    details += logAdditionalInfo(collector.additionalInfo, item);
@@ -398,10 +399,10 @@
                    ResolverInfoObsoletes_constPtr obsoletes = dynamic_pointer_cast<const ResolverInfoObsoletes>(info);
                    if (obsoletes->items().size() >= 1)
                        // TranslatorExplanation %s = name of package, patch, selection ...
-                       what = str::form (_("%s obsoletes other resolvables"), who.c_str());
+                       what = str::form (_("%s obsoletes other resolvables"), whoShort.c_str());
                    else
                        // TranslatorExplanation %s = name of package, patch, selection ...             
-                       what = str::form (_("%s obsoletes %s"), who.c_str(), obsoletes->itemsToString(true).c_str());
+                       what = str::form (_("%s obsoletes %s"), whoShort.c_str(), obsoletes->itemsToString(true).c_str());
                    // TranslatorExplanation %s = name of package, patch, selection ...                         
                    details = str::form (_("%s obsoletes:%s"), who.c_str(), obsoletes->itemsToString(false).c_str());
                    details += _("\nThese resolvables will be deleted from the system.");
@@ -412,11 +413,11 @@
                    ResolverInfoDependsOn_constPtr depends_on = dynamic_pointer_cast<const ResolverInfoDependsOn>(info);
                    if (depends_on->items().size() >= 1)
                        // TranslatorExplanation %s = name of package, patch, selection ...
-                       what = str::form (_("%s depends on other resolvables"), who.c_str(),
+                       what = str::form (_("%s depends on other resolvables"), whoShort.c_str(),
                                          depends_on->itemsToString(true).c_str());
                    else
                        // TranslatorExplanation %s = name of package, patch, selection ...                             
-                       what = str::form (_("%s depends on %s"), who.c_str(),
+                       what = str::form (_("%s depends on %s"), whoShort.c_str(),
                                          depends_on->itemsToString(true).c_str());
                    // TranslatorExplanation %s = name of package, patch, selection ...                         
                    details = str::form (_("%s depends on:%s"), who.c_str(), depends_on->itemsToString(false).c_str());            
@@ -431,7 +432,7 @@
                case RESOLVER_INFO_TYPE_MISSING_REQ: { // no solution; it is only a info
                    ResolverInfoMissingReq_constPtr missing_req = dynamic_pointer_cast<const ResolverInfoMissingReq>(info);
                    // TranslatorExplanation %s = dependency
-                   what = str::form (_("Cannot install %s"), who.c_str());
+                   what = str::form (_("Cannot install %s"), whoShort.c_str());
                    // TranslatorExplanation %s = capability            
                    details = str::form (_("None provides %s"), missing_req->capability().asString().c_str());
                    details += _("\nThere is no resource available which supports this requirement.");
@@ -454,7 +455,7 @@
                         it != collector.conflictMap.end(); ++it) {
                        if (it->first == item) {
                            what = str::form (_("Cannot install %s, because it is conflicting with %s"),
-                                             who.c_str(),
+                                             whoShort.c_str(),
                                              it->second->name().c_str()) + "\n";
                            details = logAdditionalInfo(collector.additionalInfo, item);
                            details += logAdditionalInfo(collector.additionalInfo, it->second);                      
@@ -483,7 +484,7 @@
                case RESOLVER_INFO_TYPE_REJECT_INSTALL: {                       // p is scheduled to be installed, but this is not possible because of dependency problems.
                    ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
                    // TranslatorExplanation %s = name of package,patch,...                             
-                   what = str::form (_("Cannot install %s due to dependency problems"), who.c_str());
+                   what = str::form (_("Cannot install %s due to dependency problems"), whoShort.c_str());
                    details = misc_info->message() + "\n";
                    details += logAdditionalInfo(collector.additionalInfo, item);               
                    ResolverProblem_Ptr problem = new ResolverProblem (what, details);
@@ -515,7 +516,7 @@
                case RESOLVER_INFO_TYPE_INSTALL_PARALLEL: {                     // Can't install p, since a resolvable of the same name is already marked as needing to be installed.
                    ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
                    // TranslatorExplanation %s = name of package,patch,...                             
-                   what = str::form (_("Cannot install %s"), who.c_str());
+                   what = str::form (_("Cannot install %s"), whoShort.c_str());
                    details = misc_info->message() + "\n";
                    details += logAdditionalInfo(collector.additionalInfo, item);
                    details += logAdditionalInfo(collector.additionalInfo, misc_info->other());                              
@@ -590,7 +591,7 @@
                case RESOLVER_INFO_TYPE_NO_OTHER_PROVIDER: {            // There are no alternative installed providers of c [for p]
                    ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
                    // TranslatorExplanation %s = name of package, patch, selection ...                         
-                   what = str::form (_("%s has missing dependencies"), who.c_str());
+                   what = str::form (_("%s has missing dependencies"), whoShort.c_str());
                    details = misc_info->message() + "\n";
                    details += logAdditionalInfo(collector.additionalInfo, item);                               
                    ResolverProblem_Ptr problem = new ResolverProblem (what, details);
@@ -638,7 +639,7 @@
                case RESOLVER_INFO_TYPE_NO_PROVIDER: {                  // There are no installable providers of c [for p]
                    ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
                    // TranslatorExplanation %s = name of package, patch, selection ...                         
-                   what = str::form (_("%s cannot be installed due to missing dependencies"), who.c_str());          
+                   what = str::form (_("%s cannot be installed due to missing dependencies"), whoShort.c_str());             
                    details = misc_info->message() + "\n";
                    details += logAdditionalInfo(collector.additionalInfo, item);                               
                    ResolverProblem_Ptr problem = new ResolverProblem (what, details);
@@ -689,7 +690,7 @@
                    // TranslatorExplanation %s = name of package, patch, selection ...                         
                    what =str::form (_("%s fulfills dependencies of %s but will be uninstalled"),
                                     misc_info->other()->name().c_str(),
-                                    who.c_str());
+                                    whoShort.c_str());
                    details = misc_info->message();
                    // It is only an info --> no solution is needed
                }
@@ -699,7 +700,7 @@
                    // TranslatorExplanation %s = name of package, patch, selection ...                         
                    what =str::form (_("%s fulfills dependencies of %s but will be kept on your system"),
                                     misc_info->other()->name().c_str(),
-                                    who.c_str());
+                                    whoShort.c_str());
                    details = misc_info->message();
                    // It is only an info --> no solution is needed
                }               
@@ -717,7 +718,7 @@
                    // TranslatorExplanation %s = name of package, patch, selection ...                         
                    what = str::form (_("Cannot install %s to fulfill the dependencies of %s"),
                                      misc_info->other()->name().c_str(),
-                                     who.c_str());
+                                     whoShort.c_str());
                    details = misc_info->message();
                    // It is only an info --> no solution is needed          
                }
@@ -732,7 +733,7 @@
                    // TranslatorExplanation %s = name of package, patch, selection ...                         
                    what = str::form (_("Cannot install %s to fulfil the dependencies of %s"),
                                      misc_info->other()->name().c_str(),
-                                     who.c_str());                             
+                                     whoShort.c_str());                                
                    what = misc_info->message();
                    // It is only an info --> no solution is needed          
                }
@@ -768,7 +769,7 @@
                case RESOLVER_INFO_TYPE_UNINSTALL_TO_BE_INSTALLED: {    // p is to-be-installed, so it won't be unlinked.
                    ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
                    // TranslatorExplanation %s = name of package, patch, selection ...                         
-                   what = str::form (_("%s will not be uninstalled, because it is still required"), who.c_str());
+                   what = str::form (_("%s will not be uninstalled, because it is still required"), whoShort.c_str());
                    details = misc_info->message();
                    // It is only an info --> no solution is needed                          
                }
@@ -776,7 +777,7 @@
                case RESOLVER_INFO_TYPE_UNINSTALL_INSTALLED: {          // p is required by installed, so it won't be unlinked.
                    ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
                    // TranslatorExplanation %s = name of package, patch, selection ...                         
-                   what = str::form (_("%s will not be uninstalled, because it is still required"), who.c_str());            
+                   what = str::form (_("%s will not be uninstalled, because it is still required"), whoShort.c_str());               
                    details = misc_info->message() + "\n";
                    details += logAdditionalInfo(collector.additionalInfo, item);                                               
 
@@ -828,11 +829,11 @@
                    // TranslatorExplanation %s = name of package, patch, selection ...
                    if (misc_info->other())
                        what = str::form (_("Cannot install %s, because it is conflicting with %s"),
-                                         who.c_str(),
+                                         whoShort.c_str(),
                                          misc_info->other()->name().c_str());
                    else
                        what = str::form (_("Cannot install %s, because it is conflicting"),
-                                         who.c_str());
+                                         whoShort.c_str());
                    details = misc_info->message() + "\n";
                    details += logAdditionalInfo(collector.additionalInfo, item);
                    if (misc_info->other())          
@@ -854,7 +855,7 @@
                    ResolverInfoMisc_constPtr misc_info = dynamic_pointer_cast<const ResolverInfoMisc>(info);
                    // TranslatorExplanation %s = name of package, patch, selection ...                         
                    what = str::form (_("%s is uninstallable due to conflicts with %s"),
-                                     who.c_str(),
+                                     whoShort.c_str(),
                                      misc_info->other()->name().c_str());                                
                    details = misc_info->message();
                    // It is only an info --> no solution is needed



++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

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

< Previous Next >