Hello community, here is the log from the commit of package libzypp for openSUSE:Leap:15.2 checked in at 2020-03-27 16:43:13 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2/libzypp (Old) and /work/SRC/openSUSE:Leap:15.2/.libzypp.new.3160 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libzypp" Fri Mar 27 16:43:13 2020 rev:84 rq:787602 version:17.23.2 Changes: -------- --- /work/SRC/openSUSE:Leap:15.2/libzypp/libzypp.changes 2020-03-06 12:40:22.298724171 +0100 +++ /work/SRC/openSUSE:Leap:15.2/.libzypp.new.3160/libzypp.changes 2020-03-27 16:43:20.075764490 +0100 @@ -1,0 +2,8 @@ +Fri Mar 20 12:28:18 CET 2020 - [email protected] + +- RepoVariables: Add safe guard in case the caller does not own a + zypp instance. +- Enable c++17. Define libyzpp CXX_STANDARD in ZyppCommon.cmake. +- version 17.23.2 (22) + +------------------------------------------------------------------- Old: ---- libzypp-17.23.1.tar.bz2 New: ---- libzypp-17.23.2.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libzypp.spec ++++++ --- /var/tmp/diff_new_pack.poKTwB/_old 2020-03-27 16:43:21.359765245 +0100 +++ /var/tmp/diff_new_pack.poKTwB/_new 2020-03-27 16:43:21.387765261 +0100 @@ -25,7 +25,7 @@ %bcond_without mediabackend_tests Name: libzypp -Version: 17.23.1 +Version: 17.23.2 Release: 0 URL: https://github.com/openSUSE/libzypp Summary: Library for package, patch, pattern and product management @@ -51,7 +51,7 @@ # lsof is used for 'zypper ps': Recommends: lsof %endif -BuildRequires: cmake +BuildRequires: cmake >= 3.1 BuildRequires: openssl-devel BuildRequires: pkgconfig(libudev) %if 0%{?suse_version} >= 1330 @@ -64,7 +64,7 @@ %endif BuildRequires: dejagnu BuildRequires: doxygen -BuildRequires: gcc-c++ >= 4.6 +BuildRequires: gcc-c++ >= 7 BuildRequires: gettext-devel BuildRequires: graphviz BuildRequires: libxml2-devel ++++++ libzypp-17.23.1.tar.bz2 -> libzypp-17.23.2.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.23.1/CMakeLists.txt new/libzypp-17.23.2/CMakeLists.txt --- old/libzypp-17.23.1/CMakeLists.txt 2020-02-20 17:31:12.000000000 +0100 +++ new/libzypp-17.23.2/CMakeLists.txt 2020-03-20 11:33:49.000000000 +0100 @@ -1,9 +1,9 @@ +cmake_minimum_required(VERSION 3.1) PROJECT(LIBZYPP) SET( PACKAGE "libzypp" ) # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked SET( CMAKE_MODULE_PATH ${LIBZYPP_SOURCE_DIR}/cmake/modules ) - -cmake_minimum_required(VERSION 2.6) +INCLUDE(ZyppCommon) OPTION (ENABLE_BUILD_DOCS "Build documentation by default?" OFF) OPTION (ENABLE_BUILD_TRANS "Build translation files by default?" OFF) @@ -18,8 +18,6 @@ #-------------------------------------------------------------------------------- SET (have_system x) -set (CMAKE_CXX_STANDARD 14) - IF (DEBIAN) MESSAGE (STATUS "Building for Debian") SET (ENABLE_BUILD_DOCS ON) @@ -43,7 +41,6 @@ cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) -INCLUDE(ZyppCommon) find_package(FindPkgConfig) INCLUDE( ${LIBZYPP_SOURCE_DIR}/VERSION.cmake ) @@ -56,6 +53,7 @@ SET( VERSION "${LIBZYPP_MAJOR}.${LIBZYPP_MINOR}.${LIBZYPP_PATCH}" ) CONFIGURE_FILE ( zypp/APIConfig.h.in zypp/APIConfig.h ) +SET (CMAKE_CXX_STANDARD ${ZYPPCOMMON_CXX_STANDARD}) include(CheckCCompilerFlag) include(CheckCXXCompilerFlag) CHECK_C_COMPILER_FLAG("-Werror=format-security" CC_FORMAT_SECURITY) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.23.1/VERSION.cmake new/libzypp-17.23.2/VERSION.cmake --- old/libzypp-17.23.1/VERSION.cmake 2020-03-02 20:01:14.000000000 +0100 +++ new/libzypp-17.23.2/VERSION.cmake 2020-03-20 12:31:14.000000000 +0100 @@ -61,8 +61,8 @@ SET(LIBZYPP_MAJOR "17") SET(LIBZYPP_COMPATMINOR "22") SET(LIBZYPP_MINOR "23") -SET(LIBZYPP_PATCH "1") +SET(LIBZYPP_PATCH "2") # -# LAST RELEASED: 17.23.1 (22) +# LAST RELEASED: 17.23.2 (22) # (The number in parenthesis is LIBZYPP_COMPATMINOR) #======= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.23.1/cmake/modules/ZyppCommon.cmake new/libzypp-17.23.2/cmake/modules/ZyppCommon.cmake --- old/libzypp-17.23.1/cmake/modules/ZyppCommon.cmake 2018-10-01 14:31:07.000000000 +0200 +++ new/libzypp-17.23.2/cmake/modules/ZyppCommon.cmake 2020-03-20 11:33:49.000000000 +0100 @@ -57,10 +57,10 @@ # INCLUDES # #################################################################### +SET( ZYPPCOMMON_CXX_STANDARD 17 ) #SET (CMAKE_INCLUDE_DIRECTORIES_BEFORE ON) INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} SYSTEM ) - #################################################################### # RPM SPEC # #################################################################### diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.23.1/libzypp.spec.cmake new/libzypp-17.23.2/libzypp.spec.cmake --- old/libzypp-17.23.1/libzypp.spec.cmake 2020-02-20 17:31:12.000000000 +0100 +++ new/libzypp-17.23.2/libzypp.spec.cmake 2020-03-20 11:33:49.000000000 +0100 @@ -50,7 +50,7 @@ # lsof is used for 'zypper ps': Recommends: lsof %endif -BuildRequires: cmake +BuildRequires: cmake >= 3.1 BuildRequires: openssl-devel BuildRequires: pkgconfig(libudev) %if 0%{?suse_version} >= 1330 @@ -63,7 +63,7 @@ %endif BuildRequires: dejagnu BuildRequires: doxygen -BuildRequires: gcc-c++ >= 4.6 +BuildRequires: gcc-c++ >= 7 BuildRequires: gettext-devel BuildRequires: graphviz BuildRequires: libxml2-devel diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.23.1/package/libzypp.changes new/libzypp-17.23.2/package/libzypp.changes --- old/libzypp-17.23.1/package/libzypp.changes 2020-03-02 20:01:14.000000000 +0100 +++ new/libzypp-17.23.2/package/libzypp.changes 2020-03-20 12:31:14.000000000 +0100 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Fri Mar 20 12:28:18 CET 2020 - [email protected] + +- RepoVariables: Add safe guard in case the caller does not own a + zypp instance. +- Enable c++17. Define libyzpp CXX_STANDARD in ZyppCommon.cmake. +- version 17.23.2 (22) + +------------------------------------------------------------------- Mon Mar 2 19:53:51 CET 2020 - [email protected] - Fix package status computation regarding unneeded, orphaned, recommended diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.23.1/tools/zypp-NameReqPrv.cc new/libzypp-17.23.2/tools/zypp-NameReqPrv.cc --- old/libzypp-17.23.1/tools/zypp-NameReqPrv.cc 2019-11-21 18:11:10.000000000 +0100 +++ new/libzypp-17.23.2/tools/zypp-NameReqPrv.cc 2020-03-18 12:36:18.000000000 +0100 @@ -60,60 +60,96 @@ #define COL_WH "\033[1;37m" #define COL_OFF "\033[0m" -std::string colorId( sat::Solvable solv_r ) -{ - // return solv_r.asString(); - std::string ret; - if ( solv_r ) - { - static str::Format fmt { COL_B "%s" COL_OFF "-" COL_G "%s" COL_OFF ".%s" }; - ret = fmt % solv_r.name() % solv_r.edition() % solv_r.arch(); - } - else - { - ret = ( solv_r.id() == sat::detail::systemSolvableId ? "systemSolvable" : "noSolvable" ); - } - return ret; -} - -void tableOut( const std::string & s1 = std::string(), - const std::string & s2 = std::string(), - const std::string & s3 = std::string(), - const std::string & s4 = std::string(), - const std::string & s5 = std::string() ) -{ - message << " "; -#define TABEL(N) static unsigned w##N = 0; if ( ! s##N.empty() ) w##N = std::max( w##N, unsigned(s##N.size()) ); message << str::form( " %-*s ", w##N, s##N.c_str() ) -#define TABER(N) static unsigned w##N = 0; if ( ! s##N.empty() ) w##N = std::max( w##N, unsigned(s##N.size()) ); message << str::form( " %*s ", w##N, s##N.c_str() ) - TABER( 1 ); TABEL( 2 ); TABEL( 3 ); TABEL( 4 ); TABEL( 5 ); -#undef TABEL - message << endl; -} - struct PQSort { // std::less semantic - bool operator()( const PoolQuery::const_iterator & lhs, const PoolQuery::const_iterator & rhs ) const + bool operator()( const sat::Solvable & lhs, const sat::Solvable & rhs ) const { { - bool l = lhs->isSystem(); - bool r = rhs->isSystem(); + bool l = lhs.isSystem(); + bool r = rhs.isSystem(); if ( l != r ) return r; } { - std::string l( lhs->ident().asString() ); - std::string r( rhs->ident().asString() ); + IdString l { lhs.ident() }; + IdString r { rhs.ident() }; if ( l != r ) return l < r; } - return avo( PoolItem(*lhs), PoolItem(*rhs) ); - return lhs->id() > rhs->id(); + return avo( PoolItem(lhs), PoolItem(rhs) ); + return lhs.id() > rhs.id(); } ui::SelectableTraits::AVOrder avo; }; +struct Table +{ + void row( PoolQuery::const_iterator it_r ) + { + //smax( _maxSID, ); + smax( _maxNAME, it_r->ident().size() + it_r->edition().size() + it_r->arch().size() ); + smax( _maxREPO, it_r->repository().name().size(), it_r->repository().name() ); + //smax( _maxTIME, ); + //smax( _maxVEND, it_r->vendor().size() ); + + std::vector<std::string> & details { _map[*it_r] }; + for_( match, it_r.matchesBegin(), it_r.matchesEnd() ) { + details.push_back( match->inSolvAttr().asString().substr( 9, 3 )+": " +match->asString() ); + } + } + + std::ostream & dumpOn( std::ostream & str ) const + { + #define S " " + + #define fmtSID "%*d" + #define argSID _maxSID, slv.id() + + #define fmtNAME COL_B "%s" COL_OFF "-" COL_G "%s" COL_OFF ".%-*s" + #define argNAME slv.ident().c_str(), slv.edition().c_str(), _maxNAME-slv.ident().size()-slv.edition().size(), slv.arch().c_str() + + #define fmtREPO "(%2d)%-*s" + #define argREPO slv.repository().info().priority(), _maxREPO, slv.repository().name().c_str() + + #define fmtTIME "%10ld" + #define argTIME time_t( slv.isSystem() ? slv.installtime() : slv.buildtime() ) + + #define fmtVEND "%s" + #define argVEND slv.vendor().c_str() + + std::string dind( _maxSID + _maxNAME+2/*-.*/ + 2*strlen(S), ' ' ); + + for ( const auto & el : _map ) { + sat::Solvable slv { el.first }; + const char * tagCol = slv.isSystem() ? COL_M : ui::Selectable::get(slv)->identicalInstalled(PoolItem(slv)) ? COL_C : ""; + + str << str::form( "%s" fmtSID S fmtNAME S "%s" fmtREPO S fmtTIME S fmtVEND COL_OFF "\n", + tagCol, argSID, argNAME, tagCol, argREPO, argTIME, argVEND ); + + for ( const auto & d : el.second ) + str << dind << d << endl; + } + return str; + } + +private: + static void smax( unsigned & var_r, unsigned val_r, std::string_view n = {} ) + { if ( val_r > var_r ) var_r = val_r; } + +private: + unsigned _maxSID = 7; // size + indent + unsigned _maxNAME = 0; + unsigned _maxREPO = 0; + //unsigned _maxTIME = 10; + //unsigned _maxVEND = 0; + std::map<sat::Solvable, std::vector<std::string>, PQSort> _map; +}; + +inline std::ostream & operator<<( std::ostream & str, const Table & table_r ) +{ return table_r.dumpOn( str ); } + /////////////////////////////////////////////////////////////////// void dDump( const std::string & spec_r ) @@ -247,7 +283,6 @@ } } } - /////////////////////////////////////////////////////////////////// bool ignorecase ( true ); @@ -385,28 +420,14 @@ << (conflicts?'c':'_') << (obsoletes?'o':'_') << (recommends?'m':'_') << (supplements?'s':'_') << (enhacements?'e':'_') << "] {" << endl; - std::set<PoolQuery::const_iterator,PQSort> qsorted; + Table t; for_( it, q.begin(), q.end() ) - qsorted.insert( it ); - - for ( auto && it : qsorted ) { if ( it->isKind( ResKind::srcpackage ) && !withSrcPackages ) continue; - - tableOut( str::numstring( it->id() ), colorId(*it), - str::form( "(%d)%s", it->repository().info().priority(), it->repository().name().c_str() ), - str::numstring( PoolItem(*it)->buildtime() ) ); - tableOut( "", "", - it->vendor().asString() ); - if ( ! it.matchesEmpty() ) - { - for_( match, it.matchesBegin(), it.matchesEnd() ) - { - tableOut( "", "", match->inSolvAttr().asString().substr( 9, 3 )+": " +match->asString() ); - } - } + t.row( it ); } + message << t << endl; message << "}" << endl; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.23.1/zypp/Fetcher.cc new/libzypp-17.23.2/zypp/Fetcher.cc --- old/libzypp-17.23.1/zypp/Fetcher.cc 2018-10-01 14:31:07.000000000 +0200 +++ new/libzypp-17.23.2/zypp/Fetcher.cc 2020-03-06 13:46:13.000000000 +0100 @@ -55,7 +55,7 @@ /** std::set ordering (less semantic) */ struct SameFetcherIndex { - bool operator()( const FetcherIndex_Ptr & lhs, const FetcherIndex_Ptr & rhs ) + bool operator()( const FetcherIndex_Ptr & lhs, const FetcherIndex_Ptr & rhs ) const { if ( lhs == rhs ) return false; // incl. NULL == NULL diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.23.1/zypp/media/CredentialManager.cc new/libzypp-17.23.2/zypp/media/CredentialManager.cc --- old/libzypp-17.23.1/zypp/media/CredentialManager.cc 2018-10-01 14:31:07.000000000 +0200 +++ new/libzypp-17.23.2/zypp/media/CredentialManager.cc 2020-03-06 13:46:13.000000000 +0100 @@ -39,7 +39,7 @@ // ////////////////////////////////////////////////////////////////////// - bool AuthDataComparator::operator()( const AuthData_Ptr & lhs, const AuthData_Ptr & rhs ) + bool AuthDataComparator::operator()( const AuthData_Ptr & lhs, const AuthData_Ptr & rhs ) const { static const url::ViewOption vopt = url::ViewOption::DEFAULTS - url::ViewOption::WITH_USERNAME diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.23.1/zypp/media/CredentialManager.h new/libzypp-17.23.2/zypp/media/CredentialManager.h --- old/libzypp-17.23.1/zypp/media/CredentialManager.h 2019-07-31 12:41:19.000000000 +0200 +++ new/libzypp-17.23.2/zypp/media/CredentialManager.h 2020-03-06 13:46:13.000000000 +0100 @@ -48,7 +48,7 @@ // comparator for CredentialSet struct AuthDataComparator { - bool operator()(const AuthData_Ptr & lhs, const AuthData_Ptr & rhs); + bool operator()(const AuthData_Ptr & lhs, const AuthData_Ptr & rhs) const; }; ////////////////////////////////////////////////////////////////////// diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.23.1/zypp/repo/RepoVariables.cc new/libzypp-17.23.2/zypp/repo/RepoVariables.cc --- old/libzypp-17.23.1/zypp/repo/RepoVariables.cc 2019-01-23 12:46:24.000000000 +0100 +++ new/libzypp-17.23.2/zypp/repo/RepoVariables.cc 2020-03-18 08:21:09.000000000 +0100 @@ -400,6 +400,11 @@ private: const std::string * _lookup( const std::string & name_r ) { + // Safe guard in case the caller does not own a zypp instance. In this case + // getZYpp()->getTarget() in checkOverride would create a zypp instance which + // would clear the variables parsed so far. + auto guard { getZYpp() }; + if ( empty() ) // at init / after reset { // load user definitions from vars.d
