- Add product attribute 'type' (aka 'category' which is now
authorMichael Andres <ma@suse.de>
Fri, 3 Aug 2007 18:28:22 +0000 (18:28 +0000)
committerMichael Andres <ma@suse.de>
Fri, 3 Aug 2007 18:28:22 +0000 (18:28 +0000)
  deprecated). Adapted sustags and yum parsers to parse and
  provide this value.

20 files changed:
VERSION.cmake
devel/devel.ma/Parse.cc
devel/devel.ma/Test.cc
zypp/Product.cc
zypp/Product.h
zypp/cache/CacheAttributes.h
zypp/cache/CacheStore.cc
zypp/data/ResolvableData.h
zypp/detail/ProductImplIf.cc
zypp/detail/ProductImplIf.h
zypp/parser/susetags/ContentFileReader.cc
zypp/parser/yum/ProductFileReader.cc
zypp/repo/cached/ProductImpl.cc
zypp/repo/cached/ProductImpl.h
zypp/repo/memory/ProductImpl.cc
zypp/repo/memory/ProductImpl.h
zypp/target/store/XMLFilesBackend.cc
zypp/target/store/serialize.cc
zypp/target/store/xml/XMLProductImpl.cc
zypp/target/store/xml/XMLProductImpl.h

index db59b11..a17be34 100644 (file)
@@ -47,4 +47,4 @@
 SET(LIBZYPP_MAJOR "3")
 SET(LIBZYPP_MINOR "13")
 SET(LIBZYPP_COMPATMINOR "13")
-SET(LIBZYPP_PATCH "10")
+SET(LIBZYPP_PATCH "11")
index 287168b..6165778 100644 (file)
@@ -48,18 +48,35 @@ struct Xprint
 {
   bool operator()( const PoolItem & obj_r )
   {
-    handle( asKind<Pattern>( obj_r ) );
+    //handle( asKind<Package>( obj_r ) );
+    //handle( asKind<Pattern>( obj_r ) );
+    handle( asKind<Product>( obj_r ) );
     return true;
   }
 
+  void handle( const Package_constPtr & p )
+  {
+    if ( !p )
+      return;
+
+    MIL << p->mediaNr() << endl;
+  }
+
   void handle( const Pattern_constPtr & p )
   {
     if ( !p )
       return;
 
     MIL << p << endl;
-    if ( ! p->includes().empty() ) DBG << p->includes() << endl;
-    if ( ! p->extends().empty() ) DBG << p->extends() << endl;
+  }
+
+  void handle( const Product_constPtr & p )
+  {
+    if ( !p )
+      return;
+
+    ERR << p << endl;
+    ERR << p->type() << endl;
   }
 
   template<class _C>
@@ -308,8 +325,8 @@ int main( int argc, char * argv[] )
        SEC << "cleanCache" << endl;
        repoManager.cleanCache( nrepo );
       }
-      SEC << "refreshMetadat" << endl;
-      repoManager.refreshMetadata( nrepo );
+      //SEC << "refreshMetadat" << endl;
+      //repoManager.refreshMetadata( nrepo );
       SEC << "buildCache" << endl;
       repoManager.buildCache( nrepo );
     }
@@ -335,6 +352,15 @@ int main( int argc, char * argv[] )
     MIL << "Added target: " << pool << endl;
   }
 
+  Capability _cap( CapFactory().parse<Language>( "de" ) );
+  SEC << "F" << endl;
+  forEachMatchIn( pool, Dep::FRESHENS, _cap, Print() );
+  SEC << "S" << endl;
+  forEachMatchIn( pool, Dep::SUPPLEMENTS, _cap, Print() );
+  SEC << "P" << endl;
+  forEachMatchIn( pool, Dep::PROVIDES, _cap, Print() );
+  SEC << endl;
+
   std::for_each( pool.begin(), pool.end(), Xprint() );
 
   ///////////////////////////////////////////////////////////////////
index 9cc9af3..0c60c7c 100644 (file)
 #include <zypp/CheckSum.h>
 #include <zypp/Date.h>
 
-#include "zypp/parser/TagParser.h"
-#include "zypp/parser/susetags/PackagesFileReader.h"
-#include "zypp/parser/susetags/PackagesLangFileReader.h"
-#include "zypp/parser/susetags/PatternFileReader.h"
-#include "zypp/parser/susetags/ContentFileReader.h"
-#include "zypp/parser/susetags/RepoIndex.h"
-#include "zypp/parser/susetags/RepoParser.h"
 #include "zypp/cache/CacheStore.h"
 
 using namespace std;
 using namespace zypp;
-using namespace zypp::parser;
-using namespace zypp::parser::susetags;
 
 ///////////////////////////////////////////////////////////////////
 
-struct DummyConsumer : public zypp::data::ResolvableDataConsumer
-                     , private base::NonCopyable
-{
-  std::string idString( const data::ResObject_Ptr & res_r, ResolvableTraits::KindType kind_r )
-  {
-    std::string ret( kind_r.asString() );
-    ret += ":";
-    ret += res_r->name;
-    ret += "-";
-    ret += res_r->edition.asString();
-    ret += ".";
-    ret += res_r->arch.asString();
-    return ret;
-  }
-
-  data::RecordId                       _lastId;
-  std::map<std::string,data::RecordId> _idMap;
-  std::map<data::RecordId,std::string> _reverseMap;
-
-  bool hasEntry( const std::string & id_r )
-  {
-    return _idMap.find( id_r ) != _idMap.end();
-  }
-
-  data::RecordId newId( const data::ResObject_Ptr & res_r, ResolvableTraits::KindType kind_r )
-  {
-    std::string id( idString( res_r, kind_r ) );
-    if ( hasEntry( id ) )
-      ZYPP_THROW(Exception(id));
-    _idMap[id] = ++_lastId;
-    _reverseMap[_lastId] = id;
-    MIL << "NEW_ID " << _lastId << " - " << id << endl;
-    logNew( res_r, kind_r );
-    return _lastId;
-  }
-
-  data::RecordId getId( const data::ResObject_Ptr & res_r, ResolvableTraits::KindType kind_r )
-  {
-    std::string id( idString( res_r, kind_r ) );
-    if ( ! hasEntry( id ) )
-      ZYPP_THROW(Exception(id));
-    data::RecordId ret = _idMap[id];
-    DBG << ret << " " << id << endl;
-    return ret;
-  }
-
-  std::string lookup( data::RecordId id_r )
-  {
-    if ( id_r == data::noRecordId )
-    {
-      return "";
-    }
-
-    if ( _reverseMap.find( id_r ) != _reverseMap.end() )
-    {
-      return _reverseMap[id_r];
-    }
-
-    WAR << "Lookup id " << id_r << "failed" << endl;
-    return std::string();
-  }
-
-  void logNew( const data::ResObject_Ptr & res_r, ResolvableTraits::KindType kind_r )
-  {
-    std::string shr( lookup( res_r->shareDataWith ) );
-    if ( ! shr.empty() )
-    {
-      DBG << "  SHR: " << shr << endl;
-    }
-    //DBG << "  SUM: " << res_r->summary << endl;
-    if ( 0&&kind_r == ResTraits<Package>::kind )
-    {
-      data::Package_Ptr p = dynamic_pointer_cast<data::Package>(res_r);
-      DBG << "  PKG: " << p << endl;
-      DBG << "  LOC: " << p->repositoryLocation << endl;
-    }
-    static unsigned n = 20;
-    if ( 0&&! --n )
-      throw;
-  }
-
-  public:
-
-  virtual data::RecordId consumePackage( const data::RecordId & repository_id, const data::Package_Ptr & res_r )
-  {
-    return newId( res_r, ResTraits<Package>::kind );
-  }
-
-  virtual data::RecordId consumeSourcePackage( const data::RecordId & repository_id, const data::SrcPackage_Ptr & res_r )
-  {
-    return newId( res_r, ResTraits<SrcPackage>::kind );
-  }
-
-  virtual data::RecordId consumeProduct      ( const data::RecordId & repository_id, const data::Product_Ptr & res_r )
-  {
-    return newId( res_r, ResTraits<Product>::kind );
-  }
-
-  virtual data::RecordId consumePatch        ( const data::RecordId & repository_id, const data::Patch_Ptr & res_r )
-  {
-    return newId( res_r, ResTraits<Patch>::kind );
-  }
-
-  virtual data::RecordId consumePackageAtom  ( const data::RecordId & repository_id, const data::PackageAtom_Ptr & res_r )
-  {
-    return newId( res_r, ResTraits<Atom>::kind );
-  }
-
-  virtual data::RecordId consumeMessage      ( const data::RecordId & repository_id, const data::Message_Ptr & res_r )
-  {
-    return newId( res_r, ResTraits<Message>::kind );
-  }
-
-  virtual data::RecordId consumeScript       ( const data::RecordId & repository_id, const data::Script_Ptr & res_r )
-  {
-    return newId( res_r, ResTraits<Script>::kind );
-  }
-
-  virtual data::RecordId consumePattern      ( const data::RecordId & repository_id, const data::Pattern_Ptr & res_r )
-  {
-    return newId( res_r, ResTraits<Pattern>::kind );
-  }
-
-  virtual data::RecordId consumeChangelog    ( const data::RecordId & repository_id, const data::Resolvable_Ptr &, const Changelog & )
-  { return data::RecordId(); }
-
-  virtual data::RecordId consumeFilelist     ( const data::RecordId & repository_id, const data::Resolvable_Ptr &, const data::Filenames & )
-  { return data::RecordId(); }
-
-  void updatePackageLang( const data::RecordId & resolvable_id,
-                         const data::Packagebase_Ptr & data_r )
-  {
-    SEC << lookup( resolvable_id ) << endl;
-    INT << "  " << data_r->summary.text() << endl;
-    INT << "  " << data_r->summary.text( Locale("en") ) << endl;
-    if ( data_r->licenseToConfirm.locales().size() )
-    {
-      INT << "  " << data_r->licenseToConfirm.text() << endl;
-      INT << "  " << data_r->licenseToConfirm.text( Locale("en") ) << endl;
-      INT << "  " << data_r->licenseToConfirm.locales() << endl;
-    }
- }
-};
 
 /******************************************************************
 **
index fd3466e..aaf6675 100644 (file)
@@ -44,8 +44,8 @@ namespace zypp
   //
   ///////////////////////////////////////////////////////////////////
 
-  std::string Product::category() const
-  { return pimpl().category(); }
+  std::string Product::type() const
+  { return pimpl().type(); }
 
   Label Product::vendor() const
   { return pimpl().vendor(); }
@@ -55,10 +55,10 @@ namespace zypp
 
   std::list<Url> Product::updateUrls() const
   { return pimpl().updateUrls(); }
-  
+
   std::list<Url> Product::extraUrls() const
   { return pimpl().extraUrls(); }
-  
+
   std::list<Url> Product::optionalUrls() const
   { return pimpl().optionalUrls(); }
 
index 8ed01bc..54c9748 100644 (file)
@@ -40,8 +40,11 @@ namespace zypp
     typedef TraitsType::constPtrType constPtr;
 
   public:
-    /** Get the product categoty (base, add-on) */
-    std::string category() const;
+    /** Get the product type (base, add-on) */
+    std::string type() const;
+    /** \deprecated Use \ref type. */
+    std::string category() const ZYPP_DEPRECATED
+    { return type(); }
 
     /** Get the vendor of the product */
     Label vendor() const;
