From: DongHun Kwak Date: Tue, 1 Nov 2016 01:46:48 +0000 (+0900) Subject: Imported Upstream version 15.9.0 X-Git-Tag: upstream/16.3.1~57 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=380d2725aa55e9475e3bfc92c176e5ef48318c35;p=platform%2Fupstream%2Flibzypp.git Imported Upstream version 15.9.0 Change-Id: I94795fb907188bfd54f6cf64fc4af858ce73c647 Signed-off-by: DongHun Kwak --- diff --git a/VERSION.cmake b/VERSION.cmake index fa5339b..6174131 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -60,9 +60,9 @@ # SET(LIBZYPP_MAJOR "15") SET(LIBZYPP_COMPATMINOR "5") -SET(LIBZYPP_MINOR "8") +SET(LIBZYPP_MINOR "9") SET(LIBZYPP_PATCH "0") # -# LAST RELEASED: 15.8.0 (5) +# LAST RELEASED: 15.9.0 (5) # (The number in parenthesis is LIBZYPP_COMPATMINOR) #======= diff --git a/package/libzypp.changes b/package/libzypp.changes index e9e9f51..2449d6e 100644 --- a/package/libzypp.changes +++ b/package/libzypp.changes @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Thu Jul 9 16:43:12 CEST 2015 - ma@suse.de + +- Resolver allow tuning DUP mode solver flags (FATE#319128) +- version 15.9.0 (5) + +------------------------------------------------------------------- Fri Jul 3 08:23:04 CEST 2015 - ma@suse.de - Flags: add stringify diff --git a/zypp/Resolver.cc b/zypp/Resolver.cc index 1b7243a..f4bb1dc 100644 --- a/zypp/Resolver.cc +++ b/zypp/Resolver.cc @@ -106,6 +106,22 @@ namespace zypp void Resolver::setDefaultCleandepsOnRemove() { _pimpl->setCleandepsOnRemove( indeterminate ); } bool Resolver::cleandepsOnRemove() const { return _pimpl->cleandepsOnRemove(); } +#define ZOLV_FLAG_BOOL( ZSETTER, ZGETTER ) \ + void Resolver::ZSETTER( bool yesno_r ){ _pimpl->ZSETTER( yesno_r ); } \ + bool Resolver::ZGETTER() const { return _pimpl->ZGETTER(); } \ + +#define ZOLV_FLAG_TRIBOOL( ZSETTER, ZDEFAULT, ZGETTER ) \ + ZOLV_FLAG_BOOL( ZSETTER , ZGETTER ) \ + void Resolver::ZDEFAULT() { _pimpl->ZSETTER( indeterminate ); } \ + + ZOLV_FLAG_TRIBOOL( dupSetAllowDowngrade, dupSetDefaultAllowDowngrade, dupAllowDowngrade ) + ZOLV_FLAG_TRIBOOL( dupSetAllowNameChange, dupSetDefaultAllowNameChange, dupAllowNameChange ) + ZOLV_FLAG_TRIBOOL( dupSetAllowArchChange, dupSetDefaultAllowArchChange, dupAllowArchChange ) + ZOLV_FLAG_TRIBOOL( dupSetAllowVendorChange, dupSetDefaultAllowVendorChange, dupAllowVendorChange ) + +#undef ZOLV_FLAG_BOOL +#undef ZOLV_FLAG_TRIBOOL + void Resolver::addUpgradeRepo( Repository repo_r ) { _pimpl->addUpgradeRepo( repo_r ); } bool Resolver::upgradingRepo( Repository repo_r ) const { return _pimpl->upgradingRepo( repo_r ); } void Resolver::removeUpgradeRepo( Repository repo_r ) { _pimpl->removeUpgradeRepo( repo_r ); } diff --git a/zypp/Resolver.h b/zypp/Resolver.h index 3ba8fdd..dd71fd2 100644 --- a/zypp/Resolver.h +++ b/zypp/Resolver.h @@ -113,7 +113,7 @@ namespace zypp /** - * Do an distribution upgrade + * Do an distribution upgrade (DUP) * * Perform a distribution upgrade. This performs an update of * all packages with a special resolver algorithm which takes @@ -240,6 +240,32 @@ namespace zypp void setDefaultCleandepsOnRemove(); // set back to default (in zypp.conf) bool cleandepsOnRemove() const; + /** \name Solver flags for DUP mode. + * DUP mode default settings differ from 'ordinary' ones. Default for + * all DUP flags is \c true. + */ + //@{ + /** dup mode: allow to downgrade installed solvable */ + void dupSetAllowDowngrade( bool yesno_r ); + void dupSetDefaultAllowDowngrade(); // Set back to default + bool dupAllowDowngrade() const; + + /** dup mode: allow to change name of installed solvable */ + void dupSetAllowNameChange( bool yesno_r ); + void dupSetDefaultAllowNameChange(); // Set back to default + bool dupAllowNameChange() const; + + /** dup mode: allow to change architecture of installed solvables */ + void dupSetAllowArchChange( bool yesno_r ); + void dupSetDefaultAllowArchChange(); // Set back to default + bool dupAllowArchChange() const; + + /** dup mode: allow to change vendor of installed solvables*/ + void dupSetAllowVendorChange( bool yesno_r ); + void dupSetDefaultAllowVendorChange(); // Set back to default + bool dupAllowVendorChange() const; + //@} + /** \name Upgrade to content of a specific repository. * \note This is an ordinary solver request. You should simply * \ref resolvePool to execute, and not \ref doUpgrade. diff --git a/zypp/solver/detail/Resolver.cc b/zypp/solver/detail/Resolver.cc index 1658e88..8fd3f31 100644 --- a/zypp/solver/detail/Resolver.cc +++ b/zypp/solver/detail/Resolver.cc @@ -104,6 +104,20 @@ Resolver::~Resolver() } //--------------------------------------------------------------------------- +// forward flags too SATResolver +#define ZOLV_FLAG_TRIBOOL( ZSETTER, ZGETTER, ZVARNAME, ZVARDEFAULT ) \ + void Resolver::ZSETTER( TriBool state_r ) \ + { _satResolver->ZVARNAME = indeterminate(state_r) ? ZVARDEFAULT : bool(state_r); } \ + bool Resolver::ZGETTER() const \ + { return _satResolver->ZVARNAME; } \ + +ZOLV_FLAG_TRIBOOL( dupSetAllowDowngrade, dupAllowDowngrade, _dup_allowdowngrade, true ) +ZOLV_FLAG_TRIBOOL( dupSetAllowNameChange, dupAllowNameChange, _dup_allownamechange, true ) +ZOLV_FLAG_TRIBOOL( dupSetAllowArchChange, dupAllowArchChange, _dup_allowarchchange, true ) +ZOLV_FLAG_TRIBOOL( dupSetAllowVendorChange, dupAllowVendorChange, _dup_allowvendorchange, true ) + +#undef ZOLV_FLAG_TRIBOOL +//--------------------------------------------------------------------------- void Resolver::setAllowVendorChange( TriBool state_r ) { @@ -255,7 +269,6 @@ bool Resolver::verifySystem() //---------------------------------------------------------------------------- // undo - void Resolver::undo() { UndoTransact info(ResStatus::APPL_LOW); diff --git a/zypp/solver/detail/Resolver.h b/zypp/solver/detail/Resolver.h index 10f140a..565177a 100644 --- a/zypp/solver/detail/Resolver.h +++ b/zypp/solver/detail/Resolver.h @@ -223,6 +223,17 @@ class Resolver : public base::ReferenceCounted, private base::NonCopyable { void setCleandepsOnRemove( TriBool state_r ); //@} +#define ZOLV_FLAG_TRIBOOL( ZSETTER, ZGETTER ) \ + void ZSETTER( TriBool state_r ); \ + bool ZGETTER() const; \ + + ZOLV_FLAG_TRIBOOL( dupSetAllowDowngrade, dupAllowDowngrade ) + ZOLV_FLAG_TRIBOOL( dupSetAllowNameChange, dupAllowNameChange ) + ZOLV_FLAG_TRIBOOL( dupSetAllowArchChange, dupAllowArchChange ) + ZOLV_FLAG_TRIBOOL( dupSetAllowVendorChange, dupAllowVendorChange ) + +#undef ZOLV_FLAG_TRIBOOL + ResolverProblemList problems() const; void applySolutions( const ProblemSolutionList & solutions ); diff --git a/zypp/solver/detail/SATResolver.cc b/zypp/solver/detail/SATResolver.cc index 9eebf40..961ace3 100644 --- a/zypp/solver/detail/SATResolver.cc +++ b/zypp/solver/detail/SATResolver.cc @@ -176,6 +176,10 @@ SATResolver::SATResolver (const ResPool & pool, Pool *SATPool) , _allowarchchange(false) , _allowvendorchange(ZConfig::instance().solver_allowVendorChange()) , _allowuninstall(false) + , _dup_allowdowngrade( true ) + , _dup_allownamechange( true ) + , _dup_allowarchchange( true ) + , _dup_allowvendorchange( true ) , _updatesystem(false) , _noupdateprovide(false) , _dosplitprovides(true) @@ -480,14 +484,18 @@ SATResolver::solving(const CapabilitySet & requires_caps, solver_set_flag(_solv, SOLVER_FLAG_SPLITPROVIDES, _dosplitprovides); solver_set_flag(_solv, SOLVER_FLAG_NO_UPDATEPROVIDE, _noupdateprovide); solver_set_flag(_solv, SOLVER_FLAG_IGNORE_RECOMMENDED, _onlyRequires); - + solver_set_flag(_solv, SOLVER_FLAG_DUP_ALLOW_DOWNGRADE, _dup_allowdowngrade ); + solver_set_flag(_solv, SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE, _dup_allownamechange ); + solver_set_flag(_solv, SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE, _dup_allowarchchange ); + solver_set_flag(_solv, SOLVER_FLAG_DUP_ALLOW_NAMECHANGE, _dup_allowvendorchange ); +#if 1 #define HACKENV(X,D) solver_set_flag(_solv, X, env::HACKENV( #X, D ) ); - HACKENV( SOLVER_FLAG_DUP_ALLOW_DOWNGRADE, true ); - HACKENV( SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE, true ); - HACKENV( SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE,true ); - HACKENV( SOLVER_FLAG_DUP_ALLOW_NAMECHANGE, true ); + HACKENV( SOLVER_FLAG_DUP_ALLOW_DOWNGRADE, _dup_allowdowngrade ); + HACKENV( SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE, _dup_allownamechange ); + HACKENV( SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE,_dup_allowarchchange ); + HACKENV( SOLVER_FLAG_DUP_ALLOW_NAMECHANGE, _dup_allowvendorchange ); #undef HACKENV - +#endif sat::Pool::instance().prepareForSolving(); // Solve ! diff --git a/zypp/solver/detail/SATResolver.h b/zypp/solver/detail/SATResolver.h index 2d645da..7c8474c 100644 --- a/zypp/solver/detail/SATResolver.h +++ b/zypp/solver/detail/SATResolver.h @@ -88,22 +88,27 @@ class SATResolver : public base::ReferenceCounted, private base::NonCopyable { // solve results PoolItemList _result_items_to_install; PoolItemList _result_items_to_remove; + public: + bool _fixsystem:1; // repair errors in rpm dependency graph + bool _allowdowngrade:1; // allow to downgrade 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 + bool _updatesystem:1; // update + bool _noupdateprovide:1; // true: update packages needs not to provide old package + bool _dosplitprovides:1; // true: consider legacy split provides + bool _onlyRequires:1; // true: consider required packages only + bool _ignorealreadyrecommended:1; // true: ignore recommended packages that were already recommended by the installed packages + bool _distupgrade:1; + bool _distupgrade_removeunsupported:1; + bool _dup_allowdowngrade:1; // dup mode: allow to downgrade installed solvable + bool _dup_allownamechange:1; // dup mode: allow to change name of installed solvable + bool _dup_allowarchchange:1; // dup mode: allow to change architecture of installed solvables + bool _dup_allowvendorchange:1; // dup mode: allow to change vendor of installed solvables + bool _solveSrcPackages:1; // false: generate no job rule for source packages selected in the pool + bool _cleandepsOnRemove:1; // whether removing a package should also remove no longer needed requirements - bool _fixsystem; // repair errors in rpm dependency graph - bool _allowdowngrade; // allow to downgrade installed solvable - bool _allowarchchange; // allow to change architecture of installed solvables - bool _allowvendorchange; // allow to change vendor of installed solvables - bool _allowuninstall; // allow removal of installed solvables - bool _updatesystem; // update - bool _noupdateprovide; // true: update packages needs not to provide old package - bool _dosplitprovides; // true: consider legacy split provides - bool _onlyRequires; // true: consider required packages only - bool _ignorealreadyrecommended; // true: ignore recommended packages that were already recommended by the installed packages - bool _distupgrade; - bool _distupgrade_removeunsupported; - bool _solveSrcPackages; // false: generate no job rule for source packages selected in the pool - bool _cleandepsOnRemove; // whether removing a package should also remove no longer needed requirements - + private: // ---------------------------------- methods std::string SATprobleminfoString (Id problem, std::string &detail, Id &ignoreId); void resetItemTransaction (PoolItem item);