- // first uninstall what is to be uninstalled
-#warning FIXME this orderding doesn't honor the dependencies for removals
- commit(to_uninstall);
+
+ if (to_uninstall.size() > 0 ) {
+
+ // sort delete list...
+
+ InstallOrder order(pool_r, to_uninstall, installed);
+ order.init();
+ const PoolItemList & uninstallorder(order.getTopSorted());
+
+ to_uninstall.clear();
+ for (PoolItemList::const_reverse_iterator it = uninstallorder.rbegin(); it != uninstallorder.rend(); ++it ) {
+ to_uninstall.push_back (*it);
+ }
+
+ // first uninstall what is to be uninstalled
+ commit(to_uninstall);
+ }
+