Mailinglist Archive: zypp-commit (223 mails)

< Previous Next >
[zypp-commit] r10529 - in /trunk/zypper: doc/TODO src/solve-commit.cc
  • From: jkupec@xxxxxxxxxxxxxxxx
  • Date: Wed, 09 Jul 2008 20:14:00 -0000
  • Message-id: <20080709201400.8DD0F2F13F@xxxxxxxxxxxxxxxx>
Author: jkupec
Date: Wed Jul 9 22:14:00 2008
New Revision: 10529

URL: http://svn.opensuse.org/viewcvs/zypp?rev=10529&view=rev
Log:
- fix setting of solver flags for dist-upgrade (bnc #406959)
- use commong set_solver_flags() to prevent this from happenning again

Modified:
trunk/zypper/doc/TODO
trunk/zypper/src/solve-commit.cc

Modified: trunk/zypper/doc/TODO
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/doc/TODO?rev=10529&r1=10528&r2=10529&view=diff
==============================================================================
--- trunk/zypper/doc/TODO (original)
+++ trunk/zypper/doc/TODO Wed Jul 9 22:14:00 2008
@@ -32,3 +32,6 @@
Packages

+ just download, don't install. Compare to YOU: do not delete after installing
+? zypper up -t package should show the difference between zypper lu -t package
+ and current summary as "these packages have been kept back" (like apt does).
+ User can upgrade such packages with 'zypper in foo' then.

Modified: trunk/zypper/src/solve-commit.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/solve-commit.cc?rev=10529&r1=10528&r2=10529&view=diff
==============================================================================
--- trunk/zypper/src/solve-commit.cc (original)
+++ trunk/zypper/src/solve-commit.cc Wed Jul 9 22:14:00 2008
@@ -775,6 +775,13 @@

static void set_force_resolution(Zypper & zypper)
{
+ // don't force resolution in 'verify'
+ if (zypper.command() == ZypperCommand::VERIFY)
+ {
+ God->resolver()->setForceResolve(false);
+ return;
+ }
+
// --force-resolution command line parameter value
TriBool force_resolution = zypper.runtimeData().force_resolution;

@@ -842,6 +849,14 @@
}


+static void set_solver_flags(Zypper & zypper)
+{
+ set_force_resolution(zypper);
+ set_no_recommends(zypper);
+ set_ignore_recommends_of_installed(zypper);
+}
+
+
/**
* Run the solver.
*
@@ -850,9 +865,7 @@
bool resolve(Zypper & zypper)
{
dump_pool(); // debug
- set_force_resolution(zypper);
- set_no_recommends(zypper);
- set_ignore_recommends_of_installed(zypper);
+ set_solver_flags(zypper);
zypper.out().info(_("Resolving dependencies..."), Out::HIGH);
DBG << "Calling the solver..." << endl;
return God->resolver()->resolvePool();
@@ -861,20 +874,24 @@
static bool verify(Zypper & zypper)
{
dump_pool();
+ set_solver_flags(zypper);
zypper.out().info(_("Verifying dependencies..."), Out::HIGH);
- // don't force aggressive solutions
- God->resolver()->setForceResolve(false); //! \todo move to
set_force_resolution()
- set_no_recommends(zypper);
- set_ignore_recommends_of_installed(zypper);
DBG << "Calling the solver to verify system..." << endl;
return God->resolver()->verifySystem();
}

+static bool dist_upgrade(Zypper & zypper, zypp::UpgradeStatistics & dup_stats)
+{
+ dump_pool();
+ set_solver_flags(zypper);
+ zypper.out().info(_("Computing upgrade..."), Out::HIGH);
+ DBG << "Calling the solver doUpgrade()..." << endl;
+ return God->resolver()->doUpgrade(dup_stats);
+}
+
static void make_solver_test_case(Zypper & zypper)
{
- set_force_resolution(zypper);
- set_no_recommends(zypper);
- set_ignore_recommends_of_installed(zypper);
+ set_solver_flags(zypper);

string testcase_dir("/var/log/zypper.solverTestCase");

@@ -923,13 +940,9 @@
success = verify(zypper);
else if (zypper.command() == ZypperCommand::DIST_UPGRADE)
{
- zypp::UpgradeStatistics opt_stats;
- //! \todo set success to doUpgrade return value if there are problems
- success = false;
- God->resolver()->doUpgrade(opt_stats);
- //! \todo remove this hack once the doUpgrade returns bool
- if (God->resolver()->problems().empty())
- break;
+ zypp::UpgradeStatistics dup_stats;
+ success = dist_upgrade(zypper, dup_stats);
+ //! \todo make use of the upgrade stats
}
else
success = resolve(zypper);
@@ -939,7 +952,7 @@
success = show_problems(zypper);
if (! success) {
// TODO cancel transaction?
- zypper.setExitCode(ZYPPER_EXIT_ERR_ZYPP); // #242736
+ zypper.setExitCode(ZYPPER_EXIT_ERR_ZYPP); // bnc #242736
return;
}
}

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages