Skip to content

Commit

Permalink
Keep enabled recommended packages (bsc#1059065)
Browse files Browse the repository at this point in the history
for the next solver runs when doing distribution upgrade

- 4.0.0
  • Loading branch information
lslezak committed Sep 22, 2017
1 parent fefd32f commit 3776d53
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package/yast2-pkg-bindings-devel-doc.spec
Expand Up @@ -16,7 +16,7 @@
#

Name: yast2-pkg-bindings-devel-doc
Version: 3.3.2
Version: 4.0.0
Release: 0
License: GPL-2.0
Group: Documentation/HTML
Expand Down
7 changes: 7 additions & 0 deletions package/yast2-pkg-bindings.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Sep 22 07:24:54 UTC 2017 - lslezak@suse.cz

- Keep enabled recommended packages for the next solver runs
when doing distribution upgrade (bsc#1059065)
- 4.0.0

-------------------------------------------------------------------
Wed Aug 23 14:24:20 UTC 2017 - igonzalezsosa@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-pkg-bindings.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-pkg-bindings
Version: 3.3.2
Version: 4.0.0
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
20 changes: 5 additions & 15 deletions src/Package.cc
Expand Up @@ -1470,18 +1470,17 @@ PkgFunctions::GetPackages(const YCPSymbol& y_which, const YCPBoolean& y_names_on

/**
* @builtin PkgUpdateAll
* @param map<string,any> update_options Options for the solver. All parameters are optional,
* if a parameter is missing the default value from the package manager (libzypp) is used.
* Currently supported options: <tt>NONE</tt>
* @param map<string,any> update_options obsolete, not used anymore
*
* @short Update installed packages
* @description
* Perform a distribution upgrade. This function solves
* dependencies.
*
* Symbols and integer values returned: <tt>NONE</tt>
* Note: Changes the recommended packages solver flag, enables installing
* the recommended packages even for the following solver runs.
*
* @return map<symbol,integer> summary of the update
* @return map<symbol,integer> obsolete, empty map now
*/

YCPValue
Expand Down Expand Up @@ -1513,28 +1512,19 @@ PkgFunctions::PkgUpdateAll (const YCPMap& options)
y2error("'keep_installed_patches' flag is obsoleted and should not be used, check the code!");
}


YCPMap data;

try
{
// store the current ignoreAlreadyRecommended flag
bool ignore_recommended_bak = zypp_ptr()->resolver()->ignoreAlreadyRecommended();
// in full distupgrade enable recommended packages - zypper compatibility
y2milestone("Setting ignoreAlreadyRecommended to false");
zypp_ptr()->resolver()->setIgnoreAlreadyRecommended(false);

// solve upgrade, get statistics
zypp_ptr()->resolver()->doUpgrade();

// set the original flag
y2milestone("Reverting ignoreAlreadyRecommended to: %s", ignore_recommended_bak ? "true" : "false");
zypp_ptr()->resolver()->setIgnoreAlreadyRecommended(ignore_recommended_bak);
}
catch (...)
{}

return data;
return YCPMap();
}


Expand Down

0 comments on commit 3776d53

Please sign in to comment.