Imported Upstream version 15.20.0 91/94691/1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 1 Nov 2016 02:07:52 +0000 (11:07 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 1 Nov 2016 02:07:53 +0000 (11:07 +0900)
Change-Id: I10b31ca463415475581b8d05faeb374b48013a8e
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
18 files changed:
VERSION.cmake
package/libzypp.changes
po/sle-zypp-po.tar.bz2
po/zypp-po.tar.bz2
zypp/KeyRing.cc
zypp/Pathname.cc
zypp/PublicKey.cc
zypp/RepoManager.cc
zypp/ResPoolProxy.h
zypp/ZYppCallbacks.h
zypp/base/DefaultIntegral.h
zypp/base/String.h
zypp/base/Sysconfig.cc
zypp/media/MediaCurl.cc
zypp/media/MediaUserAuth.cc
zypp/sat/FileConflicts.cc
zypp/target/RpmPostTransCollector.cc
zypp/target/rpm/RpmDb.cc

index c3e7b79..22b69d4 100644 (file)
@@ -60,9 +60,9 @@
 #
 SET(LIBZYPP_MAJOR "15")
 SET(LIBZYPP_COMPATMINOR "19")
-SET(LIBZYPP_MINOR "19")
-SET(LIBZYPP_PATCH "7")
+SET(LIBZYPP_MINOR "20")
+SET(LIBZYPP_PATCH "0")
 #
-# LAST RELEASED: 15.19.7 (19)
+# LAST RELEASED: 15.20.0 (19)
 # (The number in parenthesis is LIBZYPP_COMPATMINOR)
 #=======
index d53b9fc..91fd20e 100644 (file)
@@ -1,4 +1,38 @@
 -------------------------------------------------------------------
+Fri Dec 11 19:07:09 CET 2015 - ma@suse.de
+
+- ResPoolProxy: make begin/end pairs Iterable
+- String: Format and FormatNAC classes based on boost::format
+- DefaultIntegral: provide initial value
+- More specific exception message if GPG binary is missing (bsc#637791)
+- version 15.20.0 (19)
+
+-------------------------------------------------------------------
+Thu Dec 10 01:14:50 CET 2015 - ma@suse.de
+
+- Update zypp-po.tar.bz2
+
+-------------------------------------------------------------------
+Thu Dec  3 01:13:11 CET 2015 - ma@suse.de
+
+- Update zypp-po.tar.bz2
+
+-------------------------------------------------------------------
+Sun Nov 22 01:13:29 CET 2015 - ma@suse.de
+
+- Update zypp-po.tar.bz2
+
+-------------------------------------------------------------------
+Thu Nov 19 01:16:03 CET 2015 - ma@suse.de
+
+- Update sle-zypp-po.tar.bz2
+
+-------------------------------------------------------------------
+Thu Nov 19 01:13:40 CET 2015 - ma@suse.de
+
+- Update zypp-po.tar.bz2
+
+-------------------------------------------------------------------
 Mon Nov 16 12:27:02 CET 2015 - ma@suse.de
 
 - createPot: Fix plural form detection (bsc#955053)
index 24c58bd..026d5be 100644 (file)
Binary files a/po/sle-zypp-po.tar.bz2 and b/po/sle-zypp-po.tar.bz2 differ
index 555a054..94d6616 100644 (file)
Binary files a/po/zypp-po.tar.bz2 and b/po/zypp-po.tar.bz2 differ
index 9c3f39b..d6b8246 100644 (file)
@@ -15,8 +15,6 @@
 #include <cstdio>
 #include <unistd.h>
 
-#include <boost/format.hpp>
-
 #include "zypp/TmpPath.h"
 #include "zypp/ZYppFactory.h"
 #include "zypp/ZYpp.h"
@@ -521,9 +519,9 @@ namespace zypp
   {
     if ( ! PathInfo( keyfile ).isExist() )
       // TranslatorExplanation first %s is key name, second is keyring name
-      ZYPP_THROW(KeyRingException(boost::str(boost::format(
-          _("Tried to import not existent key %s into keyring %s"))
-          % keyfile.asString() % keyring.asString())));
+      ZYPP_THROW(KeyRingException( str::Format(_("Tried to import not existent key %s into keyring %s"))
+                                  % keyfile.asString()
+                                  % keyring.asString() ));
 
     const char* argv[] =
     {
@@ -574,8 +572,7 @@ namespace zypp
   std::string KeyRing::Impl::readSignatureKeyId( const Pathname & signature )
   {
     if ( ! PathInfo( signature ).isFile() )
-      ZYPP_THROW(Exception(boost::str(boost::format(
-          _("Signature file %s not found"))% signature.asString())));
+      ZYPP_THROW(Exception( str::Format(_("Signature file %s not found")) % signature.asString() ));
 
     MIL << "Determining key id if signature " << signature << endl;
     // HACK create a tmp keyring with no keys
index 91656b9..0dbb04e 100644 (file)
@@ -73,7 +73,7 @@ namespace zypp
        }
       };
 
-      for ( auto ch : name_r )
+      for ( char ch : name_r )
       {
        switch ( ch )
        {
index 1cdb786..fa17b79 100644 (file)
@@ -378,12 +378,15 @@ namespace zypp
         {
          scanner.scan( line );
        }
-        prog.close();
+        int ret = prog.close();
 
        switch ( scanner._keys.size() )
        {
          case 0:
-           ZYPP_THROW( BadKeyException( "File " + _dataFile.path().asString() + " doesn't contain public key data" , _dataFile.path() ) );
+           if ( ret == 129 )
+             ZYPP_THROW( Exception( std::string("Can't read public key data: ") + GPG_BINARY + " is not installed!" ) );
+           else
+             ZYPP_THROW( BadKeyException( "File " + _dataFile.path().asString() + " doesn't contain public key data" , _dataFile.path() ) );
            break;
 
          case 1:
index f3da6a8..1947f15 100644 (file)
@@ -224,7 +224,7 @@ namespace zypp
       bool nonroot( geteuid() != 0 );
       if ( nonroot && ! PathInfo(dir).userMayRX() )
       {
-       JobReport::warning( formatNAC(_("Cannot read repo directory '%1%': Permission denied")) % dir );
+       JobReport::warning( str::FormatNAC(_("Cannot read repo directory '%1%': Permission denied")) % dir );
       }
       else
       {
@@ -242,7 +242,7 @@ namespace zypp
          {
            if ( nonroot && ! PathInfo(*it).userMayR() )
            {
-             JobReport::warning( formatNAC(_("Cannot read repo file '%1%': Permission denied")) % *it );
+             JobReport::warning( str::FormatNAC(_("Cannot read repo file '%1%': Permission denied")) % *it );
            }
            else
            {
@@ -770,13 +770,13 @@ namespace zypp
       // Cleanup orphanded service repos:
       if ( ! orphanedRepos.empty() )
       {
-       for ( auto & repoInfo : orphanedRepos )
+       for ( const auto & repoInfo : orphanedRepos )
        {
          MIL << "Delete orphaned service repo " << repoInfo.alias() << endl;
          // translators: Cleanup a repository previously owned by a meanwhile unknown (deleted) service.
          //   %1% = service name
          //   %2% = repository name
-         JobReport::warning( formatNAC(_("Unknown service '%1%': Removing orphaned service repository '%2%'" ))
+         JobReport::warning( str::FormatNAC(_("Unknown service '%1%': Removing orphaned service repository '%2%'"))
                              % repoInfo.service()
                              % repoInfo.alias() );
          try {
index c05ced5..94136ba 100644 (file)
@@ -118,6 +118,15 @@ namespace zypp
     template<class TRes>
       const_iterator byKindEnd() const
       { return byKindEnd( ResTraits<TRes>::kind ); }
+
+
+    Iterable<const_iterator> byKind( const ResKind & kind_r ) const
+      { return makeIterable( byKindBegin( kind_r ), byKindEnd( kind_r ) ); }
+
+    template<class TRes>
+      Iterable<const_iterator> byKind() const
+      { return makeIterable( byKindBegin<TRes>(), byKindEnd<TRes>() ); }
+
     //@}
 
  public:
@@ -129,6 +138,9 @@ namespace zypp
    repository_iterator knownRepositoriesBegin() const;
 
    repository_iterator knownRepositoriesEnd() const;
+
+   Iterable<repository_iterator> knownRepositories() const
+   { return makeIterable( knownRepositoriesBegin(), knownRepositoriesEnd() ); }
    //@}
 
   public:
index ad61d55..657fd58 100644 (file)
@@ -806,27 +806,27 @@ namespace zypp
     static callback::SendReport<JobReport> & instance();       // impl in ZYppImpl.cc
 
     /** send debug message text */
-    static bool debug( const MessageString & msg_r, const UserData & userData_r = UserData() )
+    static bool debug( const std::string & msg_r, const UserData & userData_r = UserData() )
     { return instance()->message( MsgType::debug, msg_r, userData_r ); }
 
     /** send message text */
-    static bool info( const MessageString & msg_r, const UserData & userData_r = UserData() )
+    static bool info( const std::string & msg_r, const UserData & userData_r = UserData() )
     { return instance()->message( MsgType::info, msg_r, userData_r ); }
 
     /** send warning text */
-    static bool warning( const MessageString & msg_r, const UserData & userData_r = UserData() )
+    static bool warning( const std::string & msg_r, const UserData & userData_r = UserData() )
     { return instance()->message( MsgType::warning, msg_r, userData_r ); }
 
     /** send error text */
-    static bool error( const MessageString & msg_r, const UserData & userData_r = UserData() )
+    static bool error( const std::string & msg_r, const UserData & userData_r = UserData() )
     { return instance()->message( MsgType::error, msg_r, userData_r ); }
 
     /** send important message text */
-    static bool important( const MessageString & msg_r, const UserData & userData_r = UserData() )
+    static bool important( const std::string & msg_r, const UserData & userData_r = UserData() )
     { return instance()->message( MsgType::important, msg_r, userData_r ); }
 
     /** send data message */
-    static bool data( const MessageString & msg_r, const UserData & userData_r = UserData() )
+    static bool data( const std::string & msg_r, const UserData & userData_r = UserData() )
     { return instance()->message( MsgType::data, msg_r, userData_r ); }
     //@}
   };
index 1dc8ac6..acf75bb 100644 (file)
@@ -57,6 +57,9 @@ namespace zypp
       operator Tp  () const { return get(); }
       //@}
 
+      /** The initial value. */
+      constexpr Tp initial() const { return TInitial; }
+
       /** Reset to the defined initial value. */
       DefaultIntegral & reset()        { _val = TInitial; return *this; }
 
index 9f02667..04ed542 100644 (file)
@@ -31,24 +31,6 @@ namespace zypp { typedef boost::logic::tribool TriBool; }
 ///////////////////////////////////////////////////////////////////
 
 ///////////////////////////////////////////////////////////////////
-namespace boost
-{
-  /** A formater with (N)o (A)rgument (C)heck.
-   * It won't complain about missing or excess arguments. Sometimes
-   * usefull when dealing with translations or classes providing a
-   * default formater.
-   */
-  inline format formatNAC( const std::string & string_r ) {
-    using namespace boost::io;
-    format fmter( string_r );
-    fmter.exceptions( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) );
-    return fmter;
-  }
-} // namespace boost
-namespace zypp { using boost::formatNAC; }
-///////////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////
 namespace zypp
 {
   /** Request a human readable (translated) string representation of Tp [Tp.asUserString()]
@@ -65,16 +47,6 @@ namespace zypp
 namespace zypp
 { /////////////////////////////////////////////////////////////////
 
-  struct MessageString : public std::string
-  {
-    MessageString() {}
-    MessageString( const char * str_r )                : std::string( str_r ? str_r : "" ) {}
-    MessageString( const std::string & str_r )         : std::string( str_r ) {}
-    // boost::format, std::ostringstream, str::Str ...
-    template<class TStr>
-    MessageString( const TStr & str_r )        : std::string( str_r.str() ) {}
-  };
-
   /** Convenience \c char* constructible from \c std::string and \c char*,
    *  it maps \c (char*)0 to an empty string.
    *
@@ -224,44 +196,98 @@ namespace zypp
     };
 
     ///////////////////////////////////////////////////////////////////
-    /** Convenient building of std::string via std::ostream::operator<<.
-     * Basically this is an \ref ostringstream which is autocenvertible
-     * into a \ref string.
-     * \code
-     *  void fnc( const std::string & txt_r );
-     *  fnc( str::Str() << "Hello " << 13 );
-     *
-     *  std::string txt( str::Str() << 45 );
-     * \endcode
-    */
+    /// \class Str
+    /// \brief Convenient building of std::string via \ref std::ostringstream
+    /// Basically a \ref std::ostringstream autoconvertible to \ref std::string
+    /// for building string arguments.
+    /// \code
+    ///   void fnc( const std::string & txt_r );
+    ///   fnc( str::Str() << "Hello " << 13 );
+    ///
+    ///   std::string txt( str::Str() << 45 );
+    /// \endcode
+    ///////////////////////////////////////////////////////////////////
     struct Str
     {
       template<class Tp>
-      Str & operator<<( const Tp & val )
-      { _str << val; return *this; }
+      Str & operator<<( Tp && val )
+      { _str << std::forward<Tp>(val); return *this; }
 
       Str & operator<<( std::ostream& (*iomanip)( std::ostream& ) )
       { _str << iomanip; return *this; }
 
-      operator std::string() const
-      { return _str.str(); }
+      operator std::string() const             { return _str.str(); }
+      std::string str() const                  { return _str.str(); }
 
-      std::string str() const
-      { return _str.str(); }
+      const std::ostream & stream() const      { return _str; }
+      std::ostream & stream()                  { return _str; }
 
-      std::ostream & stream()
-      { return _str; }
-
-      void clear()
-      { _str.str( std::string() ); }
+      void clear()                             { _str.str( std::string() ); }
 
+    private:
       std::ostringstream _str;
     };
 
+    /** \relates Str Stream output */
     inline std::ostream & operator<<( std::ostream & str, const Str & obj )
-    { return str << (std::string)obj; }
+    { return str << obj.str(); }
+
+    ///////////////////////////////////////////////////////////////////
+    /// \class Format
+    /// \brief Convenient building of std::string with \ref boost::format.
+    /// Basically a \ref boost::format autoconvertible to \ref std::string
+    /// for building string arguments.
+    /// \code
+    ///   void fnc( const std::string & txt_r );
+    ///   fnc( str::Format("Hello %1%") % 13 );
+    ///
+    ///   std::string txt( str::Format("Hello %1%") % 13 );
+    /// \endcode
+    ///////////////////////////////////////////////////////////////////
+    struct Format
+    {
+      Format() {}
+      Format( const std::string & format_r ) : _fmter( format_r ) {}
+
+      template<class Tp>
+      Format & operator%( Tp && arg )
+      { _fmter % std::forward<Tp>(arg); return *this; }
+
+      operator std::string() const             { return _fmter.str(); }
+      std::string asString() const             { return _fmter.str(); }
+      std::string str() const                  { return _fmter.str(); }
+
+      const boost::format & fmter() const      { return _fmter; }
+      boost::format & fmter()                  { return _fmter; }
+
+    protected:
+      boost::format _fmter;
+    };
+
+    /** \relates Format Stream output */
+    inline std::ostream & operator<<( std::ostream & str, const Format & obj )
+    { return str << obj.fmter(); }
 
     ///////////////////////////////////////////////////////////////////
+    /// \class FormatNAC
+    /// \brief \ref Format with (N)o (A)rgument (C)heck.
+    /// It won't complain about missing or excess arguments. Sometimes
+    /// usefull when dealing with translations or classes providing a
+    /// default formater.
+    ///////////////////////////////////////////////////////////////////
+    struct FormatNAC : public Format
+    {
+      FormatNAC() { relax(); }
+      FormatNAC( const std::string & format_r ) : Format( format_r ) { relax(); }
+
+    private:
+      void relax()
+      {
+       using namespace boost::io;
+       _fmter.exceptions( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) );
+      }
+    };
+    ///////////////////////////////////////////////////////////////////
     /** \name String representation of number.
      *
      * Optional second argument sets the minimal string width (' ' padded).
index 0d11ec4..c1c4786 100644 (file)
@@ -120,7 +120,7 @@ namespace zypp {
              std::vector<std::string> lines;
              str::split( newcomment_r, std::back_inserter(lines), "\r\n" );
              o << endl;
-             for ( auto line : lines )
+             for ( const std::string & line : lines )
              {
                if ( line[0] != '#' )
                  o << "# ";
index 7ed3f50..a1c636d 100644 (file)
@@ -37,7 +37,6 @@
 #include <errno.h>
 #include <dirent.h>
 #include <unistd.h>
-#include <boost/format.hpp>
 
 #define  DETECT_DIR_INDEX       0
 #define  CONNECT_TIMEOUT        60
@@ -1687,9 +1686,7 @@ bool MediaCurl::authenticate(const string & availAuthTypes, bool firstTry) const
     // indicate we have no good credentials from CM
     cmcred.reset();
 
-    string prompt_msg = boost::str(boost::format(
-      //!\todo add comma to the message for the next release
-      _("Authentication required for '%s'")) % _url.asString());
+    string prompt_msg = str::Format(_("Authentication required for '%s'")) % _url.asString();
 
     // set available authentication types from the exception
     // might be needed in prompt
index d599a71..047f303 100644 (file)
@@ -13,8 +13,6 @@
 #include <list>
 #include <curl/curl.h>
 
-#include <boost/format.hpp>
-
 #include "zypp/base/Gettext.h"
 #include "zypp/base/String.h"
 
@@ -132,10 +130,7 @@ long CurlAuthData::auth_type_str2long(std::string & auth_type_str)
     }
     else
     {
-      std::string msg = boost::str(
-        boost::format (_("Unsupported HTTP authentication method '%s'")) % *it);
-
-      ZYPP_THROW(MediaException(msg));
+      ZYPP_THROW(MediaException(str::Format(_("Unsupported HTTP authentication method '%s'")) % *it));
     }
   }
 
index 2bffaad..9ff56cc 100644 (file)
@@ -56,11 +56,10 @@ namespace zypp
                "  conflicts with file from install of\n"
                "     %3%" )
        }};
-       return( boost::formatNAC( text[lhsSolvable().isSystem()?0:1][rhsSolvable().isSystem()?0:1] )
-               % lhsFilename()
-               % lhsSolvable().asUserString()
-               % rhsSolvable().asUserString()
-             ).str();
+       return str::FormatNAC( text[lhsSolvable().isSystem()?0:1][rhsSolvable().isSystem()?0:1] )
+              % lhsFilename()
+              % lhsSolvable().asUserString()
+              % rhsSolvable().asUserString();
       }
       else
       {
@@ -99,12 +98,11 @@ namespace zypp
                "  from install of\n"
                "     %4%" )
        }};
-       return( boost::formatNAC( text[lhsSolvable().isSystem()?0:1][rhsSolvable().isSystem()?0:1] )
-               % lhsFilename()
-               % lhsSolvable().asUserString()
-               % rhsFilename()
-               % rhsSolvable().asUserString()
-             ).str();
+       return str::FormatNAC( text[lhsSolvable().isSystem()?0:1][rhsSolvable().isSystem()?0:1] )
+              % lhsFilename()
+              % lhsSolvable().asUserString()
+              % rhsFilename()
+              % rhsSolvable().asUserString();
       }
     }
 
@@ -114,20 +112,20 @@ namespace zypp
     std::ostream & operator<<( std::ostream & str, const FileConflicts::Conflict & obj )
     {
       if ( obj.lhsFilename() == obj.rhsFilename() )
-       return str << boost::format( "%s:\n    %s[%s]\n    %s[%s]" )
-                         % obj.lhsFilename()
-                         % obj.lhsSolvable()
-                         % obj.lhsFilemd5()
-                         % obj.rhsSolvable()
-                         % obj.rhsFilemd5();
+       return str << str::Format( "%s:\n    %s[%s]\n    %s[%s]" )
+                     % obj.lhsFilename()
+                     % obj.lhsSolvable()
+                     % obj.lhsFilemd5()
+                     % obj.rhsSolvable()
+                     % obj.rhsFilemd5();
 
-      return str << boost::format( "%s - %s:\n    %s[%s]\n    %s[%s]" )
-                       % obj.lhsFilename()
-                       % obj.rhsFilename()
-                       % obj.lhsSolvable()
-                       % obj.lhsFilemd5()
-                       % obj.rhsSolvable()
-                       % obj.rhsFilemd5();
+      return str << str::Format( "%s - %s:\n    %s[%s]\n    %s[%s]" )
+                   % obj.lhsFilename()
+                   % obj.rhsFilename()
+                   % obj.lhsSolvable()
+                   % obj.lhsFilemd5()
+                   % obj.rhsSolvable()
+                   % obj.rhsFilemd5();
     }
 
 
index 3014af9..bc57404 100644 (file)
@@ -83,7 +83,7 @@ namespace zypp
 
          Pathname noRootScriptDir( ZConfig::instance().update_scriptsPath() / tmpDir().basename() );
 
-         for ( auto && script : _scripts )
+         for ( const auto & script : _scripts )
          {
            MIL << "EXECUTE posttrans: " << script << endl;
             ExternalProgram prog( (noRootScriptDir/script).asString(), ExternalProgram::Stderr_To_Stdout, false, -1, true, _root );
@@ -132,7 +132,7 @@ namespace zypp
 
          str::Str msg;
          msg << "%posttrans scripts skipped while aborting:\n";
-         for ( auto && script : _scripts )
+         for ( const auto & script : _scripts )
          {
            const std::string & pkgident( script.substr( 0, script.size()-6 ) );        // strip tmp file suffix
            WAR << "UNEXECUTED posttrans: " << script << endl;
index 76fe7f6..4376eb4 100644 (file)
@@ -29,8 +29,6 @@ extern "C"
 #include <vector>
 #include <algorithm>
 
-#include <boost/format.hpp>
-
 #include "zypp/base/Logger.h"
 #include "zypp/base/String.h"
 #include "zypp/base/Gettext.h"
@@ -1123,9 +1121,9 @@ void RpmDb::importPubkey( const PublicKey & pubkey_r )
   if ( systemStatus() != 0 )
   {
     //TranslatorExplanation first %s is file name, second is error message
-    ZYPP_THROW(RpmSubprocessException(boost::str(boost::format(
-        _("Failed to import public key from file %s: %s"))
-        % pubkey_r.asString() % error_message)));
+    ZYPP_THROW(RpmSubprocessException( str::Format(_("Failed to import public key from file %s: %s"))
+                                      % pubkey_r.asString()
+                                      % error_message ));
   }
   else
   {
@@ -1194,9 +1192,9 @@ void RpmDb::removePubkey( const PublicKey & pubkey_r )
   if ( rpm_status != 0 )
   {
     //TranslatorExplanation first %s is key name, second is error message
-    ZYPP_THROW(RpmSubprocessException(boost::str(boost::format(
-        _("Failed to remove public key %s: %s")) % pubkey_r.asString()
-        % error_message)));
+    ZYPP_THROW(RpmSubprocessException( str::Format(_("Failed to remove public key %s: %s"))
+                                      % pubkey_r.asString()
+                                      % error_message ));
   }
   else
   {