- more progress trying to adapt to the solvstore semantics
authorDuncan Mac-Vicar P <dmacvicar@suse.de>
Wed, 30 Jan 2008 10:19:54 +0000 (10:19 +0000)
committerDuncan Mac-Vicar P <dmacvicar@suse.de>
Wed, 30 Jan 2008 10:19:54 +0000 (10:19 +0000)
zypp/TranslatedText.h
zypp/cache/SolvStore.cc
zypp/cache/SolvStore.h

index 10f3b145d563487898099f55ad2fa308b5e0ecaf..39646cd65334fc598a48b479fd7b497f49e65105 100644 (file)
@@ -66,6 +66,10 @@ namespace zypp
     std::string text( const Locale &lang = Locale() ) const;
     std::set<Locale> locales() const;
 
+    /** String representation. */
+    const char * c_str( const Locale &lang = Locale() ) const
+    { return text(lang).c_str(); }
+
     void setText( const std::string &text, const Locale &lang = Locale());
     void setText( const std::list<std::string> &text, const Locale &lang = Locale());
 
index 9976fa638616f1d09472da133b4c5b534f26066a..518e67f4bca7439578703e494e46ad89905d3ee6 100644 (file)
@@ -58,9 +58,18 @@ struct SolvStore::Impl
     _pool = pool_create();
     _repo = repo_create(_pool, alias.c_str() ); 
     _repodata = repo_add_repodata(_repo);
-    
+   
+    //_attr_resobject_summary = str2id(_pool, "summary");
+    //_attr_resobject_description = str2id(_pool, "description");
+    _attr_resobject_installedSize = str2id(_pool, "installedSize", 1);
+    _attr_resobject_buildTime = str2id(_pool, "buildTime", 1);
+    _attr_resobject_installOnly = str2id(_pool, "installOnly", 1);
+    _attr_resobject_vendor = str2id(_pool, "vendor", 1);
+    _attr_resobject_insnotify = str2id(_pool, "insnotify", 1);
+    _attr_resobject_delnotify = str2id(_pool, "delnotify", 1);
+    // license to confirm, insnotify, delnotify
     _attr_package_authors = str2id(_pool, "package:authors", 1);
-    _attr_package_description = str2id(_pool, "package:description", 1);
     _attr_package_diskusage = str2id(_pool, "package:diskusage", 1);
     _attr_package_downloadsize = str2id(_pool, "package:downloadsize", 1);
     _attr_package_eula = str2id(_pool, "package:eula", 1);
@@ -76,7 +85,6 @@ struct SolvStore::Impl
     _attr_package_nosource = str2id(_pool, "package:nosource", 1);
     _attr_package_source = str2id(_pool, "package:source", 1);
     _attr_package_sourceid = str2id(_pool, "package:sourceid", 1);
-    _attr_package_summary = str2id(_pool, "package:summary", 1);
     _attr_package_time = str2id(_pool, "package:time", 1);
   }
 
@@ -103,6 +111,13 @@ struct SolvStore::Impl
   Pathname _cachedir;
   Repodata *_repodata;
 
+  Id _attr_resobject_installedSize;
+  Id _attr_resobject_buildTime;
+  Id _attr_resobject_installOnly;
+  Id _attr_resobject_vendor;
+  Id _attr_resobject_delnotify; 
+  Id _attr_resobject_insnotify;
+
   Id _attr_package_authors;
   Id _attr_package_description;
   Id _attr_package_diskusage;
@@ -147,10 +162,11 @@ void SolvStore::commit()
   // NOOP
 }
 
-void SolvStore::appendResObjectAttributes( const data::RecordId &rid,
-                                            const data::ResObject_Ptr & res )
+void SolvStore::appendResObjectAttributes( Id rid,
+                                           const data::ResObject_Ptr & res )
 {
-  
+  repodata_set_str(_pimpl->_repodata, rid, _pimpl->_attr_resobject_insnotify, res->insnotify.c_str());
+  repodata_set_str(_pimpl->_repodata, rid, _pimpl->_attr_resobject_delnotify, res->delnotify.c_str());
 //   appendTranslatedStringAttribute( rid, attrResObjectDescription(), res->description );
 //   appendTranslatedStringAttribute( rid, attrResObjectSummary(), res->summary );
 //   appendNumericAttribute( rid, attrResObjectInstalledSize(), res->installedSize );
@@ -163,8 +179,8 @@ void SolvStore::appendResObjectAttributes( const data::RecordId &rid,
 }
 
 
-void SolvStore::appendPackageBaseAttributes( const RecordId & pkgid,
-                                              const data::Packagebase_Ptr & package )
+void SolvStore::appendPackageBaseAttributes( Id rid,
+                                             const data::Packagebase_Ptr & package )
 {
     
 //   appendStringAttribute( pkgid, attrPackageBuildhost(), package->buildhost );
index 629c4e50ba9a55c47d844ca230783da4711be627..7143aa0c9e17015b961346a1390bb019873733da 100644 (file)
@@ -263,11 +263,11 @@ namespace zypp
        * to avoid some duplication across types.
        */
       //@{
-      void appendResObjectAttributes( const data::RecordId &rid,
+      void appendResObjectAttributes( Id id,
                                       const data::ResObject_Ptr & res );
 
-      void appendPackageBaseAttributes(const data::RecordId & pkgid,
-                                       const data::Packagebase_Ptr & package);
+      void appendPackageBaseAttributes( Id id,
+                                        const data::Packagebase_Ptr & package);
       //@}
 
       void cleanRepository( const std::string &alias,