-------------------------------------------------------------------
+Mon Feb 12 13:36:08 CET 2007 - mvidner@suse.cz
+
+- Do not allow to commit with unresolved dependency problems (#242736).
+
+-------------------------------------------------------------------
Mon Feb 5 17:00:25 CET 2007 - mvidner@suse.cz
- Shell: added command line editing with history (#232374);
}
}
-void show_problems () {
+// return true if there are no problems
+bool show_problems () {
ostream& stm = cerr;
Resolver_Ptr resolver = zypp::getZYpp()->resolver();
ResolverProblemList rproblems = resolver->problems ();
b = rproblems.begin (),
e = rproblems.end (),
i;
- if (b != e) {
+ bool no_problem = b == e;
+ if (!no_problem) {
cerr << _("Problems:") << endl;
}
for (i = b; i != e; ++i) {
stm << " : " << (*ii)->details () << endl;
}
}
+ return no_problem;
+}
+
+//! @return true if any solution was applied
+bool solve_problems (bool non_interactive)
+{
+ // try some solutions:
+ // policies selected by options
+ // ...
+ if (!non_interactive) {
+ // try asking the user
+ }
+ cerr << _("Sorry, problem resolution not implemented yet.") << endl;
+ return false; // nothing yet
}
/**
* ZYPPER_EXIT_INF_RESTART_NEEDED - if one of patches to be installed needs package manager restart
*/
int solve_and_commit (bool non_interactive) {
- resolve();
+ while (true) {
+ resolve();
+
+ bool no_problem = show_problems ();
+ if (no_problem) // don't worry, be happy
+ break;
- show_problems ();
+ bool any_applied = solve_problems (non_interactive);
+ if (! any_applied)
+ return ZYPPER_EXIT_ERR_ZYPP; // #242736
+ }
// returns -1, 0, ZYPPER_EXIT_INF_REBOOT_NEEDED, or ZYPPER_EXIT_INF_RESTART_NEEDED
const std::string &name );
void mark_for_uninstall( const zypp::ResObject::Kind &kind,
const std::string &name );
-void show_problems();
+bool show_problems();
int show_summary();
std::string calculate_token();
//! load all resolvables that the user wants