#
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)
#=======
-------------------------------------------------------------------
+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)
#include <cstdio>
#include <unistd.h>
-#include <boost/format.hpp>
-
#include "zypp/TmpPath.h"
#include "zypp/ZYppFactory.h"
#include "zypp/ZYpp.h"
{
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[] =
{
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
}
};
- for ( auto ch : name_r )
+ for ( char ch : name_r )
{
switch ( ch )
{
{
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:
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
{
{
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
{
// 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 {
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:
repository_iterator knownRepositoriesBegin() const;
repository_iterator knownRepositoriesEnd() const;
+
+ Iterable<repository_iterator> knownRepositories() const
+ { return makeIterable( knownRepositoriesBegin(), knownRepositoriesEnd() ); }
//@}
public:
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 ); }
//@}
};
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; }
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
-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()]
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.
*
};
///////////////////////////////////////////////////////////////////
- /** 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).
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 << "# ";
#include <errno.h>
#include <dirent.h>
#include <unistd.h>
-#include <boost/format.hpp>
#define DETECT_DIR_INDEX 0
#define CONNECT_TIMEOUT 60
// 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
#include <list>
#include <curl/curl.h>
-#include <boost/format.hpp>
-
#include "zypp/base/Gettext.h"
#include "zypp/base/String.h"
}
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));
}
}
" 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
{
" 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();
}
}
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();
}
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 );
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;
#include <vector>
#include <algorithm>
-#include <boost/format.hpp>
-
#include "zypp/base/Logger.h"
#include "zypp/base/String.h"
#include "zypp/base/Gettext.h"
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
{
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
{