Hello community, here is the log from the commit of package libzypp for openSUSE:Factory checked in at 2017-06-04 01:49:14 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libzypp (Old) and /work/SRC/openSUSE:Factory/.libzypp.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libzypp" Sun Jun 4 01:49:14 2017 rev:381 rq:500420 version:16.12.0 Changes: -------- --- /work/SRC/openSUSE:Factory/libzypp/libzypp.changes 2017-05-20 10:08:43.461753686 +0200 +++ /work/SRC/openSUSE:Factory/.libzypp.new/libzypp.changes 2017-06-04 01:49:32.467409417 +0200 @@ -1,0 +2,6 @@ +Wed May 31 11:49:07 CEST 2017 - [email protected] + +- Testcase: add missing solver flags (bsc#1041889) +- version 16.12.0 (0) + +------------------------------------------------------------------- Old: ---- libzypp-16.11.0.tar.bz2 New: ---- libzypp-16.12.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libzypp.spec ++++++ --- /var/tmp/diff_new_pack.gCFWMF/_old 2017-06-04 01:49:33.499263627 +0200 +++ /var/tmp/diff_new_pack.gCFWMF/_new 2017-06-04 01:49:33.499263627 +0200 @@ -19,7 +19,7 @@ %define force_gcc_46 0 Name: libzypp -Version: 16.11.0 +Version: 16.12.0 Release: 0 Url: git://gitorious.org/opensuse/libzypp.git Summary: Package, Patch, Pattern, and Product Management ++++++ libzypp-16.11.0.tar.bz2 -> libzypp-16.12.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.11.0/VERSION.cmake new/libzypp-16.12.0/VERSION.cmake --- old/libzypp-16.11.0/VERSION.cmake 2017-05-12 11:41:09.000000000 +0200 +++ new/libzypp-16.12.0/VERSION.cmake 2017-05-31 11:51:08.000000000 +0200 @@ -60,9 +60,9 @@ # SET(LIBZYPP_MAJOR "16") SET(LIBZYPP_COMPATMINOR "0") -SET(LIBZYPP_MINOR "11") +SET(LIBZYPP_MINOR "12") SET(LIBZYPP_PATCH "0") # -# LAST RELEASED: 16.11.0 (0) +# LAST RELEASED: 16.12.0 (0) # (The number in parenthesis is LIBZYPP_COMPATMINOR) #======= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.11.0/package/libzypp.changes new/libzypp-16.12.0/package/libzypp.changes --- old/libzypp-16.11.0/package/libzypp.changes 2017-05-12 11:41:09.000000000 +0200 +++ new/libzypp-16.12.0/package/libzypp.changes 2017-05-31 11:51:08.000000000 +0200 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Wed May 31 11:49:07 CEST 2017 - [email protected] + +- Testcase: add missing solver flags (bsc#1041889) +- version 16.12.0 (0) + +------------------------------------------------------------------- Fri May 12 11:36:52 CEST 2017 - [email protected] - add identIsAutoInstalled convenience methods diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.11.0/tools/zypp-NameReqPrv.cc new/libzypp-16.12.0/tools/zypp-NameReqPrv.cc --- old/libzypp-16.11.0/tools/zypp-NameReqPrv.cc 2017-04-12 14:31:47.000000000 +0200 +++ new/libzypp-16.12.0/tools/zypp-NameReqPrv.cc 2017-05-17 10:51:10.000000000 +0200 @@ -5,6 +5,7 @@ #include <algorithm> #include <zypp/PoolQuery.h> #include <zypp/ResObjects.h> +#include <zypp/ui/SelectableTraits.h> static std::string appname( "NameReqPrv" ); @@ -63,6 +64,29 @@ message << endl; } +struct PQSort +{ + // std::less semantic + bool operator()( const PoolQuery::const_iterator & lhs, const PoolQuery::const_iterator & rhs ) const + { + { + 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() ); + if ( l != r ) + return l < r; + } + return avo( PoolItem(*lhs), PoolItem(*rhs) ); + return lhs->id() > rhs->id(); + } + + ui::SelectableTraits::AVOrder avo; +}; /////////////////////////////////////////////////////////////////// @@ -202,6 +226,7 @@ bool ignorecase ( true ); bool matechexact ( false ); + bool withSrcPackages ( false ); bool names ( true ); bool provides ( false ); bool requires ( false ); @@ -311,8 +336,15 @@ << (conflicts?'c':'_') << (obsoletes?'o':'_') << (recommends?'m':'_') << (supplements?'s':'_') << (enhacements?'e':'_') << "] {" << endl; + std::set<PoolQuery::const_iterator,PQSort> qsorted; 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() ), it->asString(), str::form( "(%d)%s", it->repository().info().priority(), it->repository().name().c_str() ), str::numstring( PoolItem(*it)->buildtime() ) ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.11.0/zypp/Resolver.cc new/libzypp-16.12.0/zypp/Resolver.cc --- old/libzypp-16.11.0/zypp/Resolver.cc 2017-04-21 16:26:10.000000000 +0200 +++ new/libzypp-16.12.0/zypp/Resolver.cc 2017-05-31 11:51:08.000000000 +0200 @@ -96,10 +96,6 @@ void Resolver::setUpdateMode( bool yesno_r ) { return _pimpl->setUpdateMode( yesno_r ); } bool Resolver::updateMode() const { return _pimpl->isUpdateMode(); } - void Resolver::setAllowVendorChange( bool yesno_r ) { _pimpl->setAllowVendorChange( yesno_r ); } - void Resolver::setDefaultAllowVendorChange() { _pimpl->setAllowVendorChange( indeterminate ); } - bool Resolver::allowVendorChange() const { return _pimpl->allowVendorChange(); } - void Resolver::setSystemVerification( bool yesno_r ) { _pimpl->setVerifyingMode( yesno_r ); } void Resolver::setDefaultSystemVerification() { _pimpl->setVerifyingMode( indeterminate ); } bool Resolver::systemVerification() const { return _pimpl->isVerifyingMode(); } @@ -120,6 +116,11 @@ ZOLV_FLAG_BOOL( ZSETTER , ZGETTER ) \ void Resolver::ZDEFAULT() { _pimpl->ZSETTER( indeterminate ); } \ + ZOLV_FLAG_TRIBOOL( setAllowDowngrade, setDefaultAllowDowngrade, allowDowngrade ) + ZOLV_FLAG_TRIBOOL( setAllowNameChange, setDefaultAllowNameChange, allowNameChange ) + ZOLV_FLAG_TRIBOOL( setAllowArchChange, setDefaultAllowArchChange, allowArchChange ) + ZOLV_FLAG_TRIBOOL( setAllowVendorChange, setDefaultAllowVendorChange, allowVendorChange ) + ZOLV_FLAG_TRIBOOL( dupSetAllowDowngrade, dupSetDefaultAllowDowngrade, dupAllowDowngrade ) ZOLV_FLAG_TRIBOOL( dupSetAllowNameChange, dupSetDefaultAllowNameChange, dupAllowNameChange ) ZOLV_FLAG_TRIBOOL( dupSetAllowArchChange, dupSetDefaultAllowArchChange, dupAllowArchChange ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.11.0/zypp/Resolver.h new/libzypp-16.12.0/zypp/Resolver.h --- old/libzypp-16.11.0/zypp/Resolver.h 2017-04-21 16:26:10.000000000 +0200 +++ new/libzypp-16.12.0/zypp/Resolver.h 2017-05-31 11:51:08.000000000 +0200 @@ -212,17 +212,33 @@ void setUpdateMode( bool yesno_r ); bool updateMode() const; - /** - * Setting whether the solver should allow or disallow vendor changes. - * - * If OFF (the default) the solver will replace packages with packages - * of the same (or equivalent) vendor ony. - * + + /** \name Solver flags (non DUP modes) + * Default for all flags is \c false unless overwritten by zypp.conf. + */ + //@{ + /** Whether to allow to downgrade installed solvable */ + void setAllowDowngrade( bool yesno_r ); + void setDefaultAllowDowngrade(); // Set back to default + bool allowDowngrade() const; + + /** Whether to allow to change name of installed solvable */ + void setAllowNameChange( bool yesno_r ); + void setDefaultAllowNameChange(); // Set back to default + bool allowNameChange() const; + + /** Whether to allow to change architecture of installed solvables */ + void setAllowArchChange( bool yesno_r ); + void setDefaultAllowArchChange(); // Set back to default + bool allowArchChange() const; + + /** Whether to allow to change vendor of installed solvables * \see \ref VendorAttr for definition of vendor equivalence. - **/ + */ void setAllowVendorChange( bool yesno_r ); - void setDefaultAllowVendorChange(); // set back to default (in zypp.conf) + void setDefaultAllowVendorChange(); // Set back to default bool allowVendorChange() const; + //@} /** * System verification mode also monitors and repairs dependencies @@ -256,7 +272,7 @@ /** \name Solver flags for DUP mode. * DUP mode default settings differ from 'ordinary' ones. Default for - * all DUP flags is \c true. + * all DUP flags is \c true unless overwritten by zypp.conf. */ //@{ /** dup mode: allow to downgrade installed solvable */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.11.0/zypp/solver/detail/Resolver.cc new/libzypp-16.12.0/zypp/solver/detail/Resolver.cc --- old/libzypp-16.11.0/zypp/solver/detail/Resolver.cc 2017-04-21 16:26:10.000000000 +0200 +++ new/libzypp-16.12.0/zypp/solver/detail/Resolver.cc 2017-05-31 16:36:13.000000000 +0200 @@ -66,12 +66,10 @@ { os << "<resolver>" << endl; #define OUTS(t) os << " " << #t << ":\t" << t << endl; - OUTS( _forceResolve ); OUTS( _upgradeMode ); OUTS( _updateMode ); OUTS( _verifying ); OUTS( _onlyRequires ); - OUTS( _allowVendorChange ); OUTS( _solveSrcPackages ); OUTS( _cleandepsOnRemove ); OUTS( _ignoreAlreadyRecommended ); @@ -86,12 +84,10 @@ : _pool(pool) , _satResolver(NULL) , _poolchanged(_pool.serial() ) - , _forceResolve (false) , _upgradeMode (false) , _updateMode (false) , _verifying (false) , _onlyRequires ( ZConfig::instance().solver_onlyRequires() ) - , _allowVendorChange ( ZConfig::instance().solver_allowVendorChange() ) , _solveSrcPackages ( false ) , _cleandepsOnRemove ( ZConfig::instance().solver_cleandepsOnRemove() ) , _ignoreAlreadyRecommended ( true ) @@ -115,6 +111,14 @@ bool Resolver::ZGETTER() const \ { return _satResolver->ZVARNAME; } \ +// NOTE: ZVARDEFAULT must be in sync with SATResolver ctor +ZOLV_FLAG_TRIBOOL( setForceResolve, forceResolve, _allowuninstall, false ) + +ZOLV_FLAG_TRIBOOL( setAllowDowngrade, allowDowngrade, _allowdowngrade, false ) +ZOLV_FLAG_TRIBOOL( setAllowNameChange, allowNameChange, _allownamechange, false ) +ZOLV_FLAG_TRIBOOL( setAllowArchChange, allowArchChange, _allowarchchange, false ) +ZOLV_FLAG_TRIBOOL( setAllowVendorChange, allowVendorChange, _allowvendorchange, ZConfig::instance().solver_allowVendorChange() ) + ZOLV_FLAG_TRIBOOL( dupSetAllowDowngrade, dupAllowDowngrade, _dup_allowdowngrade, ZConfig::instance().solver_dupAllowDowngrade() ) ZOLV_FLAG_TRIBOOL( dupSetAllowNameChange, dupAllowNameChange, _dup_allownamechange, ZConfig::instance().solver_dupAllowNameChange() ) ZOLV_FLAG_TRIBOOL( dupSetAllowArchChange, dupAllowArchChange, _dup_allowarchchange, ZConfig::instance().solver_dupAllowArchChange() ) @@ -123,11 +127,6 @@ #undef ZOLV_FLAG_TRIBOOL //--------------------------------------------------------------------------- -void Resolver::setAllowVendorChange( TriBool state_r ) -{ - _allowVendorChange = indeterminate(state_r) ? ZConfig::instance().solver_allowVendorChange() : bool(state_r); -} - void Resolver::setOnlyRequires( TriBool state_r ) { _onlyRequires = indeterminate(state_r) ? ZConfig::instance().solver_onlyRequires() : bool(state_r); @@ -308,13 +307,7 @@ _satResolver->setFixsystem ( isVerifyingMode() ); _satResolver->setIgnorealreadyrecommended ( ignoreAlreadyRecommended() ); _satResolver->setOnlyRequires ( onlyRequires() ); - _satResolver->setAllowdowngrade (false); - _satResolver->setAllowarchchange (false); - _satResolver->setAllowvendorchange ( allowVendorChange() ); - _satResolver->setAllowuninstall ( forceResolve() ); _satResolver->setUpdatesystem (_updateMode); - _satResolver->setNoupdateprovide (false); - _satResolver->setDosplitprovides (true); _satResolver->setSolveSrcPackages ( solveSrcPackages() ); _satResolver->setCleandepsOnRemove ( cleandepsOnRemove() ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.11.0/zypp/solver/detail/Resolver.h new/libzypp-16.12.0/zypp/solver/detail/Resolver.h --- old/libzypp-16.11.0/zypp/solver/detail/Resolver.h 2017-04-21 16:26:10.000000000 +0200 +++ new/libzypp-16.12.0/zypp/solver/detail/Resolver.h 2017-05-31 16:36:13.000000000 +0200 @@ -85,16 +85,12 @@ /** \name Solver flags */ //@{ - bool _forceResolve; // remove items which are conflicts with others or - // have unfulfilled requirements. - // This behaviour is favourited by ZMD bool _upgradeMode; // Resolver has been called with doUpgrade bool _updateMode; // Resolver has been called with doUpdate bool _verifying; // The system will be checked bool _onlyRequires; // do install required resolvables only // no recommended resolvables, language // packages, hardware packages (modalias) - bool _allowVendorChange; // whether the solver should allow or disallow vendor changes. bool _solveSrcPackages; // whether to generate solver jobs for selected source packges. bool _cleandepsOnRemove; // whether removing a package should also remove no longer needed requirements @@ -174,9 +170,6 @@ bool onlyRequires () const { return _onlyRequires; } void setOnlyRequires( TriBool state_r ); - bool forceResolve() const { return _forceResolve; } - void setForceResolve( TriBool state_r ) { _forceResolve = indeterminate(state_r) ? false : bool(state_r); } - bool isUpgradeMode() const { return _upgradeMode; }// Resolver has been called with doUpgrade void setUpgradeMode( bool yesno_r ) { _upgradeMode = yesno_r; } @@ -186,9 +179,6 @@ bool isVerifyingMode() const { return _verifying; } // The system will be checked void setVerifyingMode( TriBool state_r ) { _verifying = indeterminate(state_r) ? false : bool(state_r); } - bool allowVendorChange() const { return _allowVendorChange; } - void setAllowVendorChange( TriBool state_r ); - bool solveSrcPackages() const { return _solveSrcPackages; } void setSolveSrcPackages( TriBool state_r ) { _solveSrcPackages = indeterminate(state_r) ? false : bool(state_r); } @@ -200,6 +190,13 @@ void ZSETTER( TriBool state_r ); \ bool ZGETTER() const; \ + ZOLV_FLAG_TRIBOOL( setForceResolve, forceResolve ) + + ZOLV_FLAG_TRIBOOL( setAllowDowngrade, allowDowngrade ) + ZOLV_FLAG_TRIBOOL( setAllowNameChange, allowNameChange ) + ZOLV_FLAG_TRIBOOL( setAllowArchChange, allowArchChange ) + ZOLV_FLAG_TRIBOOL( setAllowVendorChange, allowVendorChange ) + ZOLV_FLAG_TRIBOOL( dupSetAllowDowngrade, dupAllowDowngrade ) ZOLV_FLAG_TRIBOOL( dupSetAllowNameChange, dupAllowNameChange ) ZOLV_FLAG_TRIBOOL( dupSetAllowArchChange, dupAllowArchChange ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.11.0/zypp/solver/detail/SATResolver.cc new/libzypp-16.12.0/zypp/solver/detail/SATResolver.cc --- old/libzypp-16.11.0/zypp/solver/detail/SATResolver.cc 2016-11-29 11:31:52.000000000 +0100 +++ new/libzypp-16.12.0/zypp/solver/detail/SATResolver.cc 2017-05-31 16:36:13.000000000 +0200 @@ -143,13 +143,13 @@ OUTS( ALLOW_DOWNGRADE ); OUTS( ALLOW_ARCHCHANGE ); OUTS( ALLOW_VENDORCHANGE ); + OUTS( ALLOW_NAMECHANGE ); OUTS( ALLOW_UNINSTALL ); OUTS( NO_UPDATEPROVIDE ); OUTS( SPLITPROVIDES ); OUTS( IGNORE_RECOMMENDED ); OUTS( ADD_ALREADY_RECOMMENDED ); OUTS( NO_INFARCHCHECK ); - OUTS( ALLOW_NAMECHANGE ); OUTS( KEEP_EXPLICIT_OBSOLETES ); OUTS( BEST_OBEY_POLICY ); OUTS( NO_AUTOTARGET ); @@ -175,18 +175,20 @@ //--------------------------------------------------------------------------- +// NOTE: flag defaults must be in sync with ZVARDEFAULT in Resolver.cc SATResolver::SATResolver (const ResPool & pool, sat::detail::CPool *satPool) : _pool(pool) , _satPool(satPool) , _satSolver(NULL) , _fixsystem(false) - , _allowdowngrade(false) - , _allowarchchange(false) - , _allowvendorchange(ZConfig::instance().solver_allowVendorChange()) - , _allowuninstall(false) + , _allowdowngrade ( false ) + , _allownamechange ( false ) + , _allowarchchange ( false ) + , _allowvendorchange ( ZConfig::instance().solver_allowVendorChange() ) + , _allowuninstall ( false ) , _updatesystem(false) - , _noupdateprovide(false) - , _dosplitprovides(true) + , _noupdateprovide ( false ) + , _dosplitprovides ( true ) , _onlyRequires(ZConfig::instance().solver_onlyRequires()) , _ignorealreadyrecommended(true) , _distupgrade(false) @@ -393,12 +395,13 @@ queue_push( &(_jobQueue), 0 ); } solver_set_flag(_satSolver, SOLVER_FLAG_ADD_ALREADY_RECOMMENDED, !_ignorealreadyrecommended); - solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_DOWNGRADE, _allowdowngrade); - solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_UNINSTALL, _allowuninstall); - solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_ARCHCHANGE, _allowarchchange); - solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_VENDORCHANGE, _allowvendorchange); - solver_set_flag(_satSolver, SOLVER_FLAG_SPLITPROVIDES, _dosplitprovides); - solver_set_flag(_satSolver, SOLVER_FLAG_NO_UPDATEPROVIDE, _noupdateprovide); + solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_DOWNGRADE, _allowdowngrade); + solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_NAMECHANGE, _allownamechange); + solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_ARCHCHANGE, _allowarchchange); + solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_VENDORCHANGE, _allowvendorchange); + solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_UNINSTALL, _allowuninstall); + solver_set_flag(_satSolver, SOLVER_FLAG_NO_UPDATEPROVIDE, _noupdateprovide); + solver_set_flag(_satSolver, SOLVER_FLAG_SPLITPROVIDES, _dosplitprovides); solver_set_flag(_satSolver, SOLVER_FLAG_IGNORE_RECOMMENDED, _onlyRequires); solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_DOWNGRADE, _dup_allowdowngrade ); solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_NAMECHANGE, _dup_allownamechange ); @@ -830,12 +833,13 @@ queue_push( &(_jobQueue), 0 ); } solver_set_flag(_satSolver, SOLVER_FLAG_ADD_ALREADY_RECOMMENDED, !_ignorealreadyrecommended); - solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_DOWNGRADE, _allowdowngrade); - solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_UNINSTALL, _allowuninstall); - solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_ARCHCHANGE, _allowarchchange); - solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_VENDORCHANGE, _allowvendorchange); - solver_set_flag(_satSolver, SOLVER_FLAG_SPLITPROVIDES, _dosplitprovides); - solver_set_flag(_satSolver, SOLVER_FLAG_NO_UPDATEPROVIDE, _noupdateprovide); + solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_DOWNGRADE, _allowdowngrade); + solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_NAMECHANGE, _allownamechange); + solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_ARCHCHANGE, _allowarchchange); + solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_VENDORCHANGE, _allowvendorchange); + solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_UNINSTALL, _allowuninstall); + solver_set_flag(_satSolver, SOLVER_FLAG_NO_UPDATEPROVIDE, _noupdateprovide); + solver_set_flag(_satSolver, SOLVER_FLAG_SPLITPROVIDES, _dosplitprovides); solver_set_flag(_satSolver, SOLVER_FLAG_IGNORE_RECOMMENDED, _onlyRequires); sat::Pool::instance().prepare(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.11.0/zypp/solver/detail/SATResolver.h new/libzypp-16.12.0/zypp/solver/detail/SATResolver.h --- old/libzypp-16.11.0/zypp/solver/detail/SATResolver.h 2016-11-29 11:31:52.000000000 +0100 +++ new/libzypp-16.12.0/zypp/solver/detail/SATResolver.h 2017-05-31 11:51:08.000000000 +0200 @@ -96,6 +96,7 @@ public: bool _fixsystem:1; // repair errors in rpm dependency graph bool _allowdowngrade:1; // allow to downgrade installed solvable + bool _allownamechange:1; // allow to change name of installed solvable bool _allowarchchange:1; // allow to change architecture of installed solvables bool _allowvendorchange:1; // allow to change vendor of installed solvables bool _allowuninstall:1; // allow removal of installed solvables diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libzypp-16.11.0/zypp/solver/detail/Testcase.cc new/libzypp-16.12.0/zypp/solver/detail/Testcase.cc --- old/libzypp-16.11.0/zypp/solver/detail/Testcase.cc 2016-11-29 11:31:52.000000000 +0100 +++ new/libzypp-16.12.0/zypp/solver/detail/Testcase.cc 2017-05-31 11:51:08.000000000 +0200 @@ -276,6 +276,7 @@ private: std::string dumpFile; // Path of the generated testcase std::ofstream *file; + bool _inSetup; public: HelixControl (const std::string & controlPath, @@ -283,13 +284,25 @@ const Arch & systemArchitecture, const target::Modalias::ModaliasList & modaliasList, const std::set<std::string> & multiversionSpec, - const std::string & systemPath, - const bool forceResolve, - const bool onlyRequires, - const bool ignorealreadyrecommended); + const std::string & systemPath); HelixControl (); ~HelixControl (); + void closeSetup() + { + if ( _inSetup ) + { + *file << "</setup>" << endl << "<trial>" << endl; + _inSetup = false; + } + } + + void addTagIf( const std::string & tag_r, bool yesno_r = true ) + { + if ( yesno_r ) + *file << (_inSetup ? TAB : "") << "<" << tag_r << "/>" << endl; + } + void installResolvable( const PoolItem & pi_r ); void lockResolvable( const PoolItem & pi_r ); void keepResolvable( const PoolItem & pi_r ); @@ -297,10 +310,6 @@ void addDependencies (const CapabilitySet &capRequire, const CapabilitySet &capConflict); void addUpgradeRepos( const std::set<Repository> & upgradeRepos_r ); - void distupgrade (); - void verifySystem (); - void update (); - std::string filename () { return dumpFile; } }; @@ -309,11 +318,9 @@ const Arch & systemArchitecture, const target::Modalias::ModaliasList & modaliasList, const std::set<std::string> & multiversionSpec, - const std::string & systemPath, - const bool forceResolve, - const bool onlyRequires, - const bool ignorealreadyrecommended) + const std::string & systemPath) :dumpFile (controlPath) + ,_inSetup( true ) { file = new ofstream(controlPath.c_str()); if (!file) { @@ -375,7 +382,7 @@ for_( it, modaliasList.begin(), modaliasList.end() ) { - *file << TAB << "<modalias name=\"" << *it + *file << TAB << "<modalias name=\"" << xml_escape(*it) << "\" />" << endl; } @@ -384,15 +391,7 @@ << "\" />" << endl; } - if (forceResolve) - *file << TAB << "<forceResolve/>" << endl; - if (onlyRequires) - *file << TAB << "<onlyRequires/>" << endl; - if (ignorealreadyrecommended) - *file << TAB << "<ignorealreadyrecommended/>" << endl; - - *file << "</setup>" << endl - << "<trial>" << endl; + // setup continued outside.... } HelixControl::HelixControl() @@ -403,6 +402,7 @@ HelixControl::~HelixControl() { + closeSetup(); // in case it is still open *file << "</trial>" << endl << "</test>" << endl; delete(file); @@ -470,21 +470,6 @@ } } -void HelixControl::distupgrade() -{ - *file << "<distupgrade/>" << endl; -} - -void HelixControl::verifySystem() -{ - *file << "<verify/>" << endl; -} - -void HelixControl::update() -{ - *file << "<update/>" << endl; -} - //--------------------------------------------------------------------------- Testcase::Testcase() @@ -578,10 +563,27 @@ ZConfig::instance().systemArchitecture(), target::Modalias::instance().modaliasList(), ZConfig::instance().multiversionSpec(), - "solver-system.xml.gz", - resolver.forceResolve(), - resolver.onlyRequires(), - resolver.ignoreAlreadyRecommended() ); + "solver-system.xml.gz"); + + // In <setup>: resolver flags,... + control.addTagIf( "ignorealreadyrecommended", resolver.ignoreAlreadyRecommended() ); + control.addTagIf( "onlyRequires", resolver.onlyRequires() ); + control.addTagIf( "forceResolve", resolver.forceResolve() ); + + control.addTagIf( "cleandepsOnRemove", resolver.cleandepsOnRemove() ); + + control.addTagIf( "allowDowngrade", resolver.allowDowngrade() ); + control.addTagIf( "allowNameChange", resolver.allowNameChange() ); + control.addTagIf( "allowArchChange", resolver.allowArchChange() ); + control.addTagIf( "allowVendorChange", resolver.allowVendorChange() ); + + control.addTagIf( "dupAllowDowngrade", resolver.dupAllowDowngrade() ); + control.addTagIf( "dupAllowNameChange", resolver.dupAllowNameChange() ); + control.addTagIf( "dupAllowArchChange", resolver.dupAllowArchChange() ); + control.addTagIf( "dupAllowVendorChange", resolver.dupAllowVendorChange() ); + + control.closeSetup(); + // Entering <trial>... for ( const PoolItem & pi : items_to_install ) { control.installResolvable( pi ); } @@ -600,12 +602,9 @@ SystemCheck::instance().conflictSystemCap()); control.addUpgradeRepos( resolver.upgradeRepos() ); - if (resolver.isUpgradeMode()) - control.distupgrade (); - if (resolver.isUpdateMode()) - control.update(); - if (resolver.isVerifyingMode()) - control.verifySystem(); + control.addTagIf( "distupgrade", resolver.isUpgradeMode() ); + control.addTagIf( "verify", resolver.isUpdateMode() ); + control.addTagIf( "update", resolver.isVerifyingMode() ); return true; }
