Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libzypp for openSUSE:Factory checked in at 2021-06-15 16:36:43 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libzypp (Old) and /work/SRC/openSUSE:Factory/.libzypp.new.32437 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libzypp" Tue Jun 15 16:36:43 2021 rev:444 rq:899076 version:17.27.0 Changes: -------- --- /work/SRC/openSUSE:Factory/libzypp/libzypp.changes 2021-06-04 22:43:05.739098307 +0200 +++ /work/SRC/openSUSE:Factory/.libzypp.new.32437/libzypp.changes 2021-06-15 16:36:47.289636454 +0200 @@ -1,0 +2,18 @@ +Thu Jun 10 17:34:14 CEST 2021 - m...@suse.de + +- Enhance XML output of repo GPG options (fixes openSUSE/zypper#390) + In addition to the effective values, add optional attributes + showing the raw values actually present in the .repo file. + (raw_gpgcheck, raw_repo_gpgcheck, raw_pkg_gpgcheck) +- Link all executables with -pie (bsc#1186447) +- Ship an empty /etc/zypp/needreboot per default (fixes #311, jsc#PM-2645) + If packages want to trigger the reboot-needed hiint upon installation + they may provide 'installhint(reboot-needed)'. + Builtin packages triggering the hint without the provides are + only kernel and kernel-firmware related. +- Add Solvable::isBlacklisted as superset of retracted and ptf + packages (bsc#1186503) +- Fix segv if ZYPP_FULLOG is set (fixes #317) +- version 17.27.0 (22) + +------------------------------------------------------------------- Old: ---- libzypp-17.26.0.tar.bz2 New: ---- libzypp-17.27.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libzypp.spec ++++++ --- /var/tmp/diff_new_pack.mJq2vc/_old 2021-06-15 16:36:47.821637375 +0200 +++ /var/tmp/diff_new_pack.mJq2vc/_new 2021-06-15 16:36:47.825637383 +0200 @@ -31,7 +31,7 @@ %bcond_without mediabackend_tests Name: libzypp -Version: 17.26.0 +Version: 17.27.0 Release: 0 URL: https://github.com/openSUSE/libzypp Summary: Library for package, patch, pattern and product management ++++++ libzypp-17.26.0.tar.bz2 -> libzypp-17.27.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.26.0/CMakeLists.txt new/libzypp-17.27.0/CMakeLists.txt --- old/libzypp-17.26.0/CMakeLists.txt 2020-09-18 14:44:07.000000000 +0200 +++ new/libzypp-17.27.0/CMakeLists.txt 2021-06-10 16:01:21.000000000 +0200 @@ -83,6 +83,8 @@ SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -rdynamic -Wl,-as-needed" ) endif() +SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie" ) + INCLUDE(CheckFunctionExists) CHECK_FUNCTION_EXISTS(pipe2 PIPE2_FOUND) IF(${PIPE2_FOUND}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.26.0/VERSION.cmake new/libzypp-17.27.0/VERSION.cmake --- old/libzypp-17.26.0/VERSION.cmake 2021-06-01 19:16:09.000000000 +0200 +++ new/libzypp-17.27.0/VERSION.cmake 2021-06-10 17:41:09.000000000 +0200 @@ -60,9 +60,9 @@ # SET(LIBZYPP_MAJOR "17") SET(LIBZYPP_COMPATMINOR "22") -SET(LIBZYPP_MINOR "26") +SET(LIBZYPP_MINOR "27") SET(LIBZYPP_PATCH "0") # -# LAST RELEASED: 17.26.0 (22) +# LAST RELEASED: 17.27.0 (22) # (The number in parenthesis is LIBZYPP_COMPATMINOR) #======= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.26.0/needreboot new/libzypp-17.27.0/needreboot --- old/libzypp-17.26.0/needreboot 2020-12-03 12:18:02.000000000 +0100 +++ new/libzypp-17.27.0/needreboot 2021-06-10 15:07:12.000000000 +0200 @@ -1,13 +1,14 @@ ## -## This file contains packages which will trigger the needreboot hint. +## This file may contain packages which will trigger the reboot-needed hint. ## So the user gets informed that the system should be rebooted after ## one of these packages was updated. ## -## This config file is maintained by libzypp unless you manually amend it. +## This config file is for the systems administartor. ## Additional configuration files can be placed in /etc/zypp/needreboot.d ## ## For packages the intended way would be to provide 'installhint(reboot-needed)' -## if the package wants to trigger the needreboot hint. +## if the package wants to trigger the needreboot hint. If the hint should be +## shown for packages not providing 'installhint(reboot-needed)', list them here. ## ## Format: Each line must contain either a 'PACKAGENAME' or 'provides:CAPABILITY' ## to include all packages providing a dependency match for 'CAPABILITY'. @@ -15,13 +16,5 @@ ## ## Example: ## provides:kernel -## glibc +## kernel-firmware ## -provides:kernel -dbus-1 -glibc -gnutls -kernel-firmware -libopenssl1_0_0 -libopenssl1_1 -systemd diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.26.0/package/libzypp.changes new/libzypp-17.27.0/package/libzypp.changes --- old/libzypp-17.26.0/package/libzypp.changes 2021-06-01 19:16:09.000000000 +0200 +++ new/libzypp-17.27.0/package/libzypp.changes 2021-06-10 17:41:09.000000000 +0200 @@ -1,4 +1,22 @@ ------------------------------------------------------------------- +Thu Jun 10 17:34:14 CEST 2021 - m...@suse.de + +- Enhance XML output of repo GPG options (fixes openSUSE/zypper#390) + In addition to the effective values, add optional attributes + showing the raw values actually present in the .repo file. + (raw_gpgcheck, raw_repo_gpgcheck, raw_pkg_gpgcheck) +- Link all executables with -pie (bsc#1186447) +- Ship an empty /etc/zypp/needreboot per default (fixes #311, jsc#PM-2645) + If packages want to trigger the reboot-needed hiint upon installation + they may provide 'installhint(reboot-needed)'. + Builtin packages triggering the hint without the provides are + only kernel and kernel-firmware related. +- Add Solvable::isBlacklisted as superset of retracted and ptf + packages (bsc#1186503) +- Fix segv if ZYPP_FULLOG is set (fixes #317) +- version 17.27.0 (22) + +------------------------------------------------------------------- Tue Jun 1 19:10:35 CEST 2021 - m...@suse.de - Work around download.o.o broken https redirects. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.26.0/po/ja.po new/libzypp-17.27.0/po/ja.po --- old/libzypp-17.26.0/po/ja.po 2021-05-09 05:01:27.000000000 +0200 +++ new/libzypp-17.27.0/po/ja.po 2021-06-07 13:01:12.000000000 +0200 @@ -11,7 +11,7 @@ "Project-Id-Version: zypp\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-04-30 14:04+0200\n" -"PO-Revision-Date: 2021-05-09 02:57+0000\n" +"PO-Revision-Date: 2021-06-07 11:00+0000\n" "Last-Translator: Yasuhiko Kamata <belphe...@belbel.or.jp>\n" "Language-Team: Japanese <https://l10n.opensuse.org/projects/libzypp/master/" "ja/>\n" @@ -20,7 +20,7 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.6.1\n" +"X-Generator: Weblate 4.6.2\n" #. dubious: Throw on malformed known types, otherwise log a warning. #: zypp/CheckSum.cc:136 @@ -3723,7 +3723,7 @@ #: zypp/ProblemSolution.cc:114 msgid "Following actions will be done:" -msgstr "?????????????????????????????????:" +msgstr "??????????????????????????????:" #. translators: an annotation to a gpg keys expiry date #: zypp/PublicKey.cc:63 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.26.0/tests/sat/BlacklistedPool/@System.repo new/libzypp-17.27.0/tests/sat/BlacklistedPool/@System.repo --- old/libzypp-17.26.0/tests/sat/BlacklistedPool/@System.repo 1970-01-01 01:00:00.000000000 +0100 +++ new/libzypp-17.27.0/tests/sat/BlacklistedPool/@System.repo 2021-06-10 12:26:16.000000000 +0200 @@ -0,0 +1,10 @@ +=Ver: 3.0 +# Retracted-patch-package() is not part of the installed package. +# It's injected into available pkgs by libsolv + +=Pkg: package 5 1 x86_64 ++Prv: +ptf() +ptf-package() +package = 5-1 +-Prv: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.26.0/tests/sat/BlacklistedPool/Repo.repo new/libzypp-17.27.0/tests/sat/BlacklistedPool/Repo.repo --- old/libzypp-17.26.0/tests/sat/BlacklistedPool/Repo.repo 1970-01-01 01:00:00.000000000 +0100 +++ new/libzypp-17.27.0/tests/sat/BlacklistedPool/Repo.repo 2021-06-10 12:26:16.000000000 +0200 @@ -0,0 +1,34 @@ +=Ver: 3.0 +# Retracted-patch-package() is not part of the installed package. +# It's injected into available pkgs by libsolv + +=Pkg: package 1 1 x86_64 ++Prv: +package = 1-1 +-Prv: + +=Pkg: package 2 1 x86_64 ++Prv: +retracted-patch-package() +package = 2-1 +-Prv: + +=Pkg: package 3 1 x86_64 ++Prv: +ptf() +package = 3-1 +-Prv: + +=Pkg: package 4 1 x86_64 ++Prv: +ptf-package() +package = 4-1 +-Prv: + +=Pkg: package 5 1 x86_64 ++Prv: +retracted-patch-package() +ptf() +ptf-package() +package = 5-1 +-Prv: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.26.0/tests/sat/BlacklistedPool/zypp-control.yaml new/libzypp-17.27.0/tests/sat/BlacklistedPool/zypp-control.yaml --- old/libzypp-17.26.0/tests/sat/BlacklistedPool/zypp-control.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/libzypp-17.27.0/tests/sat/BlacklistedPool/zypp-control.yaml 2021-06-10 12:26:16.000000000 +0200 @@ -0,0 +1,43 @@ +version: 1.0 +setup: + channels: + - alias: Repo + url: [] + path: "" + type: NONE + generated: 0 + outdated: 0 + priority: 99 + file: Repo.repo + - alias: "@System" + url: [] + path: "" + type: NONE + generated: 0 + outdated: 0 + priority: 99 + file: "@System.repo" + arch: x86_64 + locales: + [] + autoinst: + [] + modalias: + [] + multiversion: + [] + resolverFlags: + focus: Job + ignorealreadyrecommended: false + onlyRequires: false + forceResolve: false + cleandepsOnRemove: false + allowDowngrade: false + allowNameChange: false + allowArchChange: false + allowVendorChange: false + dupAllowDowngrade: false + dupAllowNameChange: false + dupAllowArchChange: false + dupAllowVendorChange: false +trials: [] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.26.0/tests/sat/Blacklisted_test.cc new/libzypp-17.27.0/tests/sat/Blacklisted_test.cc --- old/libzypp-17.26.0/tests/sat/Blacklisted_test.cc 1970-01-01 01:00:00.000000000 +0100 +++ new/libzypp-17.27.0/tests/sat/Blacklisted_test.cc 2021-06-10 12:26:16.000000000 +0200 @@ -0,0 +1,82 @@ +#include <boost/test/unit_test.hpp> +using boost::unit_test::test_case; + +#include <iostream> +#include <vector> +#include <string> +#include "TestSetup.h" +#include <zypp/base/LogTools.h> +using std::cin; +using std::cout; +using std::cerr; +using std::endl; +using namespace zypp; + +static TestSetup test( TestSetup::initLater ); +struct TestInit { + TestInit() { + test = TestSetup( Arch_x86_64 ); + } + ~TestInit() { test.reset(); } +}; +BOOST_GLOBAL_FIXTURE( TestInit ); + +void testcase_init() +{ + test.loadTestcaseRepos( TESTS_SRC_DIR"/sat/BlacklistedPool" ); +} + +std::string blacktag( const PoolItem & pi_r ) +{ + char buf[6]; + buf[0] = pi_r.isBlacklisted() ? 'B' : ' '; + buf[1] = pi_r.isRetracted() ? 'R' : ' '; + buf[2] = pi_r.isPtf() ? 'P' : ' '; + buf[3] = pi_r.isPtfMaster() ? 'm' : ' '; + buf[4] = pi_r.isPtfPackage() ? 'p' : ' '; + buf[5] = '\0'; + return buf; +} + +std::string blacktag( ui::Selectable::Ptr sel_r ) +{ + char buf[7]; + buf[0] = sel_r->hasBlacklisted() ? 'B' : ' '; + buf[1] = sel_r->hasBlacklistedInstalled() ? 'b' : ' '; + buf[2] = sel_r->hasRetracted() ? 'R' : ' '; + buf[3] = sel_r->hasRetractedInstalled() ? 'r' : ' '; + buf[4] = sel_r->hasPtf() ? 'P' : ' '; + buf[5] = sel_r->hasPtfInstalled() ? 'p' : ' '; + buf[6] = '\0'; + return buf; +} + +BOOST_AUTO_TEST_CASE(BlacklistedPool) +{ + testcase_init(); + ResPoolProxy poolProxy( test.poolProxy() ); + ui::Selectable::Ptr s( poolProxy.lookup( ResKind::package, "package" ) ); + BOOST_REQUIRE( s ); + + //cout << blacktag(s) << endl; + BOOST_CHECK_EQUAL( blacktag(s), "BbRrPp" ); + + std::vector<std::string> expect = { + "BRPmp" // I__s_(7)package-5-1.x86_64(@System) + ," " // U__s_(2)package-1-1.x86_64(Repo) + ,"BRPmp" // U__s_(6)package-5-1.x86_64(Repo) + ,"B P p" // U__s_(5)package-4-1.x86_64(Repo) + ,"B Pm " // U__s_(4)package-3-1.x86_64(Repo) + ,"BR " // U__s_(3)package-2-1.x86_64(Repo) + }; + unsigned idx = unsigned(-1); + for ( const auto & pi : s->installed() ) { + //cout << blacktag(pi) << " " << pi << endl; + BOOST_CHECK_EQUAL( blacktag(pi), expect[++idx] ); + } + for ( const auto & pi : s->available() ) { + //cout << blacktag(pi) << " " << pi << endl; + BOOST_CHECK_EQUAL( blacktag(pi), expect[++idx] ); + } +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.26.0/tests/sat/CMakeLists.txt new/libzypp-17.27.0/tests/sat/CMakeLists.txt --- old/libzypp-17.26.0/tests/sat/CMakeLists.txt 2018-11-19 16:01:30.000000000 +0100 +++ new/libzypp-17.27.0/tests/sat/CMakeLists.txt 2021-06-10 12:26:16.000000000 +0200 @@ -3,6 +3,7 @@ INCLUDE_DIRECTORIES( ${LIBZYPP_SOURCE_DIR}/tests/zypp ) ADD_TESTS( + Blacklisted IdString LookupAttr Pool diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.26.0/zypp/RepoInfo.cc new/libzypp-17.27.0/zypp/RepoInfo.cc --- old/libzypp-17.26.0/zypp/RepoInfo.cc 2021-02-10 15:19:44.000000000 +0100 +++ new/libzypp-17.27.0/zypp/RepoInfo.cc 2021-06-10 17:06:09.000000000 +0200 @@ -1001,6 +1001,13 @@ << " gpgcheck=\"" << gpgCheck() << "\"" << " repo_gpgcheck=\"" << repoGpgCheck() << "\"" << " pkg_gpgcheck=\"" << pkgGpgCheck() << "\""; + if ( ! indeterminate(_pimpl->rawGpgCheck()) ) + str << " raw_gpgcheck=\"" << (_pimpl->rawGpgCheck() ? "1" : "0") << "\""; + if ( ! indeterminate(_pimpl->rawRepoGpgCheck()) ) + str << " raw_repo_gpgcheck=\"" << (_pimpl->rawRepoGpgCheck() ? "1" : "0") << "\""; + if ( ! indeterminate(_pimpl->rawPkgGpgCheck()) ) + str << " raw_pkg_gpgcheck=\"" << (_pimpl->rawPkgGpgCheck() ? "1" : "0") << "\""; + if (!(tmpstr = gpgKeyUrl().asString()).empty()) if (!(tmpstr = gpgKeyUrl().asString()).empty()) str << " gpgkey=\"" << escape(tmpstr) << "\""; if (!(tmpstr = mirrorListUrl().asString()).empty()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.26.0/zypp/sat/Solvable.cc new/libzypp-17.27.0/zypp/sat/Solvable.cc --- old/libzypp-17.26.0/zypp/sat/Solvable.cc 2020-04-09 12:56:13.000000000 +0200 +++ new/libzypp-17.27.0/zypp/sat/Solvable.cc 2021-06-10 12:26:16.000000000 +0200 @@ -98,7 +98,8 @@ const Solvable Solvable::noSolvable; const IdString Solvable::retractedToken { "retracted-patch-package()" }; - const IdString Solvable::ptfToken { "ptf()" }; + const IdString Solvable::ptfMasterToken { "ptf()" }; + const IdString Solvable::ptfPackageToken { "ptf-package()" }; ///////////////////////////////////////////////////////////////// @@ -396,22 +397,36 @@ return myPool().isNeedreboot( *this ); } + // TODO: Optimize + bool Solvable::isBlacklisted() const + { return isPtf() || isRetracted(); } + bool Solvable::isRetracted() const { NO_SOLVABLE_RETURN( false ); if ( isKind<Package>() ) - return provides().contains( Capability( retractedToken.id() ) ); + return myPool().isRetracted( *this ); if ( isKind<Patch>() ) return lookupStrAttribute( SolvAttr::updateStatus ) == "retracted"; return false; } bool Solvable::isPtf() const + { return isPtfPackage() || isPtfMaster(); } + + bool Solvable::isPtfMaster() const { NO_SOLVABLE_RETURN( false ); - return provides().contains( Capability( ptfToken.id() ) ); + return myPool().isPtfMaster( *this ); } + bool Solvable::isPtfPackage() const + { + NO_SOLVABLE_RETURN( false ); + return myPool().isPtfPackage( *this ); + } + + bool Solvable::multiversionInstall() const { NO_SOLVABLE_RETURN( false ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.26.0/zypp/sat/Solvable.h new/libzypp-17.27.0/zypp/sat/Solvable.h --- old/libzypp-17.26.0/zypp/sat/Solvable.h 2020-04-03 17:01:13.000000000 +0200 +++ new/libzypp-17.27.0/zypp/sat/Solvable.h 2021-06-10 12:26:16.000000000 +0200 @@ -56,7 +56,8 @@ typedef sat::detail::SolvableIdType IdType; static const IdString retractedToken; ///< Indicator provides `retracted-patch-package()` - static const IdString ptfToken; ///< Indicator provides `ptf()` + static const IdString ptfMasterToken; ///< Indicator provides `ptf()` + static const IdString ptfPackageToken; ///< Indicator provides `ptf-package()` public: /** Default ctor creates \ref noSolvable.*/ @@ -147,12 +148,40 @@ /** Whether this solvable triggers the reboot-needed hint if installed/updated. */ bool isNeedreboot() const; + /** \name Blacklisted packages. + * + * Blacklisted packages are visible in a repository, but no matter how good they + * apparently look like, they must not be considered during normal operations. + * + * Under normal conditions the resolver will avoid selecting blacklisted packages. + * To install a blacklisted package it must be selected explicitly. Whether this + * is a good idea, depends on the reason for having been blacklisted: + * + * - RETRACTED packages are usually buggy packages/patches which have been released + * and can not be removed from the public repositories anymore. Nevertheless those + * packages should not be installed. + * + * - PTFs usually contain special features or fixes which are not yet released as + * an official patch upadate. Installing a PTF will prevent it's packages from being + * updated until you decide to remove the PTF and follow the official releases again. + */ + //@{ + /** Whether this solvable is blacklisted (retracted,ptf,...). */ + bool isBlacklisted() const; + /** Whether this solvable is retracted (provides \ref retractedToken). */ bool isRetracted() const; - /** Whether this solvable is a PTF (provides \ref ptfToken). */ + /** Whether this solvable belongs to a PTF (provides \ref ptfMasterToken or \ref ptfPackageToken). */ bool isPtf() const; + /** Subset of \ref isPtf (provides \ref ptfMasterToken). */ + bool isPtfMaster() const; + + /** Subset of \ref isPtf (provides \ref ptfPackageToken). */ + bool isPtfPackage() const; + //@} + /** The items build time. */ Date buildtime() const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.26.0/zypp/sat/SolvableSpec.cc new/libzypp-17.27.0/zypp/sat/SolvableSpec.cc --- old/libzypp-17.26.0/zypp/sat/SolvableSpec.cc 2020-04-03 17:01:13.000000000 +0200 +++ new/libzypp-17.27.0/zypp/sat/SolvableSpec.cc 2021-06-10 12:26:16.000000000 +0200 @@ -14,6 +14,7 @@ #include <zypp/base/IOStream.h> #include <zypp/sat/SolvableSpec.h> +#include <zypp/sat/SolvableSet.h> #include <zypp/sat/WhatProvides.h> using std::endl; @@ -43,6 +44,17 @@ setDirty(); } + bool addIdenticalInstalledToo() const + { return _addIdenticalInstalledToo; } + + void addIdenticalInstalledToo( bool yesno_r ) + { + if ( yesno_r != _addIdenticalInstalledToo ) { + _addIdenticalInstalledToo = yesno_r; + if ( not _provides.empty() ) + setDirty(); + } + } void parse( const C_Str & spec_r ) { @@ -60,19 +72,38 @@ { return needed() && !_cache; } void setDirty() const - { _cache.reset(); } + { _cache.reset(); _cacheIdenticalInstalled.clear(); } const WhatProvides & cache() const { if ( !_cache ) { _cache.reset( new WhatProvides( _provides ) ); + if ( _addIdenticalInstalledToo ) { + for ( const auto & solv : *_cache ) { + if ( solv.isSystem() ) + continue; + auto pi { ui::Selectable::get(solv)->identicalInstalledObj( PoolItem(solv) ) }; + if ( pi ) + _cacheIdenticalInstalled.insert( pi ); + } + } } return *_cache; } bool contains( const sat::Solvable & solv_r ) const - { return( _idents.count( solv_r.ident() ) || ( needed() && cache().contains( solv_r ) ) ); } + { + if ( _idents.count( solv_r.ident() ) ) + return true; + if ( needed() ) { + if ( cache().contains( solv_r ) ) + return true; + if ( _addIdenticalInstalledToo && _cacheIdenticalInstalled.contains( solv_r ) ) + return true; + } + return false; + } const IdStringSet & idents() const @@ -84,7 +115,8 @@ private: IdStringSet _idents; CapabilitySet _provides; - + bool _addIdenticalInstalledToo = false; + mutable SolvableSet _cacheIdenticalInstalled; // follows _cache mutable shared_ptr<WhatProvides> _cache; private: @@ -123,6 +155,11 @@ void SolvableSpec::addProvides( Capability provides_r ) { _pimpl->addProvides( provides_r ); } + bool SolvableSpec::addIdenticalInstalledToo() const + { return _pimpl->addIdenticalInstalledToo(); } + void SolvableSpec::addIdenticalInstalledToo( bool yesno_r ) + { _pimpl->addIdenticalInstalledToo( yesno_r ); } + void SolvableSpec::parse( const C_Str & spec_r ) { _pimpl->parse( spec_r ); } @@ -152,6 +189,9 @@ void SolvableSpec::setDirty() const { _pimpl->setDirty(); } + bool SolvableSpec::empty() const + { return _pimpl->idents().empty() && _pimpl->provides().empty(); } + bool SolvableSpec::containsIdent( const IdString & ident_r ) const { return _pimpl->idents().count( ident_r ); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.26.0/zypp/sat/SolvableSpec.h new/libzypp-17.27.0/zypp/sat/SolvableSpec.h --- old/libzypp-17.26.0/zypp/sat/SolvableSpec.h 2020-04-03 17:01:13.000000000 +0200 +++ new/libzypp-17.27.0/zypp/sat/SolvableSpec.h 2021-06-10 12:26:16.000000000 +0200 @@ -57,6 +57,13 @@ /** A all \ref sat::Solvable matching this \a provides_r. */ void addProvides( Capability provides_r ); + /** Extend the provides set to include idential installed items as well. + * Hack for retracted packages, where the indicator provides is injected + * into the available items, but is not present in the installed items. + */ + bool addIdenticalInstalledToo() const; + void addIdenticalInstalledToo( bool yesno_r ); + public: /** Parse and add spec from a string (`IDENT` or provides:CAPABILITY`). */ void parse( const C_Str & spec_r ); @@ -95,6 +102,9 @@ void setDirty() const; public: + /** Whether neither idents nor provides are set. */ + bool empty() const; + /** Whether \a ident_r has been added to the specs (mainly for parser tests). */ bool containsIdent( const IdString & ident_r ) const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.26.0/zypp/sat/SolvableType.h new/libzypp-17.27.0/zypp/sat/SolvableType.h --- old/libzypp-17.26.0/zypp/sat/SolvableType.h 2020-04-03 17:01:13.000000000 +0200 +++ new/libzypp-17.27.0/zypp/sat/SolvableType.h 2021-06-10 12:26:16.000000000 +0200 @@ -81,8 +81,12 @@ bool identIsAutoInstalled() const { return satSolvable().identIsAutoInstalled(); } bool multiversionInstall() const { return satSolvable().multiversionInstall(); } bool isNeedreboot() const { return satSolvable().isNeedreboot(); } + + bool isBlacklisted() const { return satSolvable().isBlacklisted(); } bool isRetracted() const { return satSolvable().isRetracted(); } bool isPtf() const { return satSolvable().isPtf(); } + bool isPtfMaster() const { return satSolvable().isPtfMaster(); } + bool isPtfPackage() const { return satSolvable().isPtfPackage(); } Date buildtime() const { return satSolvable().buildtime(); } Date installtime() const { return satSolvable().installtime(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.26.0/zypp/sat/detail/PoolImpl.cc new/libzypp-17.27.0/zypp/sat/detail/PoolImpl.cc --- old/libzypp-17.26.0/zypp/sat/detail/PoolImpl.cc 2020-09-18 12:21:05.000000000 +0200 +++ new/libzypp-17.27.0/zypp/sat/detail/PoolImpl.cc 2021-06-10 12:26:16.000000000 +0200 @@ -217,6 +217,13 @@ // set namespace callback _pool->nscallback = &nsCallback; _pool->nscallbackdata = (void*)this; + + // CAVEAT: We'd like to do it here, but in side the Pool ctor we can not + // yet use IdString types. We do in setDirty, when the 1st + // _retractedSpec.addProvides( Capability( Solvable::retractedToken.id() ) ); + // _ptfMasterSpec.addProvides( Capability( Solvable::ptfMasterToken.id() ) ); + // _ptfPackageSpec.addProvides( Capability( Solvable::ptfPackageToken.id() ) ); + _retractedSpec.addIdenticalInstalledToo( true ); // retracted indicator is not part of the package! } /////////////////////////////////////////////////////////////////// @@ -233,6 +240,13 @@ void PoolImpl::setDirty( const char * a1, const char * a2, const char * a3 ) { + if ( _retractedSpec.empty() ) { + // lazy init IdString types we can not use inside the ctor + _retractedSpec.addProvides( Capability( Solvable::retractedToken.id() ) ); + _ptfMasterSpec.addProvides( Capability( Solvable::ptfMasterToken.id() ) ); + _ptfPackageSpec.addProvides( Capability( Solvable::ptfPackageToken.id() ) ); + } + if ( a1 ) { if ( a3 ) MIL << a1 << " " << a2 << " " << a3 << endl; @@ -244,6 +258,10 @@ _multiversionListPtr.reset(); // re-evaluate ZConfig::multiversionSpec. _needrebootSpec.setDirty(); // re-evaluate needrebootSpec + _retractedSpec.setDirty(); // re-evaluate blacklisted spec + _ptfMasterSpec.setDirty(); // --"-- + _ptfPackageSpec.setDirty(); // --"-- + depSetDirty(); // invaldate dependency/namespace related indices } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.26.0/zypp/sat/detail/PoolImpl.h new/libzypp-17.27.0/zypp/sat/detail/PoolImpl.h --- old/libzypp-17.26.0/zypp/sat/detail/PoolImpl.h 2020-09-18 12:21:05.000000000 +0200 +++ new/libzypp-17.27.0/zypp/sat/detail/PoolImpl.h 2021-06-10 12:26:16.000000000 +0200 @@ -331,6 +331,17 @@ //@} public: + /** \name Blacklisted Solvables. */ + //@{ + bool isRetracted( const Solvable & solv_r ) const + { return _retractedSpec.contains( solv_r ); } + bool isPtfMaster( const Solvable & solv_r ) const + { return _ptfMasterSpec.contains( solv_r ); } + bool isPtfPackage( const Solvable & solv_r ) const + { return _ptfPackageSpec.contains( solv_r ); } + //@} + + public: /** accessor for etc/sysconfig/storage reading file on demand */ const std::set<std::string> & requiredFilesystems() const; @@ -362,6 +373,11 @@ /** Solvables which should trigger the reboot-needed hint if installed/updated. */ sat::SolvableSpec _needrebootSpec; + /** Blacklisted specs: */ + sat::SolvableSpec _retractedSpec; + sat::SolvableSpec _ptfMasterSpec; + sat::SolvableSpec _ptfPackageSpec; + /** filesystems mentioned in /etc/sysconfig/storage */ mutable scoped_ptr<std::set<std::string> > _requiredFilesystemsPtr; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.26.0/zypp/solver/detail/Resolver.cc new/libzypp-17.27.0/zypp/solver/detail/Resolver.cc --- old/libzypp-17.26.0/zypp/solver/detail/Resolver.cc 2020-07-03 15:42:02.000000000 +0200 +++ new/libzypp-17.27.0/zypp/solver/detail/Resolver.cc 2021-06-08 09:26:09.000000000 +0200 @@ -295,7 +295,7 @@ // Solving with libsolv static bool poolDumped = false; MIL << "-------------- Calling SAT Solver -------------------" << endl; - if ( getenv("ZYPP_FULLLOG") ) { + if ( getenv("ZYPP_FULLLOG") and get() ) { // libzypp/issues/317: get() to make sure a satsolver instance is actually present Testcase testcase("/var/log/YaST2/autoTestcase"); if (!poolDumped) { testcase.createTestcase (*this, true, false); // dump pool diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.26.0/zypp/solver/detail/SATResolver.cc new/libzypp-17.27.0/zypp/solver/detail/SATResolver.cc --- old/libzypp-17.26.0/zypp/solver/detail/SATResolver.cc 2021-06-01 14:26:09.000000000 +0200 +++ new/libzypp-17.27.0/zypp/solver/detail/SATResolver.cc 2021-06-10 12:26:16.000000000 +0200 @@ -707,7 +707,9 @@ queue_push( &(_jobQueue), SOLVER_BLACKLIST|SOLVER_SOLVABLE_PROVIDES ); queue_push( &(_jobQueue), sat::Solvable::retractedToken.id() ); queue_push( &(_jobQueue), SOLVER_BLACKLIST|SOLVER_SOLVABLE_PROVIDES ); - queue_push( &(_jobQueue), sat::Solvable::ptfToken.id() ); + queue_push( &(_jobQueue), sat::Solvable::ptfMasterToken.id() ); + queue_push( &(_jobQueue), SOLVER_BLACKLIST|SOLVER_SOLVABLE_PROVIDES ); + queue_push( &(_jobQueue), sat::Solvable::ptfPackageToken.id() ); } // Ad rules for changed requestedLocales diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.26.0/zypp/solver/detail/Testcase.cc new/libzypp-17.27.0/zypp/solver/detail/Testcase.cc --- old/libzypp-17.26.0/zypp/solver/detail/Testcase.cc 2020-10-27 18:06:46.000000000 +0100 +++ new/libzypp-17.27.0/zypp/solver/detail/Testcase.cc 2021-06-08 09:26:09.000000000 +0200 @@ -71,6 +71,12 @@ bool Testcase::createTestcase(Resolver & resolver, bool dumpPool, bool runSolver) { + // libzypp/issues/317: make sure a satsolver instance is actually present + if ( not resolver.get() ) { + WAR << "Can't createTestcase if the satsolver is not yet initialized." << endl; + return false; + } + MIL << "createTestcase at " << dumpPath << (dumpPool?" dumpPool":"") << (runSolver?" runSolver":"") << endl; PathInfo path (dumpPath); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.26.0/zypp/target/TargetImpl.cc new/libzypp-17.27.0/zypp/target/TargetImpl.cc --- old/libzypp-17.26.0/zypp/target/TargetImpl.cc 2021-02-24 17:11:46.000000000 +0100 +++ new/libzypp-17.27.0/zypp/target/TargetImpl.cc 2021-06-10 15:07:12.000000000 +0200 @@ -1191,6 +1191,8 @@ { sat::SolvableSpec needrebootSpec; needrebootSpec.addProvides( Capability("installhint(reboot-needed)") ); + needrebootSpec.addProvides( Capability("kernel") ); + needrebootSpec.addIdent( IdString("kernel-firmware") ); Pathname needrebootFile { Pathname::assertprefix( root(), ZConfig::instance().needrebootFile() ) }; if ( PathInfo( needrebootFile ).isFile() ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.26.0/zypp/ui/Selectable.cc new/libzypp-17.27.0/zypp/ui/Selectable.cc --- old/libzypp-17.26.0/zypp/ui/Selectable.cc 2020-04-03 17:01:13.000000000 +0200 +++ new/libzypp-17.27.0/zypp/ui/Selectable.cc 2021-06-10 12:26:16.000000000 +0200 @@ -172,12 +172,25 @@ //////////////////////////////////////////////////////////////////////// + bool Selectable::hasBlacklisted() const + { return _pimpl->hasBlacklisted(); } + + bool Selectable::hasBlacklistedInstalled() const + { return _pimpl->hasBlacklistedInstalled(); } + bool Selectable::hasRetracted() const { return _pimpl->hasRetracted(); } bool Selectable::hasRetractedInstalled() const { return _pimpl->hasRetractedInstalled(); } + bool Selectable::hasPtf() const + { return _pimpl->hasPtf(); } + + bool Selectable::hasPtfInstalled() const + { return _pimpl->hasPtfInstalled(); } + + bool Selectable::isUnmaintained() const { return _pimpl->isUnmaintained(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.26.0/zypp/ui/Selectable.h new/libzypp-17.27.0/zypp/ui/Selectable.h --- old/libzypp-17.26.0/zypp/ui/Selectable.h 2020-04-03 17:01:13.000000000 +0200 +++ new/libzypp-17.27.0/zypp/ui/Selectable.h 2021-06-10 12:26:16.000000000 +0200 @@ -125,7 +125,7 @@ /** The 'best' or 'most interesting' among all available objects. * One that is, or is likely to be, chosen for installation, unless * it violated any solver policy (see \ref updateCandidateObj). - * \note Might return a retracted item if explicitly set by \ref setCandidate + * \note Might return a blacklisted item if explicitly set by \ref setCandidate * or nothing else available. */ PoolItem candidateObj() const; @@ -134,7 +134,7 @@ * In contrary to \ref candidateObj, this may return no item even if * there are available objects. This simply means the \ref Repository * does not provide this object. - * \note Avoids to return retracted items. + * \note Avoids to return blacklisted items. */ PoolItem candidateObjFrom( Repository repo_r ) const; @@ -143,7 +143,7 @@ * there are available objects. This simply means the best object is * already installed, and all available objects violate at least one * update policy. - * \note Avoids to return retracted items. + * \note Avoids to return blacklisted items. */ PoolItem updateCandidateObj() const; @@ -151,7 +151,7 @@ * It's doubtful whether solely looking at the version makes a good * candidate, but apps ask for it. Beware that different vendors may * use different (uncomparable) version schemata. - * \note Avoids to return retracted items. + * \note Avoids to return blacklisted items. */ PoolItem highestAvailableVersionObj() const; @@ -326,11 +326,24 @@ bool hasCandidateObjOnly() const { return ( installedEmpty() ) && candidateObj(); } - /** True if this Selectable contains a retracted item. */ + + /** True if this Selectable contains available blacklisted items (retracted,ptf,...). */ + bool hasBlacklisted() const; + + /** True if this Selectable contains an installed blacklisted item (retracted,ptf,...). */ + bool hasBlacklistedInstalled() const; + + /** True if this Selectable contains available retracted items. */ bool hasRetracted() const; /** True if this Selectable contains an installed retracted item. */ bool hasRetractedInstalled() const; + + /** True if this Selectable contains available ptf items. */ + bool hasPtf() const; + + /** True if this Selectable contains an installed ptf item. */ + bool hasPtfInstalled() const; //@} /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.26.0/zypp/ui/SelectableImpl.h new/libzypp-17.27.0/zypp/ui/SelectableImpl.h --- old/libzypp-17.26.0/zypp/ui/SelectableImpl.h 2020-04-03 17:01:13.000000000 +0200 +++ new/libzypp-17.27.0/zypp/ui/SelectableImpl.h 2021-06-10 12:26:16.000000000 +0200 @@ -129,7 +129,7 @@ { for ( const PoolItem & pi : available() ) { - if ( pi.isRetracted() ) + if ( pi.isBlacklisted() ) continue; if ( pi.repository() == repo_r ) return pi; @@ -150,7 +150,7 @@ // multiversionInstall: This returns the candidate for the last // instance installed. Actually we'd need a list here. - if ( ! defaultCand || defaultCand.isRetracted() ) + if ( ! defaultCand || defaultCand.isBlacklisted() ) return PoolItem(); if ( installedEmpty() ) @@ -180,14 +180,14 @@ PoolItem highestAvailableVersionObj() const { PoolItem ret; - bool retractedOk = false; + bool blacklistedOk = false; for ( const PoolItem & pi : available() ) { - if ( !retractedOk && pi.isRetracted() ) + if ( !blacklistedOk && pi.isBlacklisted() ) { if ( ret ) break; // prefer a not retracted candidate - retractedOk = true; + blacklistedOk = true; } if ( !ret || pi.edition() > ret.edition() ) ret = pi; @@ -309,33 +309,61 @@ { return picklist().end(); } //////////////////////////////////////////////////////////////////////// + bool hasBlacklisted() const + { // Blacklisted items are sorted to the end of the available list. + return !_availableItems.empty() && _availableItems.rbegin()->isBlacklisted(); + } + + bool hasBlacklistedInstalled() const + { // Blacklisted items may be embedded in the installed list. + for ( const PoolItem & pi : installed() ) { + if ( pi.isBlacklisted() ) + return true; + } + return false; + } bool hasRetracted() const - { return !_availableItems.empty() && _availableItems.rbegin()->isRetracted(); } + { + for ( const PoolItem & pi : makeIterable( _availableItems.rbegin(), _availableItems.rend() ) ) { + if ( not pi.isBlacklisted() ) + break; + if ( pi.isRetracted() ) + return true; + } + return false; + } bool hasRetractedInstalled() const { - bool ret = false; - if ( hasRetracted() ) - { - for ( const PoolItem & ipi : installed() ) - { - PoolItem pi { identicalAvailableObj( ipi ) }; - if ( pi && pi.isRetracted() ) - { - ret = true; - break; - } - } + for ( const PoolItem & pi : installed() ) { + if ( pi.isRetracted() ) + return true; + } + return false; + } + + bool hasPtf() const + { + for ( const PoolItem & pi : makeIterable( _availableItems.rbegin(), _availableItems.rend() ) ) { + if ( not pi.isBlacklisted() ) + break; + if ( pi.isPtf() ) + return true; } - return ret; -// later if pool index is available: -// for ( const PoolItem & pi : installed() ) -// if ( pi.isRetracted() ) -// return true; -// return false; + return false; } + bool hasPtfInstalled() const + { + for ( const PoolItem & pi : installed() ) { + if ( pi.isPtf() ) + return true; + } + return false; + } + + bool isUnmaintained() const { return availableEmpty(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.26.0/zypp/ui/SelectableTraits.h new/libzypp-17.27.0/zypp/ui/SelectableTraits.h --- old/libzypp-17.26.0/zypp/ui/SelectableTraits.h 2020-04-03 17:01:13.000000000 +0200 +++ new/libzypp-17.27.0/zypp/ui/SelectableTraits.h 2021-06-10 12:26:16.000000000 +0200 @@ -34,7 +34,7 @@ struct SelectableTraits { /** Oder on AvailableItemSet. - * \li not retracted + * \li not blacklisted * \li repository priority * \li best Arch (arch/noarch changes are ok) * \li best Edition @@ -50,8 +50,8 @@ // bool operator()( const PoolItem & lhs, const PoolItem & rhs ) const { - if ( lhs.isRetracted() != rhs.isRetracted() ) - return rhs.isRetracted(); + if ( lhs.isBlacklisted() != rhs.isBlacklisted() ) + return rhs.isBlacklisted(); int lprio = lhs->satSolvable().repository().satInternalPriority(); int rprio = rhs->satSolvable().repository().satInternalPriority();