+bool Catalog::uninstall()
+{
+ bool ok;
+ bool atLeastOneFailure = false;
+
+ BOOST_FOREACH(PackageRef p, installedPackages()) {
+ ok = p->existingInstall()->uninstall();
+ if (!ok) {
+ SG_LOG(SG_GENERAL, SG_WARN, "uninstall of package " <<
+ p->id() << " failed");
+ // continue trying other packages, bailing out here
+ // gains us nothing
+ atLeastOneFailure = true;
+ }
+ }
+
+ Dir d(m_installRoot);
+ ok = d.remove(true /* recursive */);
+ if (!ok) {
+ atLeastOneFailure = true;
+ }
+
+ changeStatus(atLeastOneFailure ? Delegate::FAIL_FILESYSTEM
+ : Delegate::FAIL_SUCCESS);
+ return ok;
+}
+