aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-11-21 06:59:40 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-11-21 06:59:40 +0000
commitc957af8349597f2f38225b3e5b30b333c97a66c3 (patch)
treedbb0d14a9f8b6a8bccaf3b55b38419ed697a41b1
parent2838e41e6502dfb861cd3c32d9a7e6bb8bc22613 (diff)
downloadpaludis-c957af8349597f2f38225b3e5b30b333c97a66c3.tar.gz
paludis-c957af8349597f2f38225b3e5b30b333c97a66c3.tar.xz
Make SR constructors explicit. Change uninstall order.
-rwxr-xr-xmisc/make_sr.bash2
-rw-r--r--paludis/uninstall_list.cc16
-rw-r--r--paludis/uninstall_list.hh1
3 files changed, 17 insertions, 2 deletions
diff --git a/misc/make_sr.bash b/misc/make_sr.bash
index e5e593e..fbc6734 100755
--- a/misc/make_sr.bash
+++ b/misc/make_sr.bash
@@ -178,7 +178,7 @@ while read a ; do
echo " ///\{"
echo
- echo " ${a}("
+ echo " explicit ${a}("
for (( k = 0 ; k < ${#want_keys[@]} ; k++ )) ; do
echo -n " $(make_const_ref "${want_key_types[${k}]}") value_for_${want_keys[${k}]}"
if [[ $(( ${k} + 1 )) -lt ${#want_keys[@]} ]] ; then
diff --git a/paludis/uninstall_list.cc b/paludis/uninstall_list.cc
index 9fed096..0b39e2c 100644
--- a/paludis/uninstall_list.cc
+++ b/paludis/uninstall_list.cc
@@ -105,6 +105,9 @@ UninstallList::add(const PackageDatabaseEntry & e)
if (_imp->options.with_dependencies)
add_dependencies(e);
+ remove_package(e);
+ add_package(e);
+
if (_imp->options.with_unused_dependencies)
add_unused_dependencies();
}
@@ -136,7 +139,18 @@ UninstallList::add_package(const PackageDatabaseEntry & e)
throw InternalError(PALUDIS_HERE, "Trying to add '" + stringify(e) +
"' to UninstallList but has_version failed");
- _imp->uninstall_list.push_back(e);
+ _imp->uninstall_list.push_back(UninstallListEntry(e));
+}
+
+void
+UninstallList::remove_package(const PackageDatabaseEntry & e)
+{
+ Context context("When removing package '" + stringify(e) + "' from the uninstall list:");
+
+ std::list<UninstallListEntry>::iterator i(std::find_if(_imp->uninstall_list.begin(),
+ _imp->uninstall_list.end(), MatchUninstallListEntry(e)));
+ if (_imp->uninstall_list.end() != i)
+ _imp->uninstall_list.erase(i);
}
PackageDatabaseEntryCollection::ConstPointer
diff --git a/paludis/uninstall_list.hh b/paludis/uninstall_list.hh
index 9c89d87..2c486a9 100644
--- a/paludis/uninstall_list.hh
+++ b/paludis/uninstall_list.hh
@@ -39,6 +39,7 @@ namespace paludis
{
private:
void add_package(const PackageDatabaseEntry &);
+ void remove_package(const PackageDatabaseEntry &);
void add_unused_dependencies();
void add_dependencies(const PackageDatabaseEntry &);
PackageDatabaseEntryCollection::ConstPointer collect_depped_upon(