Imported Upstream version 14.33.0 22/94622/1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 1 Nov 2016 01:31:36 +0000 (10:31 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 1 Nov 2016 01:31:37 +0000 (10:31 +0900)
Change-Id: I92db7b03b53d3bfe712fed69dff7fce7a53a67ee
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
19 files changed:
VERSION.cmake
libzypp.spec.cmake
package/libzypp.changes
po/zypp-po.tar.bz2
tests/parser/ProductFileReader_test.cc
tests/parser/ProductFileReader_test.dat
zypp/Date.h
zypp/Product.cc
zypp/Product.h
zypp/SysContent.cc
zypp/Target.cc
zypp/Target.h
zypp/base/Xml.h
zypp/parser/ProductFileReader.cc
zypp/parser/ProductFileReader.h
zypp/sat/SolvAttr.cc
zypp/sat/SolvAttr.h
zypp/target/TargetImpl.cc
zypp/target/TargetImpl.h

index c9f9956..e16a013 100644 (file)
@@ -60,9 +60,9 @@
 #
 SET(LIBZYPP_MAJOR "14")
 SET(LIBZYPP_COMPATMINOR "30")
-SET(LIBZYPP_MINOR "32")
-SET(LIBZYPP_PATCH "2")
+SET(LIBZYPP_MINOR "33")
+SET(LIBZYPP_PATCH "0")
 #
-# LAST RELEASED: 14.32.2 (30)
+# LAST RELEASED: 14.33.0 (30)
 # (The number in parenthesis is LIBZYPP_COMPATMINOR)
 #=======
index fa02c1f..b40ef03 100644 (file)
@@ -75,7 +75,7 @@ BuildRequires:  pkgconfig
 BuildRequires:  pkg-config
 %endif
 
-BuildRequires:  libsolv-devel >= 0.6.6
+BuildRequires:  libsolv-devel >= 0.6.7
 %if 0%{?suse_version} >= 1100
 BuildRequires:  libsolv-tools
 %requires_eq    libsolv-tools
index b0cda61..8ae732b 100644 (file)
@@ -1,4 +1,15 @@
 -------------------------------------------------------------------
+Fri Dec 19 10:05:00 CET 2014 - ma@suse.de
+
+- Parse and offer productRegisterFlavor attribute (bnc#896224)
+- version 14.33.0 (30)
+
+-------------------------------------------------------------------
+Thu Dec 18 01:13:20 CET 2014 - ma@suse.de
+
+- Update zypp-po.tar.bz2
+
+-------------------------------------------------------------------
 Wed Dec 17 18:44:26 CET 2014 - ma@suse.de
 
 - Improve conflict message for locked packages (bnc#828631)
index 09d02d2..17e5589 100644 (file)
Binary files a/po/zypp-po.tar.bz2 and b/po/zypp-po.tar.bz2 differ
index 3904883..e2b7246 100644 (file)
@@ -19,6 +19,7 @@ BOOST_AUTO_TEST_CASE(basic)
   BOOST_CHECK_EQUAL( data.productline(), "" );
   BOOST_CHECK_EQUAL( data.registerTarget(), "sle-11-i586" );
   BOOST_CHECK_EQUAL( data.registerRelease(), "whatever" );
+  BOOST_CHECK_EQUAL( data.registerFlavor(), "module" );
   BOOST_CHECK_EQUAL( data.updaterepokey(), "A43242DKD" );
 
   BOOST_REQUIRE_EQUAL( data.upgrades().size(), 2 );
index 3fe0033..74d36c0 100644 (file)
@@ -39,6 +39,7 @@ This is the Server product of the SUSE Linux Enterprise edition. It is an altern
     <register>
         <target>sle-11-i586</target>
         <release>whatever</release>
+        <flavor>module</flavor>
     </register>
     <buildconfig>
         <!-- This section is needed to generate the installation media -->
index 0c6ca28..e002c2c 100644 (file)
@@ -61,7 +61,7 @@ namespace zypp
     : _date( date_r )
     {}
     /** Ctor taking time_t value as string. */
-    Date( const std::string & seconds_r );
+    explicit Date( const std::string & seconds_r );
 
     /**
      * Ctor from a \a date_str (in localtime) formatted using \a format.
index 61d3301..75def80 100644 (file)
@@ -238,6 +238,9 @@ namespace zypp
   std::string Product::registerRelease() const
   { return lookupStrAttribute( sat::SolvAttr::productRegisterRelease ); }
 
+  std::string Product::registerFlavor() const
+  { return lookupStrAttribute( sat::SolvAttr::productRegisterFlavor ); }
+  
   /////////////////////////////////////////////////////////////////
 
   Product::UrlList Product::urls( const std::string & key_r ) const
index 3cf5dd1..7c9bb3f 100644 (file)
@@ -132,6 +132,11 @@ namespace zypp
       */
     std::string registerRelease() const;
 
+    /** This is \c register.flavor attribute of a product.
+      * Used for registration.
+      */
+    std::string registerFlavor() const;
+
   public:
     /***/
     class UrlList;
index ee0f920..3e33bdc 100644 (file)
@@ -335,7 +335,7 @@ namespace zypp
 
         virtual void text( const Node & node_r )
         {
-          *_value = node_r.value().asString();
+          *_value = Date(node_r.value().asString());
         }
 
         Date *_value;
index 0f22236..26a22f8 100644 (file)
@@ -121,6 +121,11 @@ namespace zypp
   std::string Target::targetDistributionRelease( const Pathname & root_r )
   { return target::TargetImpl::targetDistributionRelease( root_r ); }
 
+  std::string Target::targetDistributionFlavor() const
+  { return _pimpl->targetDistributionFlavor(); }
+  std::string Target::targetDistributionFlavor( const Pathname & root_r )
+  { return target::TargetImpl::targetDistributionFlavor( root_r ); }
+
   Target::DistributionLabel Target::distributionLabel() const
   { return _pimpl->distributionLabel(); }
   Target::DistributionLabel Target::distributionLabel( const Pathname & root_r )
index 322e9e3..209c269 100644 (file)
@@ -153,6 +153,14 @@ namespace zypp
     /** \overload */
     static std::string targetDistributionRelease( const Pathname & root_r );
 
+    /** This is \c register.release attribute of the installed base product.
+     * Used for registration.
+     * \note don't mistake this for \ref distributionFlavor
+     */
+    std::string targetDistributionFlavor() const;
+    /** \overload */
+    static std::string targetDistributionFlavor( const Pathname & root_r );
+
     struct DistributionLabel { std::string shortName; std::string summary; };
     /** This is \c shortName and \c summary attribute of the installed base product.
      * Used e.g. for the bootloader menu.
@@ -175,6 +183,7 @@ namespace zypp
      * the last used one. It can be empty is the target has never
      * been loaded, as the value is not present in the system
      * but computer from a package provides
+     * \note don't mistake this for \ref targetDistributionFlavor
      */
     std::string distributionFlavor() const;
     /** \overload */
index 12cdf5e..717a9f3 100644 (file)
@@ -79,6 +79,8 @@ namespace zypp
     /// }                                                    // </node>
     /// \endcode
     ///
+    /// \note If the nodename is empty or starts with an \c !, a comment is written.
+    ///
     struct Node
     {
       NON_COPYABLE_BUT_MOVE( Node );
@@ -110,7 +112,9 @@ namespace zypp
       /** Dtor wrting end tag */
       ~Node()
       {
-       if ( ! _name.empty() )
+       if ( _name.empty() )
+         _out << "-->";
+       else
        {
          if ( _hasContent )
            _out << "</" << _name << ">";
@@ -125,7 +129,9 @@ namespace zypp
        if ( ! _hasContent )
        {
          _hasContent = true;
-         if ( ! _name.empty() )
+         if ( _name.empty() )
+           _out << "|";
+         else
            _out << ">";
        }
        return _out;
@@ -134,14 +140,19 @@ namespace zypp
     private:
       void printStart( const std::initializer_list<Attr> & attrs_r )
       {
-       if ( ! _name.empty() )
+       if ( _name.empty() || _name[0] == '!' )
        {
-         _out << "<" << _name;
-         for ( const auto & pair : attrs_r )
-           _out << " " << pair.first << "=\"" << xml::escape( pair.second ) << "\"";
-         if ( _hasContent )
-           _out << ">";
+         _out << "<!--" << _name;
+         _name.clear();
        }
+       else
+         _out << "<" << _name;
+
+       for ( const auto & pair : attrs_r )
+         _out << " " << pair.first << "=\"" << xml::escape( pair.second ) << "\"";
+
+       if ( ! _name.empty() && _hasContent )
+         _out << ">";
       }
     private:
       std::ostream & _out;
@@ -166,6 +177,20 @@ namespace zypp
 
   } // namespace xmlout
   ///////////////////////////////////////////////////////////////////
+
+  /// \name Default dumpAsXmlOn based on asString.
+  ///
+  //@{
+  template <class _Tp>
+  inline std::ostream & dumpAsXmlOn( std::ostream & str, const _Tp & obj, const std::string & name_r )
+  {
+    xmlout::Node guard( str, name_r, xmlout::Node::optionalContent );
+    const std::string & content( asString( obj ) );
+    if ( ! content.empty() ) *guard << content;
+    return str;
+  }
+  //@}
+  //
 } // namespace zypp
 ///////////////////////////////////////////////////////////////////
 #endif // ZYPP_BASE_XML_H
index b68d4cd..22cec00 100644 (file)
@@ -76,6 +76,7 @@ namespace zypp
       std::string _productline;
       std::string _registerTarget;
       std::string _registerRelease;
+      std::string _registerFlavor;
 
       std::string _updaterepokey;
 
@@ -97,6 +98,7 @@ namespace zypp
     std::string ProductFileData::productline()     const { return _pimpl->_productline; }
     std::string ProductFileData::registerTarget()  const { return _pimpl->_registerTarget; }
     std::string ProductFileData::registerRelease() const { return _pimpl->_registerRelease; }
+    std::string ProductFileData::registerFlavor()  const { return _pimpl->_registerFlavor; }
 
     std::string ProductFileData::updaterepokey() const { return _pimpl->_updaterepokey; }
 
@@ -157,6 +159,7 @@ namespace zypp
         (*this)["register"]
             ("target",        OPTIONAL,   xml::parseDefAssign( _pdata._registerTarget ) )
             ("release",       OPTIONAL,   xml::parseDefAssign( _pdata._registerRelease ) )
+            ("flavor",        OPTIONAL,   xml::parseDefAssign( _pdata._registerFlavor ) )
             ;
 
         (*this)["upgrades"]
index 6acd911..15b57c9 100644 (file)
@@ -61,6 +61,7 @@ namespace zypp
         std::string productline()     const;
         std::string registerTarget()  const;
         std::string registerRelease() const;
+        std::string registerFlavor()  const;
 
       public:
         std::string updaterepokey() const;
index 30b7659..0233959 100644 (file)
@@ -120,6 +120,7 @@ namespace sat
   const SolvAttr SolvAttr::productEndOfLife      ( PRODUCT_ENDOFLIFE );
   const SolvAttr SolvAttr::productRegisterTarget ( PRODUCT_REGISTER_TARGET );
   const SolvAttr SolvAttr::productRegisterRelease( PRODUCT_REGISTER_RELEASE );
+  const SolvAttr SolvAttr::productRegisterFlavor ( PRODUCT_REGISTER_FLAVOR );
   const SolvAttr SolvAttr::productUrl            ( PRODUCT_URL );
   const SolvAttr SolvAttr::productUrlType        ( PRODUCT_URL_TYPE );
   /** array of repoids, hopefully label s too */
index 9a6d67b..fed49d8 100644 (file)
@@ -149,6 +149,7 @@ namespace sat
       static const SolvAttr productEndOfLife;
       static const SolvAttr productRegisterTarget;
       static const SolvAttr productRegisterRelease;
+      static const SolvAttr productRegisterFlavor;
       static const SolvAttr productUrl;
       static const SolvAttr productUrlType;
       static const SolvAttr productUpdates;            // SUB-STRUCTURE:
index 5dd2459..43f7310 100644 (file)
@@ -1863,6 +1863,12 @@ namespace zypp
     std::string TargetImpl::targetDistributionRelease( const Pathname & root_r )
     { return baseproductdata( staticGuessRoot(root_r) ).registerRelease();}
 
+    std::string TargetImpl::targetDistributionFlavor() const
+    { return baseproductdata( _root ).registerFlavor(); }
+    // static version:
+    std::string TargetImpl::targetDistributionFlavor( const Pathname & root_r )
+    { return baseproductdata( staticGuessRoot(root_r) ).registerFlavor();}
+
     Target::DistributionLabel TargetImpl::distributionLabel() const
     {
       Target::DistributionLabel ret;
index 353370a..0b6c015 100644 (file)
@@ -175,6 +175,11 @@ namespace zypp
       /** \overload */
       static std::string targetDistributionRelease( const Pathname & root_r );
 
+      /** \copydoc Target::targetDistributionFlavor()*/
+      std::string targetDistributionFlavor() const;
+      /** \overload */
+      static std::string targetDistributionFlavor( const Pathname & root_r );
+
       /** \copydoc Target::distributionVersion()*/
       Target::DistributionLabel distributionLabel() const;
       /** \overload */