aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-02 23:46:21 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-02 23:46:21 +0100
commit0e96d49be7ff18688cb6219c9c1c72b2006b01dd (patch)
treeb960a3f0839eeb570845da99fb5b0b3fbc80440d
parent3ba65219b342903a4234f8adefc7d1d52c901e57 (diff)
downloadpaludis-0e96d49be7ff18688cb6219c9c1c72b2006b01dd.tar.gz
paludis-0e96d49be7ff18688cb6219c9c1c72b2006b01dd.tar.xz
Fix unpackaged upgrades.
Fixes: ticket:790
-rw-r--r--paludis/repositories/unpackaged/installed_id.cc8
-rw-r--r--paludis/repositories/unpackaged/installed_id.hh5
-rw-r--r--paludis/repositories/unpackaged/installed_repository.cc3
3 files changed, 11 insertions, 5 deletions
diff --git a/paludis/repositories/unpackaged/installed_id.cc b/paludis/repositories/unpackaged/installed_id.cc
index 93b4547..57b6710 100644
--- a/paludis/repositories/unpackaged/installed_id.cc
+++ b/paludis/repositories/unpackaged/installed_id.cc
@@ -774,7 +774,7 @@ namespace
void visit(UninstallAction & a)
{
std::tr1::shared_ptr<OutputManager> output_manager(a.options.make_output_manager()(a));
- id->uninstall(false, output_manager);
+ id->uninstall(false, a.options.if_for_install_id(), output_manager);
output_manager->succeeded();
}
};
@@ -828,11 +828,13 @@ namespace
}
void
-InstalledUnpackagedID::uninstall(const bool replace, const std::tr1::shared_ptr<OutputManager> & output_manager) const
+InstalledUnpackagedID::uninstall(const bool replace,
+ const std::tr1::shared_ptr<const PackageID> & if_for_install_id,
+ const std::tr1::shared_ptr<OutputManager> & output_manager) const
{
Context context("When uninstalling '" + stringify(*this) + "':");
- bool last(! replace);
+ bool last((! replace) && (! if_for_install_id));
if (last)
{
std::tr1::shared_ptr<const PackageIDSequence> ids(repository()->package_ids(name()));
diff --git a/paludis/repositories/unpackaged/installed_id.hh b/paludis/repositories/unpackaged/installed_id.hh
index a9bec88..c3763eb 100644
--- a/paludis/repositories/unpackaged/installed_id.hh
+++ b/paludis/repositories/unpackaged/installed_id.hh
@@ -89,7 +89,10 @@ namespace paludis
virtual std::size_t extra_hash_value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- void uninstall(const bool replace, const std::tr1::shared_ptr<OutputManager> & output_manager) const;
+ void uninstall(
+ const bool replace,
+ const std::tr1::shared_ptr<const PackageID> & if_for_install_id,
+ const std::tr1::shared_ptr<OutputManager> & output_manager) const;
};
}
}
diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc
index c8431e3..cdb47e0 100644
--- a/paludis/repositories/unpackaged/installed_repository.cc
+++ b/paludis/repositories/unpackaged/installed_repository.cc
@@ -379,7 +379,8 @@ InstalledUnpackagedRepository::merge(const MergeParams & m)
if (if_overwritten_id)
{
- std::tr1::static_pointer_cast<const InstalledUnpackagedID>(if_overwritten_id)->uninstall(true, m.output_manager());
+ std::tr1::static_pointer_cast<const InstalledUnpackagedID>(if_overwritten_id)->uninstall(true,
+ if_overwritten_id, m.output_manager());
}
}