Hello community, here is the log from the commit of package libzypp for openSUSE:Factory checked in at 2019-01-21 10:07:34 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libzypp (Old) and /work/SRC/openSUSE:Factory/.libzypp.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "libzypp" Mon Jan 21 10:07:34 2019 rev:410 rq:664613 version:17.11.0 Changes: -------- --- /work/SRC/openSUSE:Factory/libzypp/libzypp.changes 2018-12-19 13:49:04.539313224 +0100 +++ /work/SRC/openSUSE:Factory/.libzypp.new.28833/libzypp.changes 2019-01-21 10:07:38.850843328 +0100 @@ -1,0 +2,8 @@ +Fri Jan 11 10:24:33 CET 2019 - ma@suse.de + +- PoolItemBest: Optionally prefer not locked packages (for bsc#1113296) +- ui::Selectable: add `hasLocks` to indicate a partially locked + item (for bsc#1113296) +- version 17.11.0 (9) + +------------------------------------------------------------------- Old: ---- libzypp-17.10.3.tar.bz2 New: ---- libzypp-17.11.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libzypp.spec ++++++ --- /var/tmp/diff_new_pack.gz8Qrr/_old 2019-01-21 10:07:39.614842555 +0100 +++ /var/tmp/diff_new_pack.gz8Qrr/_new 2019-01-21 10:07:39.618842550 +0100 @@ -1,7 +1,7 @@ # # spec file for package libzypp # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: libzypp -Version: 17.10.3 +Version: 17.11.0 Release: 0 Url: https://github.com/openSUSE/libzypp Summary: Library for package, patch, pattern and product management ++++++ libzypp-17.10.3.tar.bz2 -> libzypp-17.11.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.10.3/VERSION.cmake new/libzypp-17.11.0/VERSION.cmake --- old/libzypp-17.10.3/VERSION.cmake 2018-12-18 14:02:11.000000000 +0100 +++ new/libzypp-17.11.0/VERSION.cmake 2019-01-11 10:28:34.000000000 +0100 @@ -60,9 +60,9 @@ # SET(LIBZYPP_MAJOR "17") SET(LIBZYPP_COMPATMINOR "9") -SET(LIBZYPP_MINOR "10") -SET(LIBZYPP_PATCH "3") +SET(LIBZYPP_MINOR "11") +SET(LIBZYPP_PATCH "0") # -# LAST RELEASED: 17.10.3 (9) +# LAST RELEASED: 17.11.0 (9) # (The number in parenthesis is LIBZYPP_COMPATMINOR) #======= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.10.3/package/libzypp.changes new/libzypp-17.11.0/package/libzypp.changes --- old/libzypp-17.10.3/package/libzypp.changes 2018-12-18 14:02:11.000000000 +0100 +++ new/libzypp-17.11.0/package/libzypp.changes 2019-01-11 10:28:34.000000000 +0100 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Fri Jan 11 10:24:33 CET 2019 - ma@suse.de + +- PoolItemBest: Optionally prefer not locked packages (for bsc#1113296) +- ui::Selectable: add `hasLocks` to indicate a partially locked + item (for bsc#1113296) +- version 17.11.0 (9) + +------------------------------------------------------------------- Tue Dec 18 14:01:19 CET 2018 - ma@suse.de - Simplify complex locks so zypper can display them (bsc#1112911) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.10.3/zypp/PoolItemBest.cc new/libzypp-17.11.0/zypp/PoolItemBest.cc --- old/libzypp-17.10.3/zypp/PoolItemBest.cc 2018-10-01 14:31:07.000000000 +0200 +++ new/libzypp-17.11.0/zypp/PoolItemBest.cc 2019-01-11 10:23:05.000000000 +0100 @@ -28,7 +28,12 @@ /** PoolItemBest implementation. */ struct PoolItemBest::Impl { + Impl( bool preferNotLocked_r ) + : _preferNotLocked { preferNotLocked_r } + {} + Container _container; + bool _preferNotLocked; private: friend Impl * rwcowClone<Impl>( const Impl * rhs ); @@ -44,8 +49,11 @@ // /////////////////////////////////////////////////////////////////// + void PoolItemBest::_ctor_init( bool preferNotLocked_r ) + { _dont_use_this_use_pimpl.reset( new RWCOW_pointer<Impl>(new Impl( preferNotLocked_r )) ); } + void PoolItemBest::_ctor_init() - { _dont_use_this_use_pimpl.reset( new RWCOW_pointer<Impl>(new Impl) ); } + { _ctor_init( /*preferNotLocked*/false ); } const PoolItemBest::Container & PoolItemBest::container() const { return pimpl()->_container; } @@ -53,8 +61,24 @@ void PoolItemBest::add( const PoolItem & pi_r ) { Container & container( pimpl()->_container ); + PoolItem & ccand( container[pi_r.satSolvable().ident()] ); - if ( ! ccand || ui::SelectableTraits::AVOrder()( pi_r, ccand ) ) + if ( ! ccand ) + ccand = pi_r; + else if ( pimpl()->_preferNotLocked ) + { + if ( ! pi_r.status().isLocked() ) + { + if ( ccand.status().isLocked() || ui::SelectableTraits::AVOrder()( pi_r, ccand ) ) + ccand = pi_r; + } + else if ( ccand.status().isLocked() ) + { + if ( ui::SelectableTraits::AVOrder()( pi_r, ccand ) ) + ccand = pi_r; + } + } + else if ( ui::SelectableTraits::AVOrder()( pi_r, ccand ) ) ccand = pi_r; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.10.3/zypp/PoolItemBest.h new/libzypp-17.11.0/zypp/PoolItemBest.h --- old/libzypp-17.10.3/zypp/PoolItemBest.h 2018-10-01 14:31:07.000000000 +0200 +++ new/libzypp-17.11.0/zypp/PoolItemBest.h 2019-01-11 10:23:05.000000000 +0100 @@ -39,6 +39,9 @@ * sorts the \ref ui::Selectable list of available objects, thus follows the * same rules the \ref resolver will apply. * + * Ctor argument \ref preferNotLocked causes locked packages to be considered + * less than not locked packages. + * * \code * PoolQuery q; * q.addAttribute(sat::SolvAttr::name, "lib*"); @@ -70,22 +73,26 @@ typedef MapKVIteratorTraits<Container>::Key_const_iterator ident_iterator; public: + /** Indicator argument for ctor: consider locked packages less than not locked packages. */ + static constexpr bool preferNotLocked = true; + + public: /** Default ctor. */ - PoolItemBest() - { _ctor_init(); } + PoolItemBest( bool preferNotLocked_r = false ) + { _ctor_init( preferNotLocked_r ); } /** Ctor feeding a \ref sat::Solvable. */ - PoolItemBest( sat::Solvable slv_r ) - { _ctor_init(); add( slv_r ); } + PoolItemBest( sat::Solvable slv_r, bool preferNotLocked_r = false ) + { _ctor_init( preferNotLocked_r ); add( slv_r ); } /** Ctor feeding a \ref PoolItem. */ - PoolItemBest( const PoolItem & pi_r ) - { _ctor_init(); add( pi_r ); } + PoolItemBest( const PoolItem & pi_r, bool preferNotLocked_r = false ) + { _ctor_init( preferNotLocked_r ); add( pi_r ); } /** Ctor feeding a range of \ref sat::Solvable or \ref PoolItem. */ template<class TIterator> - PoolItemBest( TIterator begin_r, TIterator end_r ) - { _ctor_init(); add( begin_r, end_r ); } + PoolItemBest( TIterator begin_r, TIterator end_r, bool preferNotLocked_r = false ) + { _ctor_init( preferNotLocked_r ); add( begin_r, end_r ); } public: /** Feed one \ref sat::Solvable. */ @@ -132,7 +139,8 @@ //@} private: - void _ctor_init(); + void _ctor_init( bool preferNotLocked_r ); + void _ctor_init(/*preferNotLocked = false*/); ///< bin.compat legacy const Container & container() const; private: /** Implementation */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.10.3/zypp/sat/detail/PoolImpl.cc new/libzypp-17.11.0/zypp/sat/detail/PoolImpl.cc --- old/libzypp-17.10.3/zypp/sat/detail/PoolImpl.cc 2018-11-19 16:01:31.000000000 +0100 +++ new/libzypp-17.11.0/zypp/sat/detail/PoolImpl.cc 2018-12-18 19:06:47.000000000 +0100 @@ -108,6 +108,10 @@ static void logSat( CPool *, void *data, int type, const char *logString ) { // "1234567890123456789012345678901234567890 + if ( 0 == strncmp( logString, "job: user installed", 19 ) ) + return; + if ( 0 == strncmp( logString, "job: multiversion", 17 ) ) + return; if ( 0 == strncmp( logString, " - no rule created", 19 ) ) return; if ( 0 == strncmp( logString, " next rules: 0 0", 19 ) ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.10.3/zypp/solver/detail/SATResolver.cc new/libzypp-17.11.0/zypp/solver/detail/SATResolver.cc --- old/libzypp-17.10.3/zypp/solver/detail/SATResolver.cc 2018-12-10 16:06:59.000000000 +0100 +++ new/libzypp-17.11.0/zypp/solver/detail/SATResolver.cc 2018-12-18 19:06:47.000000000 +0100 @@ -1397,18 +1397,22 @@ void SATResolver::setLocks() { + unsigned icnt = 0; + unsigned acnt = 0; + for (PoolItemList::const_iterator iter = _items_to_lock.begin(); iter != _items_to_lock.end(); ++iter) { sat::detail::SolvableIdType ident( (*iter)->satSolvable().id() ); if (iter->status().isInstalled()) { - MIL << "Lock installed item " << *iter << endl; + ++icnt; queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE ); queue_push( &(_jobQueue), ident ); } else { - MIL << "Lock NOT installed item " << *iter << endl; + ++acnt; queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE | MAYBE_CLEANDEPS ); queue_push( &(_jobQueue), ident ); } } + MIL << "Locked " << icnt << " installed items and " << acnt << " NOT installed items." << endl; /////////////////////////////////////////////////////////////////// // Weak locks: Ignore if an item with this name is already installed. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.10.3/zypp/ui/Selectable.cc new/libzypp-17.11.0/zypp/ui/Selectable.cc --- old/libzypp-17.10.3/zypp/ui/Selectable.cc 2018-10-01 14:31:07.000000000 +0200 +++ new/libzypp-17.11.0/zypp/ui/Selectable.cc 2018-12-19 17:14:56.000000000 +0100 @@ -223,6 +223,8 @@ void Selectable::setLicenceConfirmed( bool val_r ) { _pimpl->setLicenceConfirmed( val_r ); } + bool Selectable::hasLocks() const + { return _pimpl->hasLocks(); } Selectable::Fate Selectable::fate() const { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.10.3/zypp/ui/Selectable.h new/libzypp-17.11.0/zypp/ui/Selectable.h --- old/libzypp-17.10.3/zypp/ui/Selectable.h 2018-10-01 14:31:07.000000000 +0200 +++ new/libzypp-17.11.0/zypp/ui/Selectable.h 2018-12-19 17:14:56.000000000 +0100 @@ -437,10 +437,22 @@ bool unmodified() const { return fate() == UNMODIFIED; } - /** True if locked (subclass of unmodified). */ + /** True if locked (subclass of unmodified). + * The \ref locked status indicates that \b all installed and/or \b all available + * items are locked. So you can't remove and/or can't install any item. This + * is the common case. + * \see \ref hasLocks + */ bool locked() const { Status st( status() ); return( st == S_Protected || st == S_Taboo ); } + /** True if it includes locked items (don't mix this with the \ref locked status). + * This is also \c true for partially locked items, where only specific versions + * are locked. + * \see \ref locked + */ + bool hasLocks() const; + /** True if either to delete or to install */ bool toModify() const { return fate() != UNMODIFIED; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-17.10.3/zypp/ui/SelectableImpl.h new/libzypp-17.11.0/zypp/ui/SelectableImpl.h --- old/libzypp-17.10.3/zypp/ui/SelectableImpl.h 2018-10-01 14:31:07.000000000 +0200 +++ new/libzypp-17.11.0/zypp/ui/SelectableImpl.h 2018-12-19 17:14:56.000000000 +0100 @@ -353,6 +353,22 @@ void setLicenceConfirmed( bool val_r ) { if ( candidateObj() ) candidateObj().status().setLicenceConfirmed( val_r ); } + /** \copydoc Selectable::hasLocks()const */ + bool hasLocks() const + { + for ( const PoolItem & pi : available() ) + { + if ( pi.status().isLocked() ) + return true; + } + for ( const PoolItem & pi : installed() ) + { + if ( pi.status().isLocked() ) + return true; + } + return false; + } + private: PoolItem transactingInstalled() const {