@@ -49,25 +52,25 @@ namespace zypp
     /** The URL to download the release notes for this product */
     Url releaseNotesUrl() const;
 
-    /** 
+    /**
      * Online updates for the product.
-     * They are complementary, not alternatives. #163192 
+     * They are complementary, not alternatives. #163192
      */
     std::list<Url> updateUrls() const;
 
-    /** 
+    /**
      * Additional software for the product
      * They are complementary, not alternatives.
      */
     std::list<Url> extraUrls() const;
-    
-    /** 
+
+    /**
      * Optional software for the product
      * (for example. Non OSS repositories)
      * They are complementary, not alternatives.
      */
     std::list<Url> optionalUrls() const;
-    
+
     /** The product flags */
     std::list<std::string> flags() const;
 
index 2472c67..433fb04 100644 (file)
@@ -84,6 +84,7 @@ namespace zypp
     inline const Attribute & attrProductOptionalUrls()         { static Attribute a("Product","optionalUrls");         return a; }
     inline const Attribute & attrProductReleasenotesUrl()      { static Attribute a("Product","releasenotesUrl");      return a; }
     inline const Attribute & attrProductShortName()            { static Attribute a("Product","shortName");            return a; }
+    inline const Attribute & attrProductType()                 { static Attribute a("Product","type");                 return a; }
     inline const Attribute & attrProductUpdateUrls()           { static Attribute a("Product","updateUrls");           return a; }
     ///////////////////////////////////////////////////////////////////
     inline const Attribute & attrResObjectBuildTime()          { static Attribute a("ResObject","buildTime");                              return a; }
