Imported Upstream version 14.40.0 36/94636/1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 1 Nov 2016 01:34:23 +0000 (10:34 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 1 Nov 2016 01:34:24 +0000 (10:34 +0900)
Change-Id: I7572ce7ee44cdef02ffcd28cdc7e2c8e0d9e9eb9
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
15 files changed:
VERSION.cmake
doc/locks.5
doc/locks.5.txt
doc/zypp-CheckAccessDeleted.1
doc/zypp-CheckAccessDeleted.1.txt
doc/zypp-NameReqPrv.1
doc/zypp-NameReqPrv.1.txt
package/libzypp.changes
zypp/FileChecker.cc
zypp/Resolver.cc
zypp/Resolver.h
zypp/solver/detail/Resolver.cc
zypp/solver/detail/Resolver.h
zypp/solver/detail/SATResolver.cc
zypp/solver/detail/SATResolver.h

index d27714c..d6e83a5 100644 (file)
@@ -60,9 +60,9 @@
 #
 SET(LIBZYPP_MAJOR "14")
 SET(LIBZYPP_COMPATMINOR "39")
-SET(LIBZYPP_MINOR "39")
+SET(LIBZYPP_MINOR "40")
 SET(LIBZYPP_PATCH "0")
 #
-# LAST RELEASED: 14.39.0 (39)
+# LAST RELEASED: 14.40.0 (39)
 # (The number in parenthesis is LIBZYPP_COMPATMINOR)
 #=======
index d446c7a..26ac90e 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: locks
 .\"    Author: [see the "AUTHORS" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 10/02/2014
+.\"      Date: 06/12/2015
 .\"    Manual: LIBZYPP
-.\"    Source: libzypp
+.\"    Source: SUSE Linux
 .\"  Language: English
 .\"
-.TH "LOCKS" "5" "10/02/2014" "libzypp" "LIBZYPP"
+.TH "LOCKS" "5" "06/12/2015" "SUSE Linux" "LIBZYPP"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
index 4428ccf..cfd94d0 100644 (file)
@@ -1,7 +1,7 @@
-locks(5)
+LOCKS(5)
 ========
 :man manual: LIBZYPP
-:man source: libzypp
+:man source: SUSE Linux
 
 
 NAME
index ddb4d43..d8a3be7 100644 (file)
@@ -1,13 +1,13 @@
 '\" t
-.\"     Title: zypp-CheckAccessDeleted
+.\"     Title: zypp-checkaccessdeleted
 .\"    Author: [see the "AUTHORS" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 10/02/2014
+.\"      Date: 06/12/2015
 .\"    Manual: LIBZYPP
-.\"    Source: libzypp
+.\"    Source: SUSE Linux
 .\"  Language: English
 .\"
-.TH "ZYPP\-CHECKACCESSDEL" "1" "10/02/2014" "libzypp" "LIBZYPP"
+.TH "ZYPP\-CHECKACCESSDEL" "1" "06/12/2015" "SUSE Linux" "LIBZYPP"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
index c418f62..6e3a17b 100644 (file)
@@ -1,7 +1,7 @@
-zypp-CheckAccessDeleted(1)
+ZYPP-CHECKACCESSDELETED(1)
 ==========================
 :man manual: LIBZYPP
-:man source: libzypp
+:man source: SUSE Linux
 
 
 NAME
index 8a7907d..0cf4fa8 100644 (file)
@@ -1,13 +1,13 @@
 '\" t
-.\"     Title: zypp-NameReqPrv
+.\"     Title: zypp-namereqprv
 .\"    Author: [see the "AUTHORS" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 10/02/2014
+.\"      Date: 06/12/2015
 .\"    Manual: LIBZYPP
-.\"    Source: libzypp
+.\"    Source: SUSE Linux
 .\"  Language: English
 .\"
-.TH "ZYPP\-NAMEREQPRV" "1" "10/02/2014" "libzypp" "LIBZYPP"
+.TH "ZYPP\-NAMEREQPRV" "1" "06/12/2015" "SUSE Linux" "LIBZYPP"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
index 9135a44..cc1708f 100644 (file)
@@ -1,7 +1,7 @@
-zypp-NameReqPrv(1)
+ZYPP-NAMEREQPRV(1)
 ==================
 :man manual: LIBZYPP
-:man source: libzypp
+:man source: SUSE Linux
 
 
 NAME
index cfa0ea3..5fb1ad2 100644 (file)
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Fri Jul  3 15:24:15 CEST 2015 - ma@suse.de
+
+- Resolver allow tuning DUP mode solver flags (FATE#319128)
+- version 14.40.0 (39)
+
+-------------------------------------------------------------------
 Fri Jun 12 12:40:36 CEST 2015 - ma@suse.de
 
 - zypp.conf: Add config values for gpgcheck, repo_gpgcheck 
index 1d21137..e9a8a38 100644 (file)
@@ -52,6 +52,7 @@ namespace zypp
       CheckSum real_checksum( _checksum.type(), filesystem::checksum( file, _checksum.type() ));
       if ( (real_checksum != _checksum) )
       {
+       WAR << "File " <<  file << " has wrong checksum " << real_checksum << " (expected " << _checksum << ")" << endl;
         if ( report->askUserToAcceptWrongDigest( file, _checksum.checksum(), real_checksum.checksum() ) )
         {
           WAR << "User accepted " <<  file << " with WRONG CHECKSUM." << std::endl;
index 1b7243a..f4bb1dc 100644 (file)
@@ -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 ); }
index 3ba8fdd..dd71fd2 100644 (file)
@@ -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.
index 1658e88..8fd3f31 100644 (file)
@@ -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);
index 10f140a..565177a 100644 (file)
@@ -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 );
 
index 9eebf40..f25ee0e 100644 (file)
@@ -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,20 @@ 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);
-
+    DBG << "main.cc: " << _dup_allowdowngrade << " / " << solver_get_flag(_solv, SOLVER_FLAG_DUP_ALLOW_DOWNGRADE ) << endl;
+    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 );
+    DBG << "main.cc: " << _dup_allowdowngrade << " / " << solver_get_flag(_solv, SOLVER_FLAG_DUP_ALLOW_DOWNGRADE ) << endl;
+#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 !
index 2d645da..7c8474c 100644 (file)
@@ -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);