Mailinglist Archive: zypp-commit (149 mails)

< Previous Next >
[zypp-commit] r5342 - in /branches/SuSE-Linux-10_2-Branch/backend/src/dbsource: DbAccess.cc DbProductImpl.cc DbProductImpl.h DbSourceImpl.cc
  • From: dmacvicar@xxxxxxxxxxxxxxxx
  • Date: Wed, 11 Apr 2007 16:03:47 -0000
  • Message-id: <20070411160347.B97C72368A@xxxxxxxxxxxxxxxx>
Author: dmacvicar
Date: Wed Apr 11 18:03:47 2007
New Revision: 5342

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

- initial code to support distribution name and edition in backend
  (#260755)
  Michael Calmer will do some tests tomorrow.


Modified:
    branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbAccess.cc
    branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbProductImpl.cc
    branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbProductImpl.h
    branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbSourceImpl.cc

Modified: branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbAccess.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbAccess.cc?rev=5342&r1=5341&r2=5342&view=diff
==============================================================================
--- branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbAccess.cc (original)
+++ branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbAccess.cc Wed Apr 11 18:03:47 2007
@@ -414,7 +414,9 @@
     //                       1
     "INSERT INTO product_details (resolvable_id, "
     //                       2        3
-    "                             summary, description) "
+    "                             summary, description,"
+    //                            4                  5                     6                     7
+    "                             distribution_name, distribution_version, distribution_release, distribution_epoch"
     "VALUES (?, ?, ?)"
     "");
 
@@ -1188,6 +1190,14 @@
   sqlite3_bind_text( handle, 2, product->summary().c_str(), -1, SQLITE_STATIC );
   sqlite3_bind_text( handle, 3, desc2str(product->description()).c_str(), -1, SQLITE_STATIC );
 
+  sqlite3_bind_text( handle, 4, product->distributionName().c_str(), -1, SQLITE_STATIC );
+  
+  Edition dist_edition = product->distributionEdition();
+  
+  sqlite3_bind_text( handle, 5, dist_edition.version().c_str(), -1, SQLITE_STATIC );
+  sqlite3_bind_text( handle, 6, dist_edition.release().c_str(), -1, SQLITE_STATIC );
+  sqlite3_bind_int( handle, 7, dist_edition.epoch() );
+  
   rc = sqlite3_step( handle);
   sqlite3_reset( handle);
 

Modified: branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbProductImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbProductImpl.cc?rev=5342&r1=5341&r2=5342&view=diff
==============================================================================
--- branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbProductImpl.cc (original)
+++ branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbProductImpl.cc Wed Apr 11 18:03:47 2007
@@ -46,13 +46,33 @@
 {
   _zmdid = id;
 
-  // 1-5: nvra, see DbSourceImpl
-  // 6: status (don't care, its recomputed anyways)
-  // 7: category
+  //      0   1     2        3        4      5
+  //     id, name, version, release, epoch, arch
+  //      6               7
+  //      installed_size, catalog,"
+  //      8          9      10      11        12, 13, 14, 15
+  //   installed, local, status, category, distribution_name, distribution_version, distribution_release, distribution_epoch "
+  
   const char * text = ((const char *) sqlite3_column_text( handle, 7 ));
   if (text != NULL)
     _category = text;
 
+  const char *dist_name = 0;
+  const char *dist_ver = 0;
+  const char *dist_rel = 0;
+  const char *dist_epoch = 0;
+  
+  dist_name = (const char *) sqlite3_column_text( handle, 12 );
+  dist_ver = (const char *) sqlite3_column_text( handle, 13 );
+  dist_rel = (const char *) sqlite3_column_text( handle, 14 );
+  dist_epoch = (const char *) sqlite3_column_int( handle, 15 );
+  
+  if ( dist_name && dist_ver && dist_rel && dist_epoch )
+  {
+    _distribution_name = dist_name;
+    _distribution_edition = Edition( dist_ver, dist_rel, dist_epoch);
+  }
+
   return;
 }
 
@@ -104,6 +124,15 @@
   return _releaseNotesUrl;
 }
 
+std::string DbProductImpl::distributionName() const
+{
+  return _distribution_name;
+}
+
+Edition DbProductImpl::distributionEdition() const
+{
+  return _distribution_edition;
+}
 
 /////////////////////////////////////////////////////////////////
 } // namespace zypp

Modified: branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbProductImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbProductImpl.h?rev=5342&r1=5341&r2=5342&view=diff
==============================================================================
--- branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbProductImpl.h (original)
+++ branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbProductImpl.h Wed Apr 11 18:03:47 2007
@@ -52,6 +52,8 @@
   /** */
   virtual ZmdId zmdid() const;
 
+  virtual std::string distributionName() const;
+  virtual Edition distributionEdition() const;
 protected:
   TranslatedText _summary;
   TranslatedText _description;
@@ -61,6 +63,9 @@
   Label _vendor;
   Label _displayName;
   Url _releaseNotesUrl;
+  
+  std::string _distribution_name;
+  Edition _distribution_edition;
 };
 /////////////////////////////////////////////////////////////////
 } // namespace zypp

Modified: branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbSourceImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbSourceImpl.cc?rev=5342&r1=5341&r2=5342&view=diff
==============================================================================
--- branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbSourceImpl.cc (original)
+++ branches/SuSE-Linux-10_2-Branch/backend/src/dbsource/DbSourceImpl.cc Wed Apr 11 18:03:47 2007
@@ -37,6 +37,7 @@
 
 using namespace std;
 using namespace zypp;
+using namespace zypp::source;
 
 static CheckSum encoded_string_to_checksum( const std::string &encoded )
 {
@@ -385,8 +386,8 @@
     "SELECT id, name, version, release, epoch, arch, "
     //      6               7
     "       installed_size, catalog,"
-    //      8          9      10      11
-    "       installed, local, status, category "
+    //      8          9      10      11        12, 13, 14, 15
+    "       installed, local, status, category, distribution_name, distribution_version, distribution_release, distribution_epoch "
     "FROM products "
     "WHERE catalog = ?";
 
@@ -684,7 +685,7 @@
       sqlite3_bind_int64 (delta_handle, 1, id );
       while ((delta_rc = sqlite3_step (delta_handle)) == SQLITE_ROW)
       {
-        zypp::source::OnMediaLocation on_media;
+        OnMediaLocation on_media;
         on_media.medianr( sqlite3_column_int( delta_handle, 1 ) );
         on_media.filename( Pathname((const char *) sqlite3_column_text( delta_handle, 2 )) );
         
@@ -728,7 +729,7 @@
       {
         sqlite_int64 patch_package_id = sqlite3_column_int64( patch_handle, 0 );
         
-        zypp::source::OnMediaLocation on_media;
+        OnMediaLocation on_media;
         on_media.medianr( sqlite3_column_int( patch_handle, 1 ) );
         on_media.filename( Pathname((const char *) sqlite3_column_text( patch_handle, 2 )) );
         

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

< Previous Next >
This Thread
  • No further messages