aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-02-23 19:05:33 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-02-23 19:05:33 +0000
commit4993721605cc141b0d4eaeacdfc139bc95cbde74 (patch)
treeac0de5efdc92409fd9458f5a7bd746e76a709bb0
parentf5f9541c2e3e6bc727d6a199dc1ab94a9dafad9a (diff)
downloadpaludis-4993721605cc141b0d4eaeacdfc139bc95cbde74.tar.gz
paludis-4993721605cc141b0d4eaeacdfc139bc95cbde74.tar.xz
Let exhereses know what they're replacing.
Fixes: ticket:702
-rw-r--r--.gitignore1
-rw-r--r--paludis/action.hh9
-rw-r--r--paludis/repositories/accounts/accounts_id.cc1
-rw-r--r--paludis/repositories/e/Makefile.am19
-rw-r--r--paludis/repositories/e/e_repository_TEST_replacing.cc158
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_replacing_cleanup.sh9
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_replacing_setup.sh59
-rw-r--r--paludis/repositories/e/eapi.cc2
-rw-r--r--paludis/repositories/e/eapi.hh4
-rw-r--r--paludis/repositories/e/eapis/exheres-0.conf2
-rw-r--r--paludis/repositories/e/ebuild.cc9
-rw-r--r--paludis/repositories/e/ebuild.hh4
-rw-r--r--paludis/repositories/e/ebuild_entries.cc2
-rw-r--r--paludis/repositories/e/exndbam_repository.cc3
-rw-r--r--paludis/repositories/e/exndbam_repository_TEST.cc1
-rw-r--r--paludis/repositories/e/vdb_repository.cc3
-rw-r--r--paludis/repositories/e/vdb_repository_TEST.cc5
-rw-r--r--paludis/repositories/unpackaged/installed_repository_TEST.cc4
-rw-r--r--paludis/repositories/unpackaged/unpackaged_id.cc1
-rw-r--r--paludis/uninstall_task.cc1
-rw-r--r--python/action.cc1
-rw-r--r--ruby/action.cc1
22 files changed, 299 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 7ccf209..d024910 100644
--- a/.gitignore
+++ b/.gitignore
@@ -223,6 +223,7 @@ paludis-*.*.*.tar.bz2
/paludis/repositories/e/e_repository_TEST
/paludis/repositories/e/e_repository_TEST_ever
/paludis/repositories/e/e_repository_TEST_exlibs
+/paludis/repositories/e/e_repository_TEST_replacing
/paludis/repositories/e/e_repository_sets_TEST
/paludis/repositories/e/ebuild_flat_metadata_cache_TEST
/paludis/repositories/e/ebuild/utils/exheres-0/dohard
diff --git a/paludis/action.hh b/paludis/action.hh
index a8b1957..57587bb 100644
--- a/paludis/action.hh
+++ b/paludis/action.hh
@@ -54,6 +54,7 @@ namespace paludis
struct failed_automatic_fetching;
struct failed_integrity_checks;
struct fetch_unneeded;
+ struct if_for_install_id;
struct is_overwrite;
struct make_output_manager;
struct perform_uninstall;
@@ -147,6 +148,14 @@ namespace paludis
NamedValue<n::config_protect, std::string> config_protect;
/**
+ * If we're being uninstalled as part of an install, this is the ID
+ * that's being installed. Otherwise null.
+ *
+ * \since 0.36
+ */
+ NamedValue<n::if_for_install_id, std::tr1::shared_ptr<const PackageID> > if_for_install_id;
+
+ /**
* Some repositories need to do special handlings for direct overwrites
* (foo-1.2 replacing foo-1.2). Clients should set this to false.
*
diff --git a/paludis/repositories/accounts/accounts_id.cc b/paludis/repositories/accounts/accounts_id.cc
index a89cc84..8204c32 100644
--- a/paludis/repositories/accounts/accounts_id.cc
+++ b/paludis/repositories/accounts/accounts_id.cc
@@ -490,6 +490,7 @@ AccountsID::perform_action(Action & action) const
{
UninstallActionOptions uo(make_named_values<UninstallActionOptions>(
value_for<n::config_protect>(used_config_protect),
+ value_for<n::if_for_install_id>(shared_from_this()),
value_for<n::is_overwrite>(false),
value_for<n::make_output_manager>(std::tr1::bind(&this_output_manager, output_manager, std::tr1::placeholders::_1))
));
diff --git a/paludis/repositories/e/Makefile.am b/paludis/repositories/e/Makefile.am
index 7483030..703caae 100644
--- a/paludis/repositories/e/Makefile.am
+++ b/paludis/repositories/e/Makefile.am
@@ -191,6 +191,20 @@ e_repository_TEST_exlibs_LDADD = \
e_repository_TEST_exlibs_CXXFLAGS = $(AM_CXXFLAGS) -I$(top_srcdir) @PALUDIS_CXXFLAGS_NO_DEBUGGING@
+e_repository_TEST_replacing_SOURCES = e_repository_TEST_replacing.cc
+
+e_repository_TEST_replacing_LDADD = \
+ libpaludiserepository_@PALUDIS_PC_SLOT@.la \
+ $(top_builddir)/paludis/repositories/fake/libpaludisfakerepository_@PALUDIS_PC_SLOT@.la \
+ $(top_builddir)/paludis/util/libpaludisutil_@PALUDIS_PC_SLOT@.la \
+ $(top_builddir)/paludis/util/test_extras.o \
+ $(top_builddir)/paludis/libpaludis_@PALUDIS_PC_SLOT@.la \
+ $(top_builddir)/paludis/environments/test/libpaludistestenvironment_@PALUDIS_PC_SLOT@.la \
+ $(top_builddir)/test/libtest.a \
+ $(DYNAMIC_LD_LIBS)
+
+e_repository_TEST_replacing_CXXFLAGS = $(AM_CXXFLAGS) -I$(top_srcdir) @PALUDIS_CXXFLAGS_NO_DEBUGGING@
+
vdb_repository_TEST_SOURCES = vdb_repository_TEST.cc
vdb_repository_TEST_LDADD = \
@@ -374,6 +388,9 @@ EXTRA_DIST = \
e_repository_TEST_exlibs.cc \
e_repository_TEST_exlibs_setup.sh \
e_repository_TEST_exlibs_cleanup.sh \
+ e_repository_TEST_replacing.cc \
+ e_repository_TEST_replacing_setup.sh \
+ e_repository_TEST_replacing_cleanup.sh \
e_repository_params-se.hh \
e_repository_params-se.cc \
e_repository_params.se \
@@ -419,6 +436,7 @@ check_SCRIPTS = \
e_repository_TEST_setup.sh e_repository_TEST_cleanup.sh \
e_repository_TEST_ever_setup.sh e_repository_TEST_ever_cleanup.sh \
e_repository_TEST_exlibs_setup.sh e_repository_TEST_exlibs_cleanup.sh \
+ e_repository_TEST_replacing_setup.sh e_repository_TEST_replacing_cleanup.sh \
xml_things_TEST_setup.sh xml_things_TEST_cleanup.sh \
vdb_repository_TEST_setup.sh vdb_repository_TEST_cleanup.sh \
exndbam_repository_TEST_setup.sh exndbam_repository_TEST_cleanup.sh \
@@ -509,6 +527,7 @@ TESTS = \
e_repository_TEST \
e_repository_TEST_ever \
e_repository_TEST_exlibs \
+ e_repository_TEST_replacing \
e_repository_sets_TEST \
ebuild_flat_metadata_cache_TEST \
exndbam_repository_TEST \
diff --git a/paludis/repositories/e/e_repository_TEST_replacing.cc b/paludis/repositories/e/e_repository_TEST_replacing.cc
new file mode 100644
index 0000000..4755321
--- /dev/null
+++ b/paludis/repositories/e/e_repository_TEST_replacing.cc
@@ -0,0 +1,158 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2009 Ciaran McCreesh
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <paludis/repositories/e/e_repository.hh>
+#include <paludis/repositories/e/e_repository_exceptions.hh>
+#include <paludis/repositories/e/e_repository_id.hh>
+#include <paludis/environments/test/test_environment.hh>
+#include <paludis/repositories/fake/fake_installed_repository.hh>
+#include <paludis/repositories/fake/fake_package_id.hh>
+#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/make_named_values.hh>
+#include <paludis/util/set.hh>
+#include <paludis/util/map.hh>
+#include <paludis/package_id.hh>
+#include <paludis/metadata_key.hh>
+#include <paludis/action.hh>
+#include <paludis/user_dep_spec.hh>
+#include <paludis/generator.hh>
+#include <paludis/filter.hh>
+#include <paludis/filtered_generator.hh>
+#include <paludis/selection.hh>
+#include <paludis/repository_factory.hh>
+#include <paludis/choice.hh>
+#include <paludis/standard_output_manager.hh>
+#include <test/test_framework.hh>
+#include <test/test_runner.hh>
+#include <tr1/functional>
+#include <set>
+#include <string>
+
+#include "config.h"
+
+using namespace test;
+using namespace paludis;
+
+namespace
+{
+ void do_uninstall(const std::tr1::shared_ptr<const PackageID> & id, const UninstallActionOptions & uo)
+ {
+ UninstallAction a(uo);
+ id->perform_action(a);
+ }
+
+ std::tr1::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
+ {
+ return make_shared_ptr(new StandardOutputManager);
+ }
+
+ std::string from_keys(const std::tr1::shared_ptr<const Map<std::string, std::string> > & m,
+ const std::string & k)
+ {
+ Map<std::string, std::string>::ConstIterator mm(m->find(k));
+ if (m->end() == mm)
+ return "";
+ else
+ return mm->second;
+ }
+
+ void dummy_used_this_for_config_protect(const std::string &)
+ {
+ }
+
+ WantPhase want_all_phases(const std::string &)
+ {
+ return wp_yes;
+ }
+
+ struct ReplacingTest : TestCase
+ {
+ const std::string test;
+ const std::string replacing;
+
+ ReplacingTest(const std::string & s, const std::string & r) :
+ TestCase(s),
+ test(s),
+ replacing(r)
+ {
+ }
+
+ unsigned max_run_time() const
+ {
+ return 3000;
+ }
+
+ bool repeatable() const
+ {
+ return false;
+ }
+
+ void run()
+ {
+ TestEnvironment env;
+ env.set_paludis_command("/bin/false");
+ std::tr1::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ keys->insert("format", "ebuild");
+ keys->insert("names_cache", "/var/empty");
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_replacing_dir" / "repo1"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_replacing_dir" / "repo1/profiles/profile"));
+ keys->insert("layout", "exheres");
+ keys->insert("eapi_when_unknown", "exheres-0");
+ keys->insert("eapi_when_unspecified", "exheres-0");
+ keys->insert("profile_eapi", "exheres-0");
+ keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_replacing_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_replacing_dir" / "build"));
+ std::tr1::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
+ std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
+ env.package_database()->add_repository(1, repo);
+
+ std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(&env, RepositoryName("installed")));
+ installed_repo->add_version("cat", "pkg", "1")->set_slot(SlotName("1"));
+ installed_repo->add_version("cat", "pkg", "2")->set_slot(SlotName("2"));
+ installed_repo->add_version("cat", "pkg", "3")->set_slot(SlotName("3"));
+ env.package_database()->add_repository(2, installed_repo);
+
+ const std::tr1::shared_ptr<const PackageIDSequence> rlist(env[selection::AllVersionsSorted(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec(replacing, &env, UserPackageDepSpecOptions())),
+ MatchPackageOptions()))]);
+
+ InstallAction action(make_named_values<InstallActionOptions>(
+ value_for<n::destination>(installed_repo),
+ value_for<n::make_output_manager>(&make_standard_output_manager),
+ value_for<n::perform_uninstall>(&do_uninstall),
+ value_for<n::replacing>(rlist),
+ value_for<n::want_phase>(&want_all_phases)
+ ));
+
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/" + test,
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+ };
+}
+
+namespace test_cases
+{
+ ReplacingTest test_replace_none("replace-none", "cat/none");
+ ReplacingTest test_replace_one("replace-one", "=cat/pkg-1");
+ ReplacingTest test_replace_many("replace-many", "cat/pkg");
+}
+
diff --git a/paludis/repositories/e/e_repository_TEST_replacing_cleanup.sh b/paludis/repositories/e/e_repository_TEST_replacing_cleanup.sh
new file mode 100755
index 0000000..6412383
--- /dev/null
+++ b/paludis/repositories/e/e_repository_TEST_replacing_cleanup.sh
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+# vim: set ft=sh sw=4 sts=4 et :
+
+if [ -d e_repository_TEST_replacing_dir ] ; then
+ rm -fr e_repository_TEST_replacing_dir
+else
+ true
+fi
+
diff --git a/paludis/repositories/e/e_repository_TEST_replacing_setup.sh b/paludis/repositories/e/e_repository_TEST_replacing_setup.sh
new file mode 100755
index 0000000..2bd7f3e
--- /dev/null
+++ b/paludis/repositories/e/e_repository_TEST_replacing_setup.sh
@@ -0,0 +1,59 @@
+#!/usr/bin/env bash
+# vim: set ft=sh sw=4 sts=4 et :
+
+mkdir e_repository_TEST_replacing_dir || exit 1
+cd e_repository_TEST_replacing_dir || exit 1
+
+mkdir -p root/etc
+
+mkdir -p build
+ln -s build symlinked_build
+
+mkdir -p distdir
+
+mkdir -p repo1/{profiles/profile,metadata,eclass} || exit 1
+cd repo1 || exit 1
+echo "test-repo-1" >> profiles/repo_name || exit 1
+echo "cat" >> metadata/categories.conf || exit 1
+cat <<END > profiles/profile/make.defaults
+CHOST="i286-badger-linux-gnu"
+SUBOPTIONS="LINGUAS"
+LINGUAS="en en_GB en_GB@UTF-8"
+USERLAND="GNU"
+OPTIONS="weasel spinach"
+END
+mkdir -p "packages/cat/replace-none"
+cat <<'END' > packages/cat/replace-none/replace-none-1.exheres-0 || exit 1
+WORK="${WORKBASE}"
+PLATFORMS="test"
+FOO=true
+
+pkg_setup() {
+ [[ -z "${REPLACING_IDS}" ]] || die "REPLACING_IDS is ${REPLACING_IDS}"
+}
+END
+mkdir -p "packages/cat/replace-one"
+cat <<'END' > packages/cat/replace-one/replace-one-1.exheres-0 || exit 1
+WORK="${WORKBASE}"
+PLATFORMS="test"
+FOO=true
+
+pkg_setup() {
+ [[ "${REPLACING_IDS}" == "cat/pkg-1:1::installed" ]] || die "REPLACING_IDS is ${REPLACING_IDS}"
+}
+END
+mkdir -p "packages/cat/replace-many"
+cat <<'END' > packages/cat/replace-many/replace-many-1.exheres-0 || exit 1
+WORK="${WORKBASE}"
+PLATFORMS="test"
+FOO=true
+
+pkg_setup() {
+ [[ "${REPLACING_IDS}" == \
+ "cat/pkg-1:1::installed cat/pkg-2:2::installed cat/pkg-3:3::installed" ]] \
+ || die "REPLACING_IDS is ${REPLACING_IDS}"
+}
+END
+cd ..
+cd ..
+
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index 4139b36..c3eb56d 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -84,6 +84,8 @@ namespace
value_for<n::env_p>(check_get(k, "env_p")),
value_for<n::env_pf>(check_get(k, "env_pf")),
value_for<n::env_portdir>(check_get(k, "env_portdir")),
+ value_for<n::env_replaced_by_id>(check_get(k, "env_replaced_by_id")),
+ value_for<n::env_replacing_ids>(check_get(k, "env_replacing_ids")),
value_for<n::env_t>(check_get(k, "env_t")),
value_for<n::env_use>(check_get(k, "env_use")),
value_for<n::env_use_expand>(check_get(k, "env_use_expand")),
diff --git a/paludis/repositories/e/eapi.hh b/paludis/repositories/e/eapi.hh
index 254c2e7..eba7938 100644
--- a/paludis/repositories/e/eapi.hh
+++ b/paludis/repositories/e/eapi.hh
@@ -86,6 +86,8 @@ namespace paludis
struct env_p;
struct env_pf;
struct env_portdir;
+ struct env_replaced_by_id;
+ struct env_replacing_ids;
struct env_t;
struct env_use;
struct env_use_expand;
@@ -272,6 +274,8 @@ namespace paludis
NamedValue<n::env_p, std::string> env_p;
NamedValue<n::env_pf, std::string> env_pf;
NamedValue<n::env_portdir, std::string> env_portdir;
+ NamedValue<n::env_replaced_by_id, std::string> env_replaced_by_id;
+ NamedValue<n::env_replacing_ids, std::string> env_replacing_ids;
NamedValue<n::env_t, std::string> env_t;
NamedValue<n::env_use, std::string> env_use;
NamedValue<n::env_use_expand, std::string> env_use_expand;
diff --git a/paludis/repositories/e/eapis/exheres-0.conf b/paludis/repositories/e/eapis/exheres-0.conf
index cb986ad..2340abe 100644
--- a/paludis/repositories/e/eapis/exheres-0.conf
+++ b/paludis/repositories/e/eapis/exheres-0.conf
@@ -255,6 +255,8 @@ env_p = PNV
env_pf = PNVR
env_filesdir = FILES
env_a = ARCHIVES
+env_replacing_ids = REPLACING_IDS
+env_replaced_by_id = REPLACED_BY_ID
uri_labels = \
default = URIListedThenMirrorsLabel ; \
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index b43b37c..cc1f694 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -738,6 +738,10 @@ EbuildInstallCommand::extend_command(const Command & cmd)
if (! params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_use_expand_hidden().empty())
result.with_setenv(params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_use_expand_hidden(),
install_params.use_expand_hidden());
+ if (! params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_replacing_ids().empty())
+ result.with_setenv(params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_replacing_ids(),
+ join(indirect_iterator(install_params.replacing_ids()->begin()),
+ indirect_iterator(install_params.replacing_ids()->end()), " "));
for (Map<std::string, std::string>::ConstIterator
i(install_params.expand_vars()->begin()),
@@ -785,6 +789,11 @@ EbuildUninstallCommand::extend_command(const Command & cmd)
.with_setenv("PALUDIS_LOAD_ENVIRONMENT", stringify(*uninstall_params.load_environment()))
.with_setenv("PALUDIS_SKIP_INHERIT", "yes");
+ if (! params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_replaced_by_id().empty())
+ if (uninstall_params.replaced_by())
+ result.with_setenv(params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_replaced_by_id(),
+ stringify(*uninstall_params.replaced_by()));
+
return result;
}
diff --git a/paludis/repositories/e/ebuild.hh b/paludis/repositories/e/ebuild.hh
index a00963b..0e923b5 100644
--- a/paludis/repositories/e/ebuild.hh
+++ b/paludis/repositories/e/ebuild.hh
@@ -73,6 +73,8 @@ namespace paludis
struct package_id;
struct portdir;
struct profiles;
+ struct replaced_by;
+ struct replacing_ids;
struct root;
struct sandbox;
struct slot;
@@ -152,6 +154,7 @@ namespace paludis
NamedValue<n::expand_vars, std::tr1::shared_ptr<const Map<std::string, std::string> > > expand_vars;
NamedValue<n::loadsaveenv_dir, FSEntry> loadsaveenv_dir;
NamedValue<n::profiles, std::tr1::shared_ptr<const FSEntrySequence> > profiles;
+ NamedValue<n::replacing_ids, std::tr1::shared_ptr<const PackageIDSequence> > replacing_ids;
NamedValue<n::root, std::string> root;
NamedValue<n::slot, std::string> slot;
NamedValue<n::use, std::string> use;
@@ -205,6 +208,7 @@ namespace paludis
{
NamedValue<n::load_environment, const FSEntry *> load_environment;
NamedValue<n::loadsaveenv_dir, FSEntry> loadsaveenv_dir;
+ NamedValue<n::replaced_by, std::tr1::shared_ptr<const PackageID> > replaced_by;
NamedValue<n::root, std::string> root;
NamedValue<n::unmerge_only, bool> unmerge_only;
};
diff --git a/paludis/repositories/e/ebuild_entries.cc b/paludis/repositories/e/ebuild_entries.cc
index bcca3ff..32bbe7d 100644
--- a/paludis/repositories/e/ebuild_entries.cc
+++ b/paludis/repositories/e/ebuild_entries.cc
@@ -793,6 +793,7 @@ EbuildEntries::install(const std::tr1::shared_ptr<const ERepositoryID> & id,
value_for<n::expand_vars>(expand_vars),
value_for<n::loadsaveenv_dir>(package_builddir / "temp"),
value_for<n::profiles>(_imp->params.profiles()),
+ value_for<n::replacing_ids>(install_action.options.replacing()),
value_for<n::root>(install_action.options.destination()->installed_root_key() ?
stringify(install_action.options.destination()->installed_root_key()->value()) :
"/"),
@@ -820,6 +821,7 @@ EbuildEntries::install(const std::tr1::shared_ptr<const ERepositoryID> & id,
UninstallActionOptions uo(make_named_values<UninstallActionOptions>(
value_for<n::config_protect>(used_config_protect),
+ value_for<n::if_for_install_id>(id),
value_for<n::is_overwrite>(false),
value_for<n::make_output_manager>(std::tr1::bind(&this_output_manager, output_manager, std::tr1::placeholders::_1))
));
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index 4d642ae..7595976 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -412,6 +412,7 @@ ExndbamRepository::merge(const MergeParams & m)
{
UninstallActionOptions uo(make_named_values<UninstallActionOptions>(
value_for<n::config_protect>(config_protect),
+ value_for<n::if_for_install_id>(m.package_id()),
value_for<n::is_overwrite>(true),
value_for<n::make_output_manager>(std::tr1::bind(&this_output_manager, m.output_manager(), std::tr1::placeholders::_1))
));
@@ -430,6 +431,7 @@ ExndbamRepository::merge(const MergeParams & m)
{
UninstallActionOptions uo(make_named_values<UninstallActionOptions>(
value_for<n::config_protect>(config_protect),
+ value_for<n::if_for_install_id>(m.package_id()),
value_for<n::is_overwrite>(false),
value_for<n::make_output_manager>(std::tr1::bind(&this_output_manager, m.output_manager(), std::tr1::placeholders::_1))
));
@@ -544,6 +546,7 @@ ExndbamRepository::perform_uninstall(
make_named_values<EbuildUninstallCommandParams>(
value_for<n::load_environment>(load_env.get()),
value_for<n::loadsaveenv_dir>(ver_dir),
+ value_for<n::replaced_by>(a.options.if_for_install_id()),
value_for<n::root>(stringify(_imp->params.root())),
value_for<n::unmerge_only>(false)
));
diff --git a/paludis/repositories/e/exndbam_repository_TEST.cc b/paludis/repositories/e/exndbam_repository_TEST.cc
index d03bd5f..c8a5621 100644
--- a/paludis/repositories/e/exndbam_repository_TEST.cc
+++ b/paludis/repositories/e/exndbam_repository_TEST.cc
@@ -139,6 +139,7 @@ namespace test_cases
UninstallAction uninstall_action(make_named_values<UninstallActionOptions>(
value_for<n::config_protect>(""),
+ value_for<n::if_for_install_id>(make_null_shared_ptr()),
value_for<n::is_overwrite>(false),
value_for<n::make_output_manager>(&make_standard_output_manager)
));
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index c7de342..9355458 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -470,6 +470,7 @@ VDBRepository::perform_uninstall(
EbuildUninstallCommandParams uninstall_params(make_named_values<EbuildUninstallCommandParams>(
value_for<n::load_environment>(load_env.get()),
value_for<n::loadsaveenv_dir>(pkg_dir),
+ value_for<n::replaced_by>(a.options.if_for_install_id()),
value_for<n::root>(stringify(_imp->params.root())),
value_for<n::unmerge_only>(false)
));
@@ -918,6 +919,7 @@ VDBRepository::merge(const MergeParams & m)
{
UninstallActionOptions uo(make_named_values<UninstallActionOptions>(
value_for<n::config_protect>(config_protect),
+ value_for<n::if_for_install_id>(m.package_id()),
value_for<n::is_overwrite>(true),
value_for<n::make_output_manager>(std::tr1::bind(&this_output_manager, m.output_manager(), std::tr1::placeholders::_1))
));
@@ -936,6 +938,7 @@ VDBRepository::merge(const MergeParams & m)
{
UninstallActionOptions uo(make_named_values<UninstallActionOptions>(
value_for<n::config_protect>(config_protect),
+ value_for<n::if_for_install_id>(m.package_id()),
value_for<n::is_overwrite>(false),
value_for<n::make_output_manager>(std::tr1::bind(&this_output_manager, m.output_manager(), std::tr1::placeholders::_1))
));
diff --git a/paludis/repositories/e/vdb_repository_TEST.cc b/paludis/repositories/e/vdb_repository_TEST.cc
index d703fec..54dd269 100644
--- a/paludis/repositories/e/vdb_repository_TEST.cc
+++ b/paludis/repositories/e/vdb_repository_TEST.cc
@@ -353,6 +353,7 @@ namespace test_cases
UninstallAction uninstall_action(make_named_values<UninstallActionOptions>(
value_for<n::config_protect>(""),
+ value_for<n::if_for_install_id>(make_null_shared_ptr()),
value_for<n::is_overwrite>(false),
value_for<n::make_output_manager>(&make_standard_output_manager)
));
@@ -481,6 +482,7 @@ namespace test_cases
UninstallAction uninstall_action(make_named_values<UninstallActionOptions>(
value_for<n::config_protect>(""),
+ value_for<n::if_for_install_id>(make_null_shared_ptr()),
value_for<n::is_overwrite>(false),
value_for<n::make_output_manager>(&make_standard_output_manager)
));
@@ -609,6 +611,7 @@ namespace test_cases
UninstallAction uninstall_action(make_named_values<UninstallActionOptions>(
value_for<n::config_protect>(""),
+ value_for<n::if_for_install_id>(make_null_shared_ptr()),
value_for<n::is_overwrite>(false),
value_for<n::make_output_manager>(&make_standard_output_manager)
));
@@ -1009,6 +1012,7 @@ namespace test_cases
UninstallAction uninstall_action(make_named_values<UninstallActionOptions>(
value_for<n::config_protect>(""),
+ value_for<n::if_for_install_id>(make_null_shared_ptr()),
value_for<n::is_overwrite>(false),
value_for<n::make_output_manager>(&make_standard_output_manager)
));
@@ -1343,6 +1347,7 @@ namespace test_cases
UninstallAction uninstall_action(make_named_values<UninstallActionOptions>(
value_for<n::config_protect>(""),
+ value_for<n::if_for_install_id>(make_null_shared_ptr()),
value_for<n::is_overwrite>(false),
value_for<n::make_output_manager>(&make_standard_output_manager)
));
diff --git a/paludis/repositories/unpackaged/installed_repository_TEST.cc b/paludis/repositories/unpackaged/installed_repository_TEST.cc
index a677a0c..f61d56b 100644
--- a/paludis/repositories/unpackaged/installed_repository_TEST.cc
+++ b/paludis/repositories/unpackaged/installed_repository_TEST.cc
@@ -262,6 +262,7 @@ namespace test_cases
UninstallAction action(make_named_values<UninstallActionOptions>(
value_for<n::config_protect>(""),
+ value_for<n::if_for_install_id>(make_null_shared_ptr()),
value_for<n::is_overwrite>(false),
value_for<n::make_output_manager>(&make_standard_output_manager)
));
@@ -315,6 +316,7 @@ namespace test_cases
UninstallAction action(make_named_values<UninstallActionOptions>(
value_for<n::config_protect>(""),
+ value_for<n::if_for_install_id>(make_null_shared_ptr()),
value_for<n::is_overwrite>(false),
value_for<n::make_output_manager>(&make_standard_output_manager)
));
@@ -561,6 +563,7 @@ namespace test_cases
UninstallAction action(make_named_values<UninstallActionOptions>(
value_for<n::config_protect>(""),
+ value_for<n::if_for_install_id>(make_null_shared_ptr()),
value_for<n::is_overwrite>(false),
value_for<n::make_output_manager>(&make_standard_output_manager)
));
@@ -605,6 +608,7 @@ namespace test_cases
UninstallAction action(make_named_values<UninstallActionOptions>(
value_for<n::config_protect>(""),
+ value_for<n::if_for_install_id>(make_null_shared_ptr()),
value_for<n::is_overwrite>(false),
value_for<n::make_output_manager>(&make_standard_output_manager)
));
diff --git a/paludis/repositories/unpackaged/unpackaged_id.cc b/paludis/repositories/unpackaged/unpackaged_id.cc
index 77c8f10..f50f733 100644
--- a/paludis/repositories/unpackaged/unpackaged_id.cc
+++ b/paludis/repositories/unpackaged/unpackaged_id.cc
@@ -403,6 +403,7 @@ UnpackagedID::perform_action(Action & action) const
UninstallActionOptions uo(make_named_values<UninstallActionOptions>(
value_for<n::config_protect>(used_config_protect),
+ value_for<n::if_for_install_id>(shared_from_this()),
value_for<n::is_overwrite>(false),
value_for<n::make_output_manager>(std::tr1::bind(&this_output_manager, output_manager, std::tr1::placeholders::_1))
));
diff --git a/paludis/uninstall_task.cc b/paludis/uninstall_task.cc
index 1cb4933..6fb6f3d 100644
--- a/paludis/uninstall_task.cc
+++ b/paludis/uninstall_task.cc
@@ -363,6 +363,7 @@ UninstallTask::execute()
UninstallAction uninstall_action(
make_named_values<UninstallActionOptions>(
value_for<n::config_protect>(""),
+ value_for<n::if_for_install_id>(make_null_shared_ptr()),
value_for<n::is_overwrite>(false),
value_for<n::make_output_manager>(std::tr1::ref(output_manager_holder))
));
diff --git a/python/action.cc b/python/action.cc
index 9e54a2e..862993a 100644
--- a/python/action.cc
+++ b/python/action.cc
@@ -84,6 +84,7 @@ namespace
{
return new UninstallActionOptions(make_named_values<UninstallActionOptions>(
value_for<n::config_protect>(c),
+ value_for<n::if_for_install_id>(make_null_shared_ptr()),
value_for<n::is_overwrite>(false),
value_for<n::make_output_manager>(&make_standard_output_manager)
));
diff --git a/ruby/action.cc b/ruby/action.cc
index f4705e4..8c9c079 100644
--- a/ruby/action.cc
+++ b/ruby/action.cc
@@ -631,6 +631,7 @@ namespace
ptr = new UninstallActionOptions(make_named_values<UninstallActionOptions>(
value_for<n::config_protect>(v_config_protect),
+ value_for<n::if_for_install_id>(make_null_shared_ptr()),
value_for<n::is_overwrite>(false),
value_for<n::make_output_manager>(&make_standard_output_manager)
));