index 379ede6..7405662 100644 (file)
@@ -63,7 +63,7 @@ struct CacheStore::Impl
         MIL << "database " << (dbdir + "zypp.db") << " was just created" << endl;
       }
     }
-    
+
     try
     {
       con.open( (dbdir + "zypp.db").asString().c_str());
@@ -111,9 +111,9 @@ struct CacheStore::Impl
     append_hal_dependency_cmd.reset( new sqlite3_command( con, "insert into hal_capabilities ( resolvable_id, dependency_type, refers_kind, name, value, relation ) values ( :resolvable_id, :dependency_type, :refers_kind, :name, :value, :relation );" ));
 
     append_filesystem_dependency_cmd.reset( new sqlite3_command( con, "insert into filesystem_capabilities ( resolvable_id, dependency_type, refers_kind, name_id ) values ( :resolvable_id, :dependency_type, :refers_kind, :name_id );" ));
-    
+
     append_split_dependency_cmd.reset( new sqlite3_command( con, "insert into split_capabilities ( resolvable_id, dependency_type, refers_kind, name_id, file_id ) values ( :resolvable_id, :dependency_type, :refers_kind, :name_id, :file_id );" ));
-    
+
     append_other_dependency_cmd.reset( new sqlite3_command( con, "insert into other_capabilities ( resolvable_id, dependency_type, refers_kind, value ) values ( :resolvable_id, :dependency_type, :refers_kind, :value );" ));
 
     append_resolvable_cmd.reset( new sqlite3_command( con, "insert into resolvables ( name, version, release, epoch, arch, kind, shared_id, repository_id ) values ( :name, :version, :release, :epoch, :arch, :kind, :shared_id, :repository_id );" ));
@@ -420,6 +420,7 @@ RecordId CacheStore::consumeProduct( const data::RecordId & repository_id,
       NVRA( product->name, product->edition, product->arch ), product->deps );
   appendResObjectAttributes( id, product );
 
+  appendStringAttribute( id, attrProductType(), product->type );
   appendTranslatedStringAttribute( id, attrProductShortName(), product->shortName );
   appendTranslatedStringAttribute( id, attrProductLongName(), product->longName );
   appendStringContainerAttribute( id, attrProductFlags(), product->flags.begin(), product->flags.end() );
@@ -703,7 +704,7 @@ void CacheStore::appendSplitDependency( const data::RecordId &resolvable_id,
   //RecordId capability_id = appendDependencyEntry( resolvable_id, deptype, cap->refers() );
   RecordId name_id = lookupOrAppendName(cap->name());
   RecordId file_id = lookupOrAppendFile(cap->path());
-   
+
   _pimpl->append_split_dependency_cmd->bind( ":resolvable_id", resolvable_id );
   _pimpl->append_split_dependency_cmd->bind( ":dependency_type", lookupOrAppendType("deptype", deptype.asString()) );
   _pimpl->append_split_dependency_cmd->bind( ":refers_kind", lookupOrAppendType("kind", cap->refers().asString()) );
index 7fbede3..e0bcaae 100644 (file)
@@ -242,6 +242,9 @@ namespace data
       Product()
       {};
 
+      /** The product type (base, add-on) */
+      std::string type;
+
       /** Abbreviation like \c SLES10 */
       TranslatedText shortName;
       /** More verbose Name like <tt>Suse Linux Enterprise Server 10</tt>*/
index 76ca98a..b93228e 100644 (file)
@@ -20,8 +20,7 @@ namespace zypp
   namespace detail
   { /////////////////////////////////////////////////////////////////
 
-      /** Get the category of the product - addon or base*/
-      std::string ProductImplIf::category() const
+      std::string ProductImplIf::type() const
       { return std::string(); }
 
       Url ProductImplIf::releaseNotesUrl() const
@@ -29,10 +28,10 @@ namespace zypp
 
       std::list<Url> ProductImplIf::updateUrls() const
       { return std::list<Url>(); }
-      
+
       std::list<Url>  ProductImplIf::extraUrls() const
       { return std::list<Url>(); }
-      
+
       std::list<Url>  ProductImplIf::optionalUrls() const
       { return std::list<Url>(); }
 
index be90880..25b1687 100644 (file)
@@ -42,26 +42,26 @@ namespace zypp
       typedef Product ResType;
 
     public:
-      /** Get the category of the product - addon or base*/
-      virtual std::string category() const PURE_VIRTUAL;
+      /** Get the type of the product - addon or base*/
+      virtual std::string type() const PURE_VIRTUAL;
 
       virtual Url releaseNotesUrl() const PURE_VIRTUAL;
 
       virtual std::list<Url> updateUrls() const PURE_VIRTUAL;
-      
-      /** 
+
+      /**
        * Additional software for the product
        * They are complementary, not alternatives.
        */
       virtual std::list<Url> extraUrls() const  PURE_VIRTUAL;
-    
-      /** 
+
+      /**
        * Optional software for the product
        * (for example. Non OSS repositories)
        * They are complementary, not alternatives.
        */
       virtual std::list<Url> optionalUrls() const  PURE_VIRTUAL;
-      
+
       /** The product flags */
       virtual std::list<std::string> flags() const PURE_VIRTUAL;
 
index 8d94177..2594b42 100644 (file)
@@ -372,6 +372,10 @@ namespace zypp
          {
            _pimpl->product().shortName.setText( value, Locale(modifier) );
          }
+         else if ( key == "TYPE" )
+         {
+           _pimpl->product().type = value;
+         }
          else if ( key == "RELNOTESURL" )
          {
            for( std::string::size_type pos = value.find("%a");
index 7fa19e7..cad0c53 100644 (file)
@@ -41,8 +41,8 @@ namespace zypp
 
     /**
      * Callback provided to the XML reader.
-     * 
-     * \param  the xml reader object reading the file  
+     *
+     * \param  the xml reader object reading the file
      * \return true to tell the reader to continue, false to tell it to stop
      *
      * \see PrimaryFileReader::consumeNode(xml::Reader)
@@ -86,10 +86,10 @@ namespace zypp
   /*
    * xpath and multiplicity of processed nodes are included in the code
    * for convenience:
-   * 
+   *
    * // xpath: <xpath> (?|*|+)
-   * 
-   * if multiplicity is ommited, then the node has multiplicity 'one'. 
+   *
+   * if multiplicity is ommited, then the node has multiplicity 'one'.
    */
 
   // --------------------------------------------------------------------------
@@ -114,8 +114,8 @@ namespace zypp
       if (reader_r->name() == "name")
       {
         _product->name = reader_r.nodeText().asString();
-        // TODO what's this?
-        // _product->? = reader_r->getAttribute("type").asString();
+        // product type (base, add-on)
+        _product->type = reader_r->getAttribute("type").asString();
         return true;
       }
 
@@ -156,26 +156,26 @@ namespace zypp
         _product->description.setText(reader_r.nodeText().asString(), locale);
         return true;
       }
-      
+
       // xpath: /products/product/distribution-name (+)
       if (reader_r->name() == "distribution-name")
       {
         _product->distributionName = reader_r.nodeText().asString();
         return true;
       }
-      
+
       // xpath: /products/product/distribution-edition (+)
       if (reader_r->name() == "distribution-edition")
       {
         _product->distributionEdition = reader_r.nodeText().asString();
         return true;
       }
-      
+
       // xpath: /products/product/release-notes-url (+)
       if (reader_r->name() == "release-notes-url")
       {
         string value = reader_r.nodeText().asString();
-        
+
         for( std::string::size_type pos = value.find("%a");
             pos != std::string::npos;
             pos = value.find("%a") )
@@ -197,7 +197,7 @@ namespace zypp
       if (reader_r->name() == "update-url")
       {
         string value = reader_r.nodeText().asString();
-        
+
         try
         {
           _product->updateUrls.push_back(Url(value));
@@ -208,12 +208,12 @@ namespace zypp
         }
         return true;
       }
-    
+
       // xpath: /products/product/extra-url (*)
       if (reader_r->name() == "extra-url")
       {
         string value = reader_r.nodeText().asString();
-        
+
         try
         {
           _product->extraUrls.push_back(Url(value));
@@ -224,12 +224,12 @@ namespace zypp
         }
         return true;
       }
-          
+
       // xpath: /products/product/optional-url (*)
       if (reader_r->name() == "optional-url")
       {
         string value = reader_r.nodeText().asString();
-        
+
         try
         {
           _product->optionalUrls.push_back(Url(value));
index d1af5cd..f18dcc9 100644 (file)
@@ -100,18 +100,14 @@ Date ProductImpl::installtime() const
 // PRODUCT
 /////////////////////////////////////////
 
-std::string ProductImpl::category() const
+std::string ProductImpl::type() const
 {
-#warning DUBIOUS ATTRIBUTE
-  return "";
-  //return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrProductCategory() );
+  return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrProductType() );
 }
 
 Url ProductImpl::releaseNotesUrl() const
 {
-#warning DUBIOUS ATTRIBUTE
-  return Url();
-  //return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrProductReleaseNotesUrl() );
+  return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrProductReleasenotesUrl() );
 }
 
 std::list<Url> ProductImpl::updateUrls() const
index fc90546..aa248cf 100644 (file)
@@ -30,7 +30,7 @@ namespace cached
   public:
 
     ProductImpl( const data::RecordId &id, repo::cached::RepoImpl::Ptr repository_r );
-    
+
     virtual TranslatedText summary() const;
     virtual TranslatedText description() const;
     virtual TranslatedText insnotify() const;
@@ -41,9 +41,9 @@ namespace cached
     virtual bool installOnly() const;
     virtual Date buildtime() const;
     virtual Date installtime() const;
-        
+
     // PRODUCT
-    virtual std::string category() const;
+    virtual std::string type() const;
     virtual Url releaseNotesUrl() const;
     virtual std::list<Url> updateUrls() const;
     virtual std::list<Url> extraUrls() const ;
@@ -51,9 +51,9 @@ namespace cached
     virtual std::list<std::string> flags() const;
     virtual TranslatedText shortName() const;
     virtual std::string distributionName() const;
-    virtual Edition distributionEdition() const;   
+    virtual Edition distributionEdition() const;
     virtual Repository repository() const;
-    
+
   private:
     repo::cached::RepoImpl::Ptr _repository;
     data::RecordId _id;
index c3a9bc5..844d6e8 100644 (file)
@@ -100,9 +100,9 @@ Date ProductImpl::installtime() const
 
 ///////////////////////////////////////////
 
-std::string ProductImpl::category() const
+std::string ProductImpl::type() const
 {
-  return _category;
+  return _type;
 }
 
 Url ProductImpl::releaseNotesUrl() const
index c8de07f..398523c 100644 (file)
@@ -51,7 +51,7 @@ namespace zypp
         virtual Date buildtime() const;
         virtual Date installtime() const;
 
-        virtual std::string category() const;
+        virtual std::string type() const;
         virtual Url releaseNotesUrl() const;
         virtual std::list<Url> updateUrls() const;
         virtual std::list<Url> extraUrls() const;
@@ -75,7 +75,7 @@ namespace zypp
         Date _buildtime;
         Date _installtime;
 
-        std::string _category;
+        std::string _type;
         std::string _dist_name;
         Edition     _dist_version;
         std::string _base_product;
@@ -83,11 +83,11 @@ namespace zypp
         std::string _you_type;
         std::string _shortlabel;
         Url _release_notes_url;
-        
+
         std::list<Url> _update_urls;
         std::list<Url> _extra_urls;
         std::list<Url> _optional_urls;
-        
+
         std::string _default_base;
         std::list<std::string> _flags;
       };
index 2d07868..de79906 100644 (file)
@@ -1032,7 +1032,7 @@ XMLFilesBackend::createProduct( const zypp::parser::xmlstore::XMLProductData & p
     impl->_build_time = parsed.build_time;
     impl->_install_time = parsed.install_time;
 
-    impl->_category = parsed.type;
+    impl->_type = parsed.type;
     impl->_short_name = parsed.short_name;
     impl->_dist_name = parsed.dist_name;
     impl->_dist_version = parsed.dist_version;
index d15c23d..d58df1b 100644 (file)
@@ -333,7 +333,7 @@ string toXML( const Product::constPtr &obj )
 {
   stringstream out;
   out << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl;
-  out << "<product version=\"" << SERIALIZER_VERSION << "\" xmlns=\"http://www.novell.com/metadata/zypp/xml-store\" type=\"" << xml_escape(obj->category()) << "\">" << endl;
+  out << "<product version=\"" << SERIALIZER_VERSION << "\" xmlns=\"http://www.novell.com/metadata/zypp/xml-store\" type=\"" << xml_escape(obj->type()) << "\">" << endl;
   out << toXML(static_cast<Resolvable::constPtr>(obj)) << endl;
   #warning "FIXME description and displayname of products"
 
index 830e584..a63136e 100644 (file)
@@ -35,8 +35,8 @@ namespace zypp
     XMLProductImpl::~XMLProductImpl()
     {}
 
-    std::string XMLProductImpl::category() const
-    { return _category; }
+    std::string XMLProductImpl::type() const
+    { return _type; }
 
     TranslatedText XMLProductImpl::shortName() const
     { return _short_name; }
@@ -46,10 +46,10 @@ namespace zypp
 
     std::list<Url> XMLProductImpl::updateUrls() const
     { return _update_urls; }
-    
+
     std::list<Url> XMLProductImpl::extraUrls() const
     { return _extra_urls; }
-    
+
     std::list<Url> XMLProductImpl::optionalUrls() const
     { return _optional_urls; }
 
index 47e2ada..2c469cc 100644 (file)
@@ -48,8 +48,6 @@ namespace zypp
       { return _size; }
       virtual ByteCount downloadSize() const
       { return _downloadSize; }
-      virtual unsigned sourceMediaNr() const
-      { return 0; }
       virtual bool installOnly() const
       { return _install_only; }
       virtual Date buildtime() const
@@ -57,25 +55,25 @@ namespace zypp
       virtual Date installtime() const
       { return _install_time; }
 
-      virtual std::string category() const;
+      virtual std::string type() const;
       virtual TranslatedText shortName() const;
       virtual Url releaseNotesUrl() const;
-      
+
       virtual std::list<Url> updateUrls() const;
       virtual std::list<Url> extraUrls() const;
       virtual std::list<Url> optionalUrls() const;
-      
+
       virtual std::list<std::string> flags() const;
       virtual std::string distributionName() const;
       virtual Edition distributionEdition() const;
 
-      std::string _category;
+      std::string _type;
       Url _release_notes_url;
-      
+
       std::list<Url> _update_urls;
       std::list<Url> _extra_urls;
       std::list<Url> _optional_urls;
-      
+
       std::list<std::string> _flags;
 
       TranslatedText _summary;