aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-13 18:02:44 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-13 18:02:44 +0100
commit68f2de2c2c795832607bfbe9249affd36faac431 (patch)
tree69be5cbe7045cca9ba271c732411f29fd750f8ce
parentef75cff538e62392f02391329bad533ce9adf662 (diff)
downloadpaludis-68f2de2c2c795832607bfbe9249affd36faac431.tar.gz
paludis-68f2de2c2c795832607bfbe9249affd36faac431.tar.xz
Kill InstalledAction
-rw-r--r--doc/api/cplusplus/examples/example_contents.cc2
-rw-r--r--doc/api/cplusplus/examples/example_dep_label.cc3
-rw-r--r--doc/api/cplusplus/examples/example_dep_spec_flattener.cc3
-rw-r--r--doc/api/cplusplus/examples/example_match_package.cc3
-rw-r--r--doc/api/cplusplus/examples/example_package_id.cc4
-rw-r--r--doc/api/cplusplus/examples/example_selection.cc2
-rw-r--r--doc/api/ruby/example_contents.rb18
-rw-r--r--doc/api/ruby/example_dep_tree.rb2
-rw-r--r--doc/api/ruby/example_match_package.rb2
-rw-r--r--doc/api/ruby/example_package_id.rb1
-rw-r--r--doc/api/ruby/example_selection.rb2
-rw-r--r--paludis/action-fwd.hh1
-rw-r--r--paludis/action.cc5
-rw-r--r--paludis/action.hh20
-rw-r--r--paludis/action_names.cc3
-rw-r--r--paludis/action_names.hh8
-rw-r--r--paludis/dep_list.cc12
-rw-r--r--paludis/environments/paludis/action_to_string.cc5
-rw-r--r--paludis/filter.cc7
-rw-r--r--paludis/filter.hh1
-rw-r--r--paludis/filter_TEST.cc14
-rw-r--r--paludis/generator.cc1
-rw-r--r--paludis/generator_TEST.cc15
-rw-r--r--paludis/install_task.cc4
-rw-r--r--paludis/literal_metadata_key.cc3
-rw-r--r--paludis/match_package.cc2
-rw-r--r--paludis/package_database_TEST.cc2
-rw-r--r--paludis/repositories/accounts/accounts_repository.cc5
-rw-r--r--paludis/repositories/accounts/installed_accounts_id.cc4
-rw-r--r--paludis/repositories/cran/cran_installed_repository.cc5
-rw-r--r--paludis/repositories/cran/cran_package_id.cc5
-rw-r--r--paludis/repositories/cran/cran_repository.cc5
-rw-r--r--paludis/repositories/cran/keys.cc3
-rw-r--r--paludis/repositories/e/dep_parser.cc4
-rw-r--r--paludis/repositories/e/depend_rdepend_TEST.cc12
-rw-r--r--paludis/repositories/e/e_installed_repository.cc5
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc9
-rw-r--r--paludis/repositories/e/e_repository.cc5
-rw-r--r--paludis/repositories/e/e_repository_TEST_replacing.cc2
-rw-r--r--paludis/repositories/e/e_repository_news.cc2
-rw-r--r--paludis/repositories/e/e_repository_sets.cc2
-rw-r--r--paludis/repositories/e/ebuild_id.cc11
-rw-r--r--paludis/repositories/fake/fake_installed_repository.cc5
-rw-r--r--paludis/repositories/fake/fake_package_id.cc7
-rw-r--r--paludis/repositories/fake/fake_repository.cc5
-rw-r--r--paludis/repositories/gems/gem_specification.cc7
-rw-r--r--paludis/repositories/gems/gems_repository.cc5
-rw-r--r--paludis/repositories/gems/installed_gems_repository.cc5
-rw-r--r--paludis/repositories/unavailable/unavailable_repository.cc5
-rw-r--r--paludis/repositories/unpackaged/installed_id.cc9
-rw-r--r--paludis/repositories/unpackaged/installed_repository.cc5
-rw-r--r--paludis/repositories/unpackaged/installed_repository_TEST.cc2
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository_TEST.cc2
-rw-r--r--paludis/repositories/unwritten/unwritten_repository.cc5
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc5
-rw-r--r--paludis/repositories/virtuals/package_id.cc7
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc5
-rw-r--r--paludis/resolver/resolver.cc10
-rw-r--r--paludis/show_suggest_visitor.cc4
-rw-r--r--paludis/uninstall_task.cc2
-rw-r--r--python/action.cc12
-rwxr-xr-xpython/action_TEST.py5
-rw-r--r--python/filter.cc3
-rwxr-xr-xpython/package_id_TEST.py2
-rwxr-xr-xpython/repository_TEST.py2
-rw-r--r--ruby/action.cc42
-rw-r--r--ruby/dep_spec_TEST.rb2
-rw-r--r--ruby/environment_TEST.rb2
-rw-r--r--ruby/filter.cc2
-rw-r--r--ruby/generator.cc4
-rw-r--r--ruby/package_database_TEST.rb4
-rw-r--r--ruby/paludis_ruby.hh1
-rw-r--r--ruby/repository_TEST.rb2
-rw-r--r--src/clients/cave/cmd_print_ids.cc3
-rw-r--r--src/clients/cave/cmd_print_owners.cc3
-rw-r--r--src/clients/cave/cmd_resolve.cc4
-rw-r--r--src/clients/cave/cmd_show.cc4
-rw-r--r--src/clients/inquisitio/do_search.cc17
-rw-r--r--src/clients/paludis/applets.cc3
-rw-r--r--src/clients/paludis/owner.cc3
-rw-r--r--src/output/console_install_task.cc6
81 files changed, 86 insertions, 359 deletions
diff --git a/doc/api/cplusplus/examples/example_contents.cc b/doc/api/cplusplus/examples/example_contents.cc
index 57381fe..8ddf208 100644
--- a/doc/api/cplusplus/examples/example_contents.cc
+++ b/doc/api/cplusplus/examples/example_contents.cc
@@ -72,7 +72,7 @@ int main(int argc, char * argv[])
/* Fetch package IDs for installed 'sys-apps/paludis'. */
std::tr1::shared_ptr<const PackageIDSequence> ids((*env)[selection::AllVersionsSorted(
generator::Package(QualifiedPackageName("sys-apps/paludis")) |
- filter::SupportsAction<InstalledAction>())]);
+ filter::InstalledAtRoot(FSEntry("/")))]);
/* For each ID: */
for (PackageIDSet::ConstIterator i(ids->begin()), i_end(ids->end()) ;
diff --git a/doc/api/cplusplus/examples/example_dep_label.cc b/doc/api/cplusplus/examples/example_dep_label.cc
index e6a957b..bc019ef 100644
--- a/doc/api/cplusplus/examples/example_dep_label.cc
+++ b/doc/api/cplusplus/examples/example_dep_label.cc
@@ -154,7 +154,8 @@ int main(int argc, char * argv[])
/* Fetch package IDs for all installed packages. */
std::tr1::shared_ptr<const PackageIDSequence> ids((*env)[selection::AllVersionsUnsorted(
- generator::All() | filter::SupportsAction<InstalledAction>())]);
+ generator::All() |
+ filter::InstalledAtRoot(FSEntry("/")))]);
/* Store a map from distfile name to whether it is fetch restricted. */
ResultsMap results;
diff --git a/doc/api/cplusplus/examples/example_dep_spec_flattener.cc b/doc/api/cplusplus/examples/example_dep_spec_flattener.cc
index 6b43d96..06c57fb 100644
--- a/doc/api/cplusplus/examples/example_dep_spec_flattener.cc
+++ b/doc/api/cplusplus/examples/example_dep_spec_flattener.cc
@@ -43,7 +43,8 @@ int main(int argc, char * argv[])
/* Fetch package IDs for all installed packages. */
std::tr1::shared_ptr<const PackageIDSequence> ids((*env)[selection::AllVersionsSorted(
- generator::All() | filter::SupportsAction<InstalledAction>())]);
+ generator::All() |
+ filter::InstalledAtRoot(FSEntry("/")))]);
/* For each ID: */
for (PackageIDSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ;
diff --git a/doc/api/cplusplus/examples/example_match_package.cc b/doc/api/cplusplus/examples/example_match_package.cc
index 21b5346..25240a8 100644
--- a/doc/api/cplusplus/examples/example_match_package.cc
+++ b/doc/api/cplusplus/examples/example_match_package.cc
@@ -41,7 +41,8 @@ int main(int argc, char * argv[])
/* Fetch all installed packages. */
std::tr1::shared_ptr<const PackageIDSequence> ids((*env)[selection::AllVersionsSorted(
- generator::All() | filter::SupportsAction<InstalledAction>())]);
+ generator::All() |
+ filter::InstalledAtRoot(FSEntry("/")))]);
/* Fetch the 'system' and 'world' sets. Ordinarily we should check for
* zero pointers here, but these two sets will always exist. */
diff --git a/doc/api/cplusplus/examples/example_package_id.cc b/doc/api/cplusplus/examples/example_package_id.cc
index d05846b..7ed8d61 100644
--- a/doc/api/cplusplus/examples/example_package_id.cc
+++ b/doc/api/cplusplus/examples/example_package_id.cc
@@ -93,10 +93,6 @@ int main(int argc, char * argv[])
if ((*i)->supports_action(install_action))
actions.insert("install");
- SupportsActionTest<InstalledAction> installed_action;
- if ((*i)->supports_action(installed_action))
- actions.insert("installed");
-
SupportsActionTest<UninstallAction> uninstall_action;
if ((*i)->supports_action(uninstall_action))
actions.insert("uninstall");
diff --git a/doc/api/cplusplus/examples/example_selection.cc b/doc/api/cplusplus/examples/example_selection.cc
index 05f299d..5d60b1b 100644
--- a/doc/api/cplusplus/examples/example_selection.cc
+++ b/doc/api/cplusplus/examples/example_selection.cc
@@ -70,7 +70,7 @@ int main(int argc, char * argv[])
show_selection(env, selection::AllVersionsSorted(
generator::Matches(make_package_dep_spec(PartiallyMadePackageDepSpecOptions()).package(
QualifiedPackageName("sys-apps/paludis")), MatchPackageOptions()) |
- filter::SupportsAction<InstalledAction>()));
+ filter::InstalledAtRoot(FSEntry("/"))));
/* Filters can be combined. Usually filter::NotMasked should be combined
* with filter::SupportsAction<InstallAction>, since installed packages
diff --git a/doc/api/ruby/example_contents.rb b/doc/api/ruby/example_contents.rb
index c748c5c..82c758d 100644
--- a/doc/api/ruby/example_contents.rb
+++ b/doc/api/ruby/example_contents.rb
@@ -19,7 +19,7 @@ env = EnvironmentFactory.instance.create(ExampleCommandLine.instance.environment
# Fetch package IDs for installed 'sys-apps/paludis'
ids = env[Selection::AllVersionsSorted.new(
Generator::Matches.new(Paludis::parse_user_package_dep_spec("sys-apps/paludis", env, []), []) |
- Filter::SupportsAction.new(InstalledAction))]
+ Filter::InstalledAtRoot.new("/"))]
# For each ID:
ids.each do | id |
@@ -33,23 +33,17 @@ ids.each do | id |
id.contents_key.value.each do | c |
# Some ContentsEntry subclasses contain more information than others
- if c.kind_of? ContentsDevEntry
- puts "device #{c.name}"
-
- elsif c.kind_of? ContentsMiscEntry
- puts "misc #{c.name}"
+ if c.kind_of? ContentsOtherEntry
+ puts "other #{c.location_key.value}"
elsif c.kind_of? ContentsFileEntry
- puts "file #{c.name}"
+ puts "file #{c.location_key.value}"
elsif c.kind_of? ContentsDirEntry
- puts "dir #{c.name}"
-
- elsif c.kind_of? ContentsFifoEntry
- puts "fifo #{c.name}"
+ puts "dir #{c.location_key.value}"
elsif c.kind_of? ContentsSymEntry
- puts "sym #{c.name} -> #{c.target}"
+ puts "sym #{c.location_key.value} -> #{c.target_key.value}"
else
puts "unknown #{c}"
diff --git a/doc/api/ruby/example_dep_tree.rb b/doc/api/ruby/example_dep_tree.rb
index db8c298..53d3a48 100644
--- a/doc/api/ruby/example_dep_tree.rb
+++ b/doc/api/ruby/example_dep_tree.rb
@@ -116,7 +116,7 @@ env = EnvironmentFactory.instance.create(ExampleCommandLine.instance.environment
# Fetch package IDs for all installed packages.
ids = env[Selection::AllVersionsSorted.new(
- Generator::All.new | Filter::SupportsAction.new(InstalledAction))]
+ Generator::All.new | Filter::InstalledAtRoot.new("/"))]
# Our results table, mapping the ID to { :has_dep => ?, :has_ext => ? }
results = { }
diff --git a/doc/api/ruby/example_match_package.rb b/doc/api/ruby/example_match_package.rb
index 293eb7b..7a448be 100644
--- a/doc/api/ruby/example_match_package.rb
+++ b/doc/api/ruby/example_match_package.rb
@@ -18,7 +18,7 @@ env = EnvironmentFactory.instance.create(ExampleCommandLine.instance.environment
# Fetch all installed packages
ids = env[Selection::AllVersionsSorted.new(
- Generator::All.new | Filter::SupportsAction.new(InstalledAction))]
+ Generator::All.new | Filter::InstalledAtRoot.new("/"))]
# Fetch the 'system' and 'world' sets. Ordinarily we should check for
# Nil here, but these two sets will always exist.
diff --git a/doc/api/ruby/example_package_id.rb b/doc/api/ruby/example_package_id.rb
index 112f4af..0d3b2f3 100644
--- a/doc/api/ruby/example_package_id.rb
+++ b/doc/api/ruby/example_package_id.rb
@@ -58,7 +58,6 @@ ids.each do | id |
# doing.
actions = []
actions << "install" if id.supports_action(SupportsActionTest.new(InstallAction))
- actions << "installed" if id.supports_action(SupportsActionTest.new(InstalledAction))
actions << "uninstall" if id.supports_action(SupportsActionTest.new(UninstallAction))
actions << "pretend" if id.supports_action(SupportsActionTest.new(PretendAction))
actions << "config" if id.supports_action(SupportsActionTest.new(ConfigAction))
diff --git a/doc/api/ruby/example_selection.rb b/doc/api/ruby/example_selection.rb
index 67ea707..7a61030 100644
--- a/doc/api/ruby/example_selection.rb
+++ b/doc/api/ruby/example_selection.rb
@@ -40,7 +40,7 @@ show_selection(env, Selection::AllVersionsSorted.new(
# the code internally to avoid doing excess work.
show_selection(env, Selection::AllVersionsSorted.new(
Generator::Matches.new(parse_user_package_dep_spec("sys-apps/paludis", env, []), []) |
- Filter::SupportsAction.new(InstalledAction)))
+ Filter::InstalledAtRoot.new("/")))
# Filters can be combined. Usually Filter::NotMasked should be combined
# with Filter::SupportsAction.new(InstallAction), since installed packages
diff --git a/paludis/action-fwd.hh b/paludis/action-fwd.hh
index 127d785..e26dc79 100644
--- a/paludis/action-fwd.hh
+++ b/paludis/action-fwd.hh
@@ -34,7 +34,6 @@ namespace paludis
{
class Action;
class InstallAction;
- class InstalledAction;
class UninstallAction;
class PretendAction;
class ConfigAction;
diff --git a/paludis/action.cc b/paludis/action.cc
index 92a8e3c..b40a1ce 100644
--- a/paludis/action.cc
+++ b/paludis/action.cc
@@ -248,11 +248,6 @@ namespace
return "pretend";
}
- std::string visit(const InstalledAction &)
- {
- return "installed";
- }
-
std::string visit(const ConfigAction &)
{
return "config";
diff --git a/paludis/action.hh b/paludis/action.hh
index 50e19de..9ab9062 100644
--- a/paludis/action.hh
+++ b/paludis/action.hh
@@ -218,7 +218,7 @@ namespace paludis
*/
class PALUDIS_VISIBLE Action :
public virtual DeclareAbstractAcceptMethods<Action, MakeTypeList<
- InstallAction, InstalledAction, UninstallAction, PretendAction, ConfigAction, FetchAction,
+ InstallAction, UninstallAction, PretendAction, ConfigAction, FetchAction,
InfoAction, PretendFetchAction>::Type>
{
public:
@@ -308,22 +308,6 @@ namespace paludis
};
/**
- * InstalledAction is a dummy action used by SupportsActionTest and
- * query::SupportsAction to determine whether a PackageID is installed.
- *
- * Performing an InstalledAction does not make sense and will do nothing.
- *
- * \since 0.26
- * \ingroup g_actions
- * \nosubgrouping
- */
- class PALUDIS_VISIBLE InstalledAction :
- public Action,
- public ImplementAcceptMethods<Action, InstalledAction>
- {
- };
-
- /**
* Options for a PretendAction.
*
* \see PretendAction
@@ -525,7 +509,7 @@ namespace paludis
*/
class PALUDIS_VISIBLE SupportsActionTestBase :
public virtual DeclareAbstractAcceptMethods<SupportsActionTestBase, MakeTypeList<
- SupportsActionTest<InstallAction>, SupportsActionTest<InstalledAction>, SupportsActionTest<UninstallAction>,
+ SupportsActionTest<InstallAction>, SupportsActionTest<UninstallAction>,
SupportsActionTest<PretendAction>, SupportsActionTest<ConfigAction>, SupportsActionTest<FetchAction>,
SupportsActionTest<InfoAction>, SupportsActionTest<PretendFetchAction> >::Type>
{
diff --git a/paludis/action_names.cc b/paludis/action_names.cc
index f90dec3..6f0a0cf 100644
--- a/paludis/action_names.cc
+++ b/paludis/action_names.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 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
@@ -22,7 +22,6 @@
using namespace paludis;
const char * const ActionNames<InstallAction>::value = "install";
-const char * const ActionNames<InstalledAction>::value = "installed";
const char * const ActionNames<UninstallAction>::value = "uninstall";
const char * const ActionNames<ConfigAction>::value = "config";
const char * const ActionNames<PretendAction>::value = "pretend";
diff --git a/paludis/action_names.hh b/paludis/action_names.hh
index 0510ddd..166eb48 100644
--- a/paludis/action_names.hh
+++ b/paludis/action_names.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 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
@@ -33,12 +33,6 @@ namespace paludis
};
template <>
- struct PALUDIS_VISIBLE ActionNames<InstalledAction>
- {
- static const char * const value;
- };
-
- template <>
struct PALUDIS_VISIBLE ActionNames<UninstallAction>
{
static const char * const value;
diff --git a/paludis/dep_list.cc b/paludis/dep_list.cc
index 22cc741..c5f2879 100644
--- a/paludis/dep_list.cc
+++ b/paludis/dep_list.cc
@@ -292,7 +292,7 @@ namespace
{
return ! env[selection::SomeArbitraryVersion(
generator::Package(*u->spec()->package_ptr()) |
- filter::SupportsAction<InstalledAction>())]->empty();
+ filter::InstalledAtRoot(env.root()))]->empty();
}
else
return false;
@@ -392,7 +392,8 @@ DepList::AddVisitor::visit(const DependencySpecTree::NodeType<PackageDepSpec>::T
/* find already installed things */
// TODO: check destinations
std::tr1::shared_ptr<const PackageIDSequence> already_installed((*d->_imp->env)[selection::AllVersionsSorted(
- generator::Matches(*node.spec(), d->_imp->opts->match_package_options()) | filter::SupportsAction<InstalledAction>())]);
+ generator::Matches(*node.spec(), d->_imp->opts->match_package_options()) |
+ filter::InstalledAtRoot(d->_imp->env->root()))]);
/* are we already on the merge list? */
std::pair<MergeListIndex::iterator, MergeListIndex::iterator> q;
@@ -626,7 +627,7 @@ DepList::AddVisitor::visit(const DependencySpecTree::NodeType<PackageDepSpec>::T
std::tr1::shared_ptr<const PackageIDSequence> are_we_downgrading(
(*d->_imp->env)[selection::AllVersionsSorted(
generator::Package(best_visible_candidate->name()) |
- filter::SupportsAction<InstalledAction>() |
+ filter::InstalledAtRoot(d->_imp->env->root()) |
filter::SameSlot(best_visible_candidate))]);
if (are_we_downgrading->empty())
@@ -833,7 +834,7 @@ DepList::AddVisitor::visit(const DependencySpecTree::NodeType<BlockDepSpec>::Typ
*node.spec()->blocked_spec()->package_ptr()));
already_installed = (*d->_imp->env)[selection::AllVersionsUnsorted(
generator::Matches(just_package, d->_imp->opts->match_package_options()) |
- filter::SupportsAction<InstalledAction>())];
+ filter::InstalledAtRoot(d->_imp->env->root()))];
MatchDepListEntryAgainstPackageDepSpec m(d->_imp->env, just_package, d->_imp->opts->match_package_options());
for (std::pair<MergeListIndex::const_iterator, MergeListIndex::const_iterator> p(
@@ -858,7 +859,8 @@ DepList::AddVisitor::visit(const DependencySpecTree::NodeType<BlockDepSpec>::Typ
check_whole_list = true;
/* TODO: InstalledAtRoot? */
already_installed = (*d->_imp->env)[selection::AllVersionsUnsorted(
- generator::All() | filter::SupportsAction<InstalledAction>())];
+ generator::All() |
+ filter::InstalledAtRoot(d->_imp->env->root()))];
}
if (already_installed->empty() && will_be_installed.empty() && ! check_whole_list)
diff --git a/paludis/environments/paludis/action_to_string.cc b/paludis/environments/paludis/action_to_string.cc
index 2058c5d..dc38c1b 100644
--- a/paludis/environments/paludis/action_to_string.cc
+++ b/paludis/environments/paludis/action_to_string.cc
@@ -60,11 +60,6 @@ namespace
{
return "config";
}
-
- std::string visit(const InstalledAction &) const
- {
- return "installed";
- }
};
}
diff --git a/paludis/filter.cc b/paludis/filter.cc
index 60f0853..1083841 100644
--- a/paludis/filter.cc
+++ b/paludis/filter.cc
@@ -208,8 +208,7 @@ namespace
r != r_end ; ++r)
{
const std::tr1::shared_ptr<const Repository> repo(env->package_database()->fetch_repository(*r));
- if (repo->installed_root_key() && root == repo->installed_root_key()->value() &&
- repo->some_ids_might_support_action(SupportsActionTest<InstalledAction>()))
+ if (repo->installed_root_key() && root == repo->installed_root_key()->value())
result->insert(*r);
}
@@ -223,8 +222,7 @@ namespace
for (PackageIDSet::ConstIterator i(id->begin()), i_end(id->end()) ;
i != i_end ; ++i)
- if ((*i)->supports_action(SupportsActionTest<InstalledAction>()))
- result->insert(*i);
+ result->insert(*i);
return result;
}
@@ -425,7 +423,6 @@ paludis::operator<< (std::ostream & s, const Filter & f)
template class PrivateImplementationPattern<Filter>;
template class filter::SupportsAction<InstallAction>;
-template class filter::SupportsAction<InstalledAction>;
template class filter::SupportsAction<UninstallAction>;
template class filter::SupportsAction<PretendAction>;
template class filter::SupportsAction<ConfigAction>;
diff --git a/paludis/filter.hh b/paludis/filter.hh
index 1078d09..7e3b375 100644
--- a/paludis/filter.hh
+++ b/paludis/filter.hh
@@ -133,7 +133,6 @@ namespace paludis
#ifdef PALUDIS_HAVE_EXTERN_TEMPLATE
extern template class PrivateImplementationPattern<Filter>;
extern template class filter::SupportsAction<InstallAction>;
- extern template class filter::SupportsAction<InstalledAction>;
extern template class filter::SupportsAction<UninstallAction>;
extern template class filter::SupportsAction<PretendAction>;
extern template class filter::SupportsAction<ConfigAction>;
diff --git a/paludis/filter_TEST.cc b/paludis/filter_TEST.cc
index 3af2cdf..e4afd34 100644
--- a/paludis/filter_TEST.cc
+++ b/paludis/filter_TEST.cc
@@ -126,20 +126,6 @@ namespace test_cases
}
} supports_install_action_filter_test;
- struct SupportsInstalledActionFilterTestCase : FilterTestCaseBase
- {
- SupportsInstalledActionFilterTestCase() :
- FilterTestCaseBase("supports installed action", filter::SupportsAction<InstalledAction>())
- {
- }
-
- virtual std::string get_expected() const
- {
- return
- "cat/a-1:0::inst_repo1";
- }
- } supports_installed_action_filter_test;
-
struct SupportsInstalledAtRootFilterTestCase : FilterTestCaseBase
{
SupportsInstalledAtRootFilterTestCase() :
diff --git a/paludis/generator.cc b/paludis/generator.cc
index da133ad..f272d40 100644
--- a/paludis/generator.cc
+++ b/paludis/generator.cc
@@ -653,7 +653,6 @@ paludis::operator<< (std::ostream & s, const Generator & g)
template class PrivateImplementationPattern<Generator>;
template class generator::SomeIDsMightSupportAction<InstallAction>;
-template class generator::SomeIDsMightSupportAction<InstalledAction>;
template class generator::SomeIDsMightSupportAction<UninstallAction>;
template class generator::SomeIDsMightSupportAction<PretendAction>;
template class generator::SomeIDsMightSupportAction<ConfigAction>;
diff --git a/paludis/generator_TEST.cc b/paludis/generator_TEST.cc
index 9868ec2..6a7f971 100644
--- a/paludis/generator_TEST.cc
+++ b/paludis/generator_TEST.cc
@@ -311,20 +311,5 @@ namespace test_cases
"cat/c-3:0::repo2";
}
} some_ids_might_support_install_action_generator_test;
-
- struct SomeIDsMightSupportInstalledActionGeneratorTestCase : GeneratorTestCaseBase
- {
- SomeIDsMightSupportInstalledActionGeneratorTestCase() :
- GeneratorTestCaseBase("some IDs might support installed",
- generator::SomeIDsMightSupportAction<InstalledAction>())
- {
- }
-
- virtual std::string get_expected() const
- {
- return
- "cat/a-1:0::inst_repo1";
- }
- } some_ids_might_support_installed_action_generator_test;
}
diff --git a/paludis/install_task.cc b/paludis/install_task.cc
index 2b5ea12..8207d03 100644
--- a/paludis/install_task.cc
+++ b/paludis/install_task.cc
@@ -1490,7 +1490,7 @@ namespace
{
if (! failure)
if ((*env)[selection::SomeArbitraryVersion(generator::Matches(*node.spec(), MatchPackageOptions())
- | filter::SupportsAction<InstalledAction>())]->empty())
+ | filter::InstalledAtRoot(env->root()))]->empty())
failure = node.spec();
}
@@ -1695,7 +1695,7 @@ namespace
* there are no matches here it's not a problem because of or-deps. */
std::tr1::shared_ptr<const PackageIDSequence> installed((*env)[selection::AllVersionsUnsorted(
generator::Matches(*node.spec(), MatchPackageOptions()) |
- filter::SupportsAction<InstalledAction>())]);
+ filter::InstalledAtRoot(env->root()))]);
for (PackageIDSequence::ConstIterator i(installed->begin()), i_end(installed->end()) ;
i != i_end ; ++i)
diff --git a/paludis/literal_metadata_key.cc b/paludis/literal_metadata_key.cc
index f6321bc..b85f391 100644
--- a/paludis/literal_metadata_key.cc
+++ b/paludis/literal_metadata_key.cc
@@ -26,6 +26,7 @@
#include <paludis/formatter.hh>
#include <paludis/package_id.hh>
#include <paludis/action.hh>
+#include <paludis/repository.hh>
#include <paludis/name.hh>
#include <tr1/functional>
@@ -308,7 +309,7 @@ std::string
ExtraLiteralMetadataValueKeyMethods<std::tr1::shared_ptr<const PackageID> >::pretty_print(const Formatter<PackageID> & f) const
{
std::tr1::shared_ptr<const PackageID> v(static_cast<const LiteralMetadataValueKey<std::tr1::shared_ptr<const PackageID> > *>(this)->value());
- if (v->supports_action(SupportsActionTest<InstalledAction>()))
+ if (v->repository()->installed_root_key())
return f.format(*v, format::Installed());
else if (v->supports_action(SupportsActionTest<InstallAction>()))
{
diff --git a/paludis/match_package.cc b/paludis/match_package.cc
index cb12011..d6b7537 100644
--- a/paludis/match_package.cc
+++ b/paludis/match_package.cc
@@ -139,8 +139,6 @@ paludis::match_package(
return false;
if (entry.repository()->installed_root_key()->value() != *spec.installed_at_path_ptr())
return false;
- if (! entry.supports_action(SupportsActionTest<InstalledAction>()))
- return false;
}
if (spec.installable_to_repository_ptr())
diff --git a/paludis/package_database_TEST.cc b/paludis/package_database_TEST.cc
index dbb795f..3126f2e 100644
--- a/paludis/package_database_TEST.cc
+++ b/paludis/package_database_TEST.cc
@@ -189,7 +189,7 @@ namespace test_cases
NoSuchPackageError);
TEST_CHECK_THROWS(p.fetch_unique_qualified_package_name(PackageNamePart("pkg-one"),
- filter::SupportsAction<InstalledAction>()),
+ filter::SupportsAction<ConfigAction>()),
NoSuchPackageError);
TEST_CHECK_STRINGIFY_EQUAL(p.fetch_unique_qualified_package_name(PackageNamePart("pkg-foo")),
"inst-cat/pkg-foo");
diff --git a/paludis/repositories/accounts/accounts_repository.cc b/paludis/repositories/accounts/accounts_repository.cc
index ee4e955..77e7689 100644
--- a/paludis/repositories/accounts/accounts_repository.cc
+++ b/paludis/repositories/accounts/accounts_repository.cc
@@ -346,11 +346,6 @@ namespace
{
}
- bool visit(const SupportsActionTest<InstalledAction> &) const
- {
- return installed;
- }
-
bool visit(const SupportsActionTest<InstallAction> &) const
{
return ! installed;
diff --git a/paludis/repositories/accounts/installed_accounts_id.cc b/paludis/repositories/accounts/installed_accounts_id.cc
index fa4e914..38f5671 100644
--- a/paludis/repositories/accounts/installed_accounts_id.cc
+++ b/paludis/repositories/accounts/installed_accounts_id.cc
@@ -354,9 +354,9 @@ InstalledAccountsID::extra_hash_value() const
}
bool
-InstalledAccountsID::supports_action(const SupportsActionTestBase & test) const
+InstalledAccountsID::supports_action(const SupportsActionTestBase &) const
{
- return simple_visitor_cast<const SupportsActionTest<InstalledAction> >(test);
+ return false;
}
void
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index bf0384c..884fb22 100644
--- a/paludis/repositories/cran/cran_installed_repository.cc
+++ b/paludis/repositories/cran/cran_installed_repository.cc
@@ -492,11 +492,6 @@ namespace
{
struct SupportsActionQuery
{
- bool visit(const SupportsActionTest<InstalledAction> &) const
- {
- return true;
- }
-
bool visit(const SupportsActionTest<InstallAction> &) const
{
return false;
diff --git a/paludis/repositories/cran/cran_package_id.cc b/paludis/repositories/cran/cran_package_id.cc
index 9353dce..d64527a 100644
--- a/paludis/repositories/cran/cran_package_id.cc
+++ b/paludis/repositories/cran/cran_package_id.cc
@@ -476,11 +476,6 @@ namespace
{
}
- bool visit(const SupportsActionTest<InstalledAction> &) const
- {
- return false;
- }
-
bool visit(const SupportsActionTest<FetchAction> &) const
{
return cran_repository;
diff --git a/paludis/repositories/cran/cran_repository.cc b/paludis/repositories/cran/cran_repository.cc
index 3bdde14..f2dfd53 100644
--- a/paludis/repositories/cran/cran_repository.cc
+++ b/paludis/repositories/cran/cran_repository.cc
@@ -473,11 +473,6 @@ namespace
{
struct SupportsActionQuery
{
- bool visit(const SupportsActionTest<InstalledAction> &) const
- {
- return false;
- }
-
bool visit(const SupportsActionTest<InstallAction> &) const
{
return true;
diff --git a/paludis/repositories/cran/keys.cc b/paludis/repositories/cran/keys.cc
index 7a1ee4b..3c6f4c2 100644
--- a/paludis/repositories/cran/keys.cc
+++ b/paludis/repositories/cran/keys.cc
@@ -32,6 +32,7 @@
#include <paludis/stringify_formatter-impl.hh>
#include <paludis/formatter.hh>
#include <paludis/action.hh>
+#include <paludis/repository.hh>
#include <tr1/functional>
using namespace paludis;
@@ -123,7 +124,7 @@ PackageIDKey::type() const
std::string
PackageIDKey::pretty_print(const Formatter<PackageID> & f) const
{
- if (_v->supports_action(SupportsActionTest<InstalledAction>()))
+ if (_v->repository()->installed_root_key())
return f.format(*_v, format::Installed());
else if (_v->supports_action(SupportsActionTest<InstallAction>()))
{
diff --git a/paludis/repositories/e/dep_parser.cc b/paludis/repositories/e/dep_parser.cc
index 59fb87d..31ad46a 100644
--- a/paludis/repositories/e/dep_parser.cc
+++ b/paludis/repositories/e/dep_parser.cc
@@ -251,8 +251,8 @@ namespace
const Environment * const env,
const std::tr1::shared_ptr<const PackageID> & id)
{
- std::tr1::shared_ptr<ConditionalDepSpec> spec(new ConditionalDepSpec(parse_elike_conditional_dep_spec(u, env, id,
- id->supports_action(SupportsActionTest<InstalledAction>()))));
+ std::tr1::shared_ptr<ConditionalDepSpec> spec(new ConditionalDepSpec(parse_elike_conditional_dep_spec(
+ u, env, id, id->repository()->installed_root_key())));
stack.push_front(make_named_values<typename ParseStackTypes<T_>::Item>(
value_for<n::item>(stack.begin()->item()->append(spec)),
value_for<n::spec>(spec)
diff --git a/paludis/repositories/e/depend_rdepend_TEST.cc b/paludis/repositories/e/depend_rdepend_TEST.cc
index 6cc45e4..30dcdb6 100644
--- a/paludis/repositories/e/depend_rdepend_TEST.cc
+++ b/paludis/repositories/e/depend_rdepend_TEST.cc
@@ -106,6 +106,8 @@ namespace
TestEnvironment env;
env.set_paludis_command("/bin/false");
+ FSEntry root(FSEntry::cwd() / "depend_rdepend_TEST_dir" / "root");
+
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");
@@ -117,7 +119,7 @@ namespace
keys->insert("profile_eapi", "0");
keys->insert("distdir", stringify(FSEntry::cwd() / "depend_rdepend_TEST_dir" / "distdir"));
keys->insert("builddir", stringify(FSEntry::cwd() / "depend_rdepend_TEST_dir" / "build"));
- keys->insert("root", stringify(FSEntry::cwd() / "depend_rdepend_TEST_dir" / "root"));
+ keys->insert("root", stringify(root));
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);
@@ -127,7 +129,7 @@ namespace
v_keys->insert("names_cache", "/var/empty");
v_keys->insert("provides_cache", "/var/empty");
v_keys->insert("location", stringify(FSEntry::cwd() / "depend_rdepend_TEST_dir" / "vdb"));
- v_keys->insert("root", stringify(FSEntry::cwd() / "depend_rdepend_TEST_dir" / "root"));
+ v_keys->insert("root", stringify(root));
std::tr1::shared_ptr<Repository> v_repo(VDBRepository::repository_factory_create(&env,
std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
env.package_database()->add_repository(1, v_repo);
@@ -170,7 +172,7 @@ namespace
std::tr1::shared_ptr<const PackageID> v_id(*env[selection::RequireExactlyOne(generator::Package(
QualifiedPackageName("cat/eapi" + eapi + "donly")) |
- filter::SupportsAction<InstalledAction>())]->begin());
+ filter::InstalledAtRoot(root))]->begin());
TEST_CHECK_EQUAL(v_id->build_dependencies_key()->pretty_print_flat(f), "the/depend");
if (special)
@@ -192,7 +194,7 @@ namespace
std::tr1::shared_ptr<const PackageID> v_id(*env[selection::RequireExactlyOne(generator::Package(
QualifiedPackageName("cat/eapi" + eapi + "ronly")) |
- filter::SupportsAction<InstalledAction>())]->begin());
+ filter::InstalledAtRoot(root))]->begin());
TEST_CHECK_EQUAL(v_id->build_dependencies_key()->pretty_print_flat(f), "");
TEST_CHECK_EQUAL(v_id->run_dependencies_key()->pretty_print_flat(f), "the/rdepend");
@@ -211,7 +213,7 @@ namespace
std::tr1::shared_ptr<const PackageID> v_id(*env[selection::RequireExactlyOne(generator::Package(
QualifiedPackageName("cat/eapi" + eapi + "both")) |
- filter::SupportsAction<InstalledAction>())]->begin());
+ filter::InstalledAtRoot(root))]->begin());
TEST_CHECK_EQUAL(v_id->build_dependencies_key()->pretty_print_flat(f), "the/depend");
TEST_CHECK_EQUAL(v_id->run_dependencies_key()->pretty_print_flat(f), "the/rdepend");
diff --git a/paludis/repositories/e/e_installed_repository.cc b/paludis/repositories/e/e_installed_repository.cc
index 861dcd1..33d7393 100644
--- a/paludis/repositories/e/e_installed_repository.cc
+++ b/paludis/repositories/e/e_installed_repository.cc
@@ -90,11 +90,6 @@ namespace
return true;
}
- bool visit(const SupportsActionTest<InstalledAction> &) const
- {
- return true;
- }
-
bool visit(const SupportsActionTest<ConfigAction> &) const
{
return true;
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index 0122cda..6b5ef48 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -864,11 +864,6 @@ namespace
{
struct SupportsActionQuery
{
- bool visit(const SupportsActionTest<InstalledAction> &) const
- {
- return true;
- }
-
bool visit(const SupportsActionTest<InstallAction> &) const
{
return false;
@@ -929,10 +924,6 @@ namespace
std::tr1::static_pointer_cast<const EInstalledRepository>(id->repository())->perform_uninstall(id, a);
}
- void visit(const InstalledAction &)
- {
- }
-
void visit(const ConfigAction & a)
{
std::tr1::static_pointer_cast<const EInstalledRepository>(id->repository())->perform_config(id, a);
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index d2d753c..622af1a 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -1174,11 +1174,6 @@ namespace
{
struct SupportsActionQuery
{
- bool visit(const SupportsActionTest<InstalledAction> &) const
- {
- return false;
- }
-
bool visit(const SupportsActionTest<InstallAction> &) const
{
return true;
diff --git a/paludis/repositories/e/e_repository_TEST_replacing.cc b/paludis/repositories/e/e_repository_TEST_replacing.cc
index b20360b..4ac86be 100644
--- a/paludis/repositories/e/e_repository_TEST_replacing.cc
+++ b/paludis/repositories/e/e_repository_TEST_replacing.cc
@@ -139,7 +139,7 @@ namespace
const std::tr1::shared_ptr<const PackageIDSequence> rlist(env[selection::AllVersionsSorted(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec(replacing, &env, UserPackageDepSpecOptions())),
MatchPackageOptions()) |
- filter::SupportsAction<InstalledAction>())]);
+ filter::InstalledAtRoot(env.root()))]);
InstallAction action(make_named_values<InstallActionOptions>(
value_for<n::destination>(installed_repo),
diff --git a/paludis/repositories/e/e_repository_news.cc b/paludis/repositories/e/e_repository_news.cc
index fd5176a..ead7572 100644
--- a/paludis/repositories/e/e_repository_news.cc
+++ b/paludis/repositories/e/e_repository_news.cc
@@ -159,7 +159,7 @@ ERepositoryNews::update_news() const
eapi.supported()->package_dep_spec_parse_options(),
eapi.supported()->version_spec_options(),
std::tr1::shared_ptr<const PackageID>())), MatchPackageOptions()) |
- filter::SupportsAction<InstalledAction>())]->empty())
+ filter::InstalledAtRoot(_imp->environment->root()))]->empty())
local_show = true;
show &= local_show;
}
diff --git a/paludis/repositories/e/e_repository_sets.cc b/paludis/repositories/e/e_repository_sets.cc
index 689fa67..9f90ff4 100644
--- a/paludis/repositories/e/e_repository_sets.cc
+++ b/paludis/repositories/e/e_repository_sets.cc
@@ -296,7 +296,7 @@ ERepositorySets::security_set(bool insecurity) const
else
candidates = (*_imp->environment)[selection::AllVersionsSorted(
generator::Package(glsa_pkg->name()) |
- filter::SupportsAction<InstalledAction>())];
+ filter::InstalledAtRoot(_imp->environment->root()))];
for (PackageIDSequence::ConstIterator c(candidates->begin()), c_end(candidates->end()) ;
c != c_end ; ++c)
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 4cd0dfc..dd238aa 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -1069,11 +1069,6 @@ namespace
{
struct SupportsActionQuery
{
- bool visit(const SupportsActionTest<InstalledAction> &) const
- {
- return false;
- }
-
bool visit(const SupportsActionTest<FetchAction> &) const
{
return true;
@@ -1170,16 +1165,10 @@ namespace
std::tr1::static_pointer_cast<const ERepository>(id->repository())->profile());
}
- void visit(InstalledAction & a) PALUDIS_ATTRIBUTE((noreturn));
void visit(UninstallAction & a) PALUDIS_ATTRIBUTE((noreturn));
void visit(ConfigAction & a) PALUDIS_ATTRIBUTE((noreturn));
};
- void PerformAction::visit(InstalledAction & a)
- {
- throw UnsupportedActionError(*id, a);
- }
-
void PerformAction::visit(UninstallAction & a)
{
throw UnsupportedActionError(*id, a);
diff --git a/paludis/repositories/fake/fake_installed_repository.cc b/paludis/repositories/fake/fake_installed_repository.cc
index 814b729..99ca989 100644
--- a/paludis/repositories/fake/fake_installed_repository.cc
+++ b/paludis/repositories/fake/fake_installed_repository.cc
@@ -148,11 +148,6 @@ namespace
{
}
- bool visit(const SupportsActionTest<InstalledAction> &) const
- {
- return true;
- }
-
bool visit(const SupportsActionTest<InstallAction> &) const
{
return false;
diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc
index 31dd643..74b4098 100644
--- a/paludis/repositories/fake/fake_package_id.cc
+++ b/paludis/repositories/fake/fake_package_id.cc
@@ -1121,13 +1121,6 @@ namespace
throw UnsupportedActionError(*id, a);
}
- void visit(const InstalledAction & a)
- {
- SupportsActionTest<InstalledAction> t;
- if (! id->repository()->some_ids_might_support_action(t))
- throw UnsupportedActionError(*id, a);
- }
-
void visit(const UninstallAction & a)
{
SupportsActionTest<UninstallAction> t;
diff --git a/paludis/repositories/fake/fake_repository.cc b/paludis/repositories/fake/fake_repository.cc
index 765fb28..57d035f 100644
--- a/paludis/repositories/fake/fake_repository.cc
+++ b/paludis/repositories/fake/fake_repository.cc
@@ -126,11 +126,6 @@ namespace
{
struct SupportsActionQuery
{
- bool visit(const SupportsActionTest<InstalledAction> &) const
- {
- return false;
- }
-
bool visit(const SupportsActionTest<InstallAction> &) const
{
return true;
diff --git a/paludis/repositories/gems/gem_specification.cc b/paludis/repositories/gems/gem_specification.cc
index 070b650..526dc22 100644
--- a/paludis/repositories/gems/gem_specification.cc
+++ b/paludis/repositories/gems/gem_specification.cc
@@ -530,13 +530,6 @@ namespace
throw UnsupportedActionError(*id, a);
}
- void visit(const InstalledAction & a)
- {
- SupportsActionTest<InstalledAction> t;
- if (! id->repository()->some_ids_might_support_action(t))
- throw UnsupportedActionError(*id, a);
- }
-
void visit(const UninstallAction & a)
{
SupportsActionTest<UninstallAction> t;
diff --git a/paludis/repositories/gems/gems_repository.cc b/paludis/repositories/gems/gems_repository.cc
index 13530b5..29e3695 100644
--- a/paludis/repositories/gems/gems_repository.cc
+++ b/paludis/repositories/gems/gems_repository.cc
@@ -285,11 +285,6 @@ namespace
{
struct SupportsActionQuery
{
- bool visit(const SupportsActionTest<InstalledAction> &) const
- {
- return false;
- }
-
bool visit(const SupportsActionTest<InstallAction> &) const
{
return true;
diff --git a/paludis/repositories/gems/installed_gems_repository.cc b/paludis/repositories/gems/installed_gems_repository.cc
index 96c5e09..8c3edf0 100644
--- a/paludis/repositories/gems/installed_gems_repository.cc
+++ b/paludis/repositories/gems/installed_gems_repository.cc
@@ -307,11 +307,6 @@ namespace
{
struct SupportsActionQuery
{
- bool visit(const SupportsActionTest<InstalledAction> &) const
- {
- return true;
- }
-
bool visit(const SupportsActionTest<InstallAction> &) const
{
return false;
diff --git a/paludis/repositories/unavailable/unavailable_repository.cc b/paludis/repositories/unavailable/unavailable_repository.cc
index 2ed4b43..96f3c8d 100644
--- a/paludis/repositories/unavailable/unavailable_repository.cc
+++ b/paludis/repositories/unavailable/unavailable_repository.cc
@@ -203,11 +203,6 @@ namespace
{
struct SupportsActionQuery
{
- bool visit(const SupportsActionTest<InstalledAction> &) const
- {
- return false;
- }
-
bool visit(const SupportsActionTest<InstallAction> &) const
{
return true;
diff --git a/paludis/repositories/unpackaged/installed_id.cc b/paludis/repositories/unpackaged/installed_id.cc
index ae53deb..7a821ad 100644
--- a/paludis/repositories/unpackaged/installed_id.cc
+++ b/paludis/repositories/unpackaged/installed_id.cc
@@ -698,11 +698,6 @@ namespace
return true;
}
- bool visit(const SupportsActionTest<InstalledAction> &) const
- {
- return true;
- }
-
bool visit(const SupportsActionTest<ConfigAction> &) const
{
return false;
@@ -773,10 +768,6 @@ namespace
throw UnsupportedActionError(*id, a);
}
- void visit(InstalledAction &)
- {
- }
-
void visit(UninstallAction & a)
{
std::tr1::shared_ptr<OutputManager> output_manager(a.options.make_output_manager()(a));
diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc
index cdb47e0..0935090 100644
--- a/paludis/repositories/unpackaged/installed_repository.cc
+++ b/paludis/repositories/unpackaged/installed_repository.cc
@@ -179,11 +179,6 @@ namespace
return true;
}
- bool visit(const SupportsActionTest<InstalledAction> &) const
- {
- return true;
- }
-
bool visit(const SupportsActionTest<ConfigAction> &) const
{
return false;
diff --git a/paludis/repositories/unpackaged/installed_repository_TEST.cc b/paludis/repositories/unpackaged/installed_repository_TEST.cc
index 40bcf39..8ac1eb9 100644
--- a/paludis/repositories/unpackaged/installed_repository_TEST.cc
+++ b/paludis/repositories/unpackaged/installed_repository_TEST.cc
@@ -221,7 +221,6 @@ namespace test_cases
TEST_CHECK(! repo->some_ids_might_support_action(SupportsActionTest<PretendAction>()));
TEST_CHECK(! repo->some_ids_might_support_action(SupportsActionTest<InfoAction>()));
TEST_CHECK(repo->some_ids_might_support_action(SupportsActionTest<UninstallAction>()));
- TEST_CHECK(repo->some_ids_might_support_action(SupportsActionTest<InstalledAction>()));
const std::tr1::shared_ptr<const PackageID> id1(*env[selection::RequireExactlyOne(
generator::Matches(parse_user_package_dep_spec("cat-one/foo:1",
@@ -232,7 +231,6 @@ namespace test_cases
TEST_CHECK(! id1->supports_action(SupportsActionTest<PretendAction>()));
TEST_CHECK(! id1->supports_action(SupportsActionTest<InfoAction>()));
TEST_CHECK(id1->supports_action(SupportsActionTest<UninstallAction>()));
- TEST_CHECK(id1->supports_action(SupportsActionTest<InstalledAction>()));
}
} test_actions;
diff --git a/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc b/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc
index 3daac95..d82d003 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc
+++ b/paludis/repositories/unpackaged/unpackaged_repository_TEST.cc
@@ -188,7 +188,6 @@ namespace test_cases
TEST_CHECK(! repo->some_ids_might_support_action(SupportsActionTest<PretendAction>()));
TEST_CHECK(! repo->some_ids_might_support_action(SupportsActionTest<InfoAction>()));
TEST_CHECK(! repo->some_ids_might_support_action(SupportsActionTest<UninstallAction>()));
- TEST_CHECK(! repo->some_ids_might_support_action(SupportsActionTest<InstalledAction>()));
const std::tr1::shared_ptr<const PackageID> id(
*env[selection::RequireExactlyOne(generator::All())]->begin());
@@ -198,7 +197,6 @@ namespace test_cases
TEST_CHECK(! id->supports_action(SupportsActionTest<PretendAction>()));
TEST_CHECK(! id->supports_action(SupportsActionTest<InfoAction>()));
TEST_CHECK(! id->supports_action(SupportsActionTest<UninstallAction>()));
- TEST_CHECK(! id->supports_action(SupportsActionTest<InstalledAction>()));
}
} test_actions;
diff --git a/paludis/repositories/unwritten/unwritten_repository.cc b/paludis/repositories/unwritten/unwritten_repository.cc
index 7c7f032..5802238 100644
--- a/paludis/repositories/unwritten/unwritten_repository.cc
+++ b/paludis/repositories/unwritten/unwritten_repository.cc
@@ -203,11 +203,6 @@ namespace
{
struct SupportsActionQuery
{
- bool visit(const SupportsActionTest<InstalledAction> &) const
- {
- return false;
- }
-
bool visit(const SupportsActionTest<InstallAction> &) const
{
return true;
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index 98bf8bd..3c64417 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -255,11 +255,6 @@ namespace
{
struct SupportsActionQuery
{
- bool visit(const SupportsActionTest<InstalledAction> &) const
- {
- return true;
- }
-
bool visit(const SupportsActionTest<InstallAction> &) const
{
return false;
diff --git a/paludis/repositories/virtuals/package_id.cc b/paludis/repositories/virtuals/package_id.cc
index 1665a3c..adab544 100644
--- a/paludis/repositories/virtuals/package_id.cc
+++ b/paludis/repositories/virtuals/package_id.cc
@@ -392,13 +392,6 @@ namespace
throw UnsupportedActionError(*id, a);
}
- void visit(const InstalledAction & a)
- {
- SupportsActionTest<InstalledAction> t;
- if (! id->repository()->some_ids_might_support_action(t))
- throw UnsupportedActionError(*id, a);
- }
-
void visit(const UninstallAction & a)
{
SupportsActionTest<UninstallAction> t;
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index f88c59c..5dcbaa3 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -354,11 +354,6 @@ namespace
{
struct SupportsActionQuery
{
- bool visit(const SupportsActionTest<InstalledAction> &) const
- {
- return false;
- }
-
bool visit(const SupportsActionTest<InstallAction> &) const
{
return true;
diff --git a/paludis/resolver/resolver.cc b/paludis/resolver/resolver.cc
index c7ba0a0..7a75e53 100644
--- a/paludis/resolver/resolver.cc
+++ b/paludis/resolver/resolver.cc
@@ -418,7 +418,7 @@ Resolver::_make_constraint_from_dependency(const QPN_S & qpn_s, const SanitisedD
/* nothing is fine too if there's nothing installed matching the block. */
const std::tr1::shared_ptr<const PackageIDSequence> ids((*_imp->env)[selection::SomeArbitraryVersion(
generator::Matches(*dep.spec().if_block()->blocked_spec(), MatchPackageOptions()) |
- filter::SupportsAction<InstalledAction>())]);
+ filter::InstalledAtRoot(FSEntry("/")))]);
return make_shared_ptr(new Constraint(make_named_values<Constraint>(
value_for<n::nothing_is_fine_too>(ids->empty()),
@@ -768,7 +768,7 @@ Resolver::_already_met(const SanitisedDependency & dep) const
{
std::tr1::shared_ptr<const PackageIDSequence> ids((*_imp->env)[selection::SomeArbitraryVersion(
generator::Matches(*dep.spec().if_package(), MatchPackageOptions()) |
- filter::SupportsAction<InstalledAction>())]);
+ filter::InstalledAtRoot(FSEntry("/")))]);
return ! ids->empty();
}
else if (dep.spec().if_block())
@@ -1010,7 +1010,7 @@ Resolver::find_any_score(const QPN_S & our_qpn_s, const SanitisedDependency & de
{
const std::tr1::shared_ptr<const PackageIDSequence> installed_ids((*_imp->env)[selection::BestVersionOnly(
generator::Matches(spec, MatchPackageOptions()) |
- filter::SupportsAction<InstalledAction>())]);
+ filter::InstalledAtRoot(FSEntry("/")))]);
if (! installed_ids->empty())
return 50 + operator_bias;
}
@@ -1020,7 +1020,7 @@ Resolver::find_any_score(const QPN_S & our_qpn_s, const SanitisedDependency & de
{
const std::tr1::shared_ptr<const PackageIDSequence> installed_ids((*_imp->env)[selection::BestVersionOnly(
generator::Matches(spec, MatchPackageOptions() + mpo_ignore_additional_requirements) |
- filter::SupportsAction<InstalledAction>())]);
+ filter::InstalledAtRoot(FSEntry("/")))]);
if (! installed_ids->empty())
return 40 + operator_bias;
}
@@ -1429,7 +1429,7 @@ Resolver::_find_installed_id_for(const QPN_S & qpn_s, const std::tr1::shared_ptr
const std::tr1::shared_ptr<const PackageIDSequence> ids((*_imp->env)[selection::AllVersionsSorted(
generator::Package(qpn_s.package()) |
qpn_s.make_slot_filter() |
- filter::SupportsAction<InstalledAction>()
+ filter::InstalledAtRoot(FSEntry("/"))
)]);
return _find_id_for_from(qpn_s, resolution, ids).first;
diff --git a/paludis/show_suggest_visitor.cc b/paludis/show_suggest_visitor.cc
index 5e03dfa..b9a94af 100644
--- a/paludis/show_suggest_visitor.cc
+++ b/paludis/show_suggest_visitor.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 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
@@ -164,7 +164,7 @@ ShowSuggestVisitor::visit(const DependencySpecTree::NodeType<PackageDepSpec>::Ty
std::tr1::shared_ptr<const PackageIDSequence> installed_matches((*_imp->environment)[selection::AllVersionsSorted(
generator::Matches(*node.spec(), _imp->dep_list->options()->match_package_options())
- | filter::SupportsAction<InstalledAction>())]);
+ | filter::InstalledAtRoot(_imp->environment->root()))]);
if (! installed_matches->empty())
{
Log::get_instance()->message("dep_list.show_suggest_visitor.already_installed", ll_debug, lc_context)
diff --git a/paludis/uninstall_task.cc b/paludis/uninstall_task.cc
index 393ad7d..be5fb60 100644
--- a/paludis/uninstall_task.cc
+++ b/paludis/uninstall_task.cc
@@ -324,7 +324,7 @@ UninstallTask::execute()
bool remove(true);
std::tr1::shared_ptr<const PackageIDSequence> installed((*_imp->env)[selection::AllVersionsUnsorted(
generator::Matches(make_package_dep_spec(PartiallyMadePackageDepSpecOptions()).package(i->first), MatchPackageOptions()) |
- filter::SupportsAction<InstalledAction>()
+ filter::InstalledAtRoot(_imp->env->root())
)]);
for (PackageIDSequence::ConstIterator r(installed->begin()), r_end(installed->end()) ;
r != r_end && remove ; ++r)
diff --git a/python/action.cc b/python/action.cc
index 36eac88..dd30255 100644
--- a/python/action.cc
+++ b/python/action.cc
@@ -328,17 +328,6 @@ void expose_action()
);
/**
- * InsatlledAction
- */
- bp::class_<InstalledAction, bp::bases<Action>, boost::noncopyable>
- (
- "InstalledAction",
- "InstalledAction is a dummy action used by SupportsActionTest and\n"
- "query::SupportsAction to determine whether a PackageID is installed.",
- bp::init<>("__init__()")
- );
-
- /**
* PretendAction
*/
bp::class_<PretendAction, bp::bases<Action>, boost::noncopyable>
@@ -394,7 +383,6 @@ void expose_action()
class_supports_action_test<InstallAction>("Install");
class_supports_action_test<FetchAction>("Fetch");
class_supports_action_test<UninstallAction>("Uninstall");
- class_supports_action_test<InstalledAction>("Installed");
class_supports_action_test<PretendAction>("Pretend");
class_supports_action_test<ConfigAction>("Config");
class_supports_action_test<InfoAction>("Info");
diff --git a/python/action_TEST.py b/python/action_TEST.py
index 8bee223..6b86b0e 100755
--- a/python/action_TEST.py
+++ b/python/action_TEST.py
@@ -78,10 +78,6 @@ class TestCase_06_UninstallAction(unittest.TestCase):
def test_01_create(self):
UninstallAction(UninstallActionOptions("monkey"))
-class TestCase_07_InstalledAction(unittest.TestCase):
- def test_01_create(self):
- InstalledAction()
-
class TestCase_08_PretendAction(unittest.TestCase):
def test_01_create(self):
PretendAction(PretendActionOptions())
@@ -99,7 +95,6 @@ class TestCase_10_SupportsActionTests(unittest.TestCase):
SupportsInstallActionTest()
SupportsFetchActionTest()
SupportsUninstallActionTest()
- SupportsInstalledActionTest()
SupportsPretendActionTest()
SupportsConfigActionTest()
SupportsInfoActionTest()
diff --git a/python/filter.cc b/python/filter.cc
index 8795c55..affd612 100644
--- a/python/filter.cc
+++ b/python/filter.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 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
@@ -84,7 +84,6 @@ void expose_filter()
);
class_supports_action_filter<InstallAction>("Install");
- class_supports_action_filter<InstalledAction>("Installed");
class_supports_action_filter<UninstallAction>("Uninstall");
class_supports_action_filter<PretendAction>("Pretend");
class_supports_action_filter<ConfigAction>("Config");
diff --git a/python/package_id_TEST.py b/python/package_id_TEST.py
index 7170536..c9d482d 100755
--- a/python/package_id_TEST.py
+++ b/python/package_id_TEST.py
@@ -93,7 +93,6 @@ class TestCase_01_PackageID(unittest.TestCase):
self.assert_(self.pid.supports_action(SupportsInstallActionTest()))
self.assert_(self.pid.supports_action(SupportsFetchActionTest()))
self.assert_(not self.pid.supports_action(SupportsUninstallActionTest()))
- self.assert_(not self.pid.supports_action(SupportsInstalledActionTest()))
self.assert_(self.pid.supports_action(SupportsPretendActionTest()))
self.assert_(not self.pid.supports_action(SupportsConfigActionTest()))
@@ -101,7 +100,6 @@ class TestCase_01_PackageID(unittest.TestCase):
self.assert_(not self.ipid.supports_action(SupportsInstallActionTest()))
self.assert_(not self.ipid.supports_action(SupportsFetchActionTest()))
self.assert_(self.ipid.supports_action(SupportsUninstallActionTest()))
- self.assert_(self.ipid.supports_action(SupportsInstalledActionTest()))
self.assert_(not self.ipid.supports_action(SupportsPretendActionTest()))
self.assert_(self.ipid.supports_action(SupportsConfigActionTest()))
diff --git a/python/repository_TEST.py b/python/repository_TEST.py
index 510312b..4f6908a 100755
--- a/python/repository_TEST.py
+++ b/python/repository_TEST.py
@@ -86,8 +86,6 @@ class TestCase_01_Repository(unittest.TestCase):
self.assert_(not irepo.some_ids_might_support_action(SupportsInstallActionTest()))
self.assert_(not repo.some_ids_might_support_action(SupportsUninstallActionTest()))
self.assert_(irepo.some_ids_might_support_action(SupportsUninstallActionTest()))
- self.assert_(not repo.some_ids_might_support_action(SupportsInstalledActionTest()))
- self.assert_(irepo.some_ids_might_support_action(SupportsInstalledActionTest()))
self.assert_(repo.some_ids_might_support_action(SupportsPretendActionTest()))
self.assert_(not irepo.some_ids_might_support_action(SupportsPretendActionTest()))
self.assert_(not repo.some_ids_might_support_action(SupportsConfigActionTest()))
diff --git a/ruby/action.cc b/ruby/action.cc
index 92ab7d4..dc51d55 100644
--- a/ruby/action.cc
+++ b/ruby/action.cc
@@ -46,8 +46,6 @@ namespace
static VALUE c_uninstall_action_options;
static VALUE c_uninstall_action;
- static VALUE c_installed_action;
-
static VALUE c_pretend_action;
static VALUE c_pretend_fetch_action;
@@ -180,8 +178,6 @@ namespace
{
if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, install_action_value_ptr()))
ptr = new std::tr1::shared_ptr<const SupportsActionTestBase>(make_shared_ptr(new SupportsActionTest<InstallAction>()));
- else if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, installed_action_value_ptr()))
- ptr = new std::tr1::shared_ptr<const SupportsActionTestBase>(make_shared_ptr(new SupportsActionTest<InstalledAction>()));
else if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, uninstall_action_value_ptr()))
ptr = new std::tr1::shared_ptr<const SupportsActionTestBase>(make_shared_ptr(new SupportsActionTest<UninstallAction>()));
else if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, pretend_action_value_ptr()))
@@ -478,27 +474,6 @@ namespace
}
};
- /*
- * Document-method InstalledAction.new
- *
- * call-seq:
- * InstalledAction.new -> InstalledAction
- *
- * Create new InstalledAction
- */
- template <typename A_>
- struct ReallyEasyActionNew
- {
- static VALUE
- easy_action_new(VALUE self)
- {
- std::tr1::shared_ptr<Action> * a(new std::tr1::shared_ptr<Action>(new A_()));
- VALUE tdata(Data_Wrap_Struct(self, 0, &Common<std::tr1::shared_ptr<Action> >::free, a));
- rb_obj_call_init(tdata, 1, &self);
- return tdata;
- }
- };
-
WantPhase want_all_phases(const std::string &)
{
return wp_yes;
@@ -858,17 +833,6 @@ namespace
rb_define_method(c_uninstall_action, "options", RUBY_FUNC_CAST(&uninstall_action_options), 0);
/*
- * Document-class: Paludis::InstalledAction
- *
- * An InstalledAction can be used to test whether a PackageID is
- * installed.
- */
- c_installed_action = rb_define_class_under(paludis_module(), "InstalledAction", c_action);
- rb_define_singleton_method(c_installed_action, "new",
- RUBY_FUNC_CAST((&ReallyEasyActionNew<InstalledAction>::easy_action_new)), 0);
- rb_define_method(c_installed_action, "initialize", RUBY_FUNC_CAST(&empty_init), -1);
-
- /*
* Document-class: Paludis::PretendAction
*
* A PretendAction is used by InstallTask to handle install-pretend-phase checks on a PackageID.
@@ -938,12 +902,6 @@ paludis::ruby::install_action_value_ptr()
}
VALUE *
-paludis::ruby::installed_action_value_ptr()
-{
- return &c_installed_action;
-}
-
-VALUE *
paludis::ruby::pretend_action_value_ptr()
{
return &c_pretend_action;
diff --git a/ruby/dep_spec_TEST.rb b/ruby/dep_spec_TEST.rb
index 8615987..ec6c0a4 100644
--- a/ruby/dep_spec_TEST.rb
+++ b/ruby/dep_spec_TEST.rb
@@ -117,7 +117,7 @@ module Paludis
def test_disambiguate
assert_equal Paludis::parse_user_package_dep_spec("foo", env, []).to_s, "bar/foo"
assert_raise NoSuchPackageError do
- Paludis::parse_user_package_dep_spec("foo", env, [], Filter::SupportsAction.new(InstalledAction))
+ Paludis::parse_user_package_dep_spec("foo", env, [], Filter::SupportsAction.new(ConfigAction))
end
assert_raise AmbiguousPackageNameError do
Paludis::parse_user_package_dep_spec("bar", env, [])
diff --git a/ruby/environment_TEST.rb b/ruby/environment_TEST.rb
index f28552d..a050d4f 100644
--- a/ruby/environment_TEST.rb
+++ b/ruby/environment_TEST.rb
@@ -387,7 +387,7 @@ module Paludis
'>=foo/bar-27', env, []), []))]
assert a.empty?
- a = env[Selection::AllVersionsUnsorted.new(Generator::Matches.new(pda2, []) | Filter::SupportsAction.new(InstalledAction))]
+ a = env[Selection::AllVersionsUnsorted.new(Generator::Matches.new(pda2, []) | Filter::SupportsAction.new(ConfigAction))]
assert a.empty?
end
end
diff --git a/ruby/filter.cc b/ruby/filter.cc
index 3997bb7..f282b3f 100644
--- a/ruby/filter.cc
+++ b/ruby/filter.cc
@@ -131,8 +131,6 @@ namespace
{
if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, install_action_value_ptr()))
ptr = new filter::SupportsAction<InstallAction>();
- else if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, installed_action_value_ptr()))
- ptr = new filter::SupportsAction<InstalledAction>();
else if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, uninstall_action_value_ptr()))
ptr = new filter::SupportsAction<UninstallAction>();
else if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, pretend_action_value_ptr()))
diff --git a/ruby/generator.cc b/ruby/generator.cc
index 52daed9..e16941a 100644
--- a/ruby/generator.cc
+++ b/ruby/generator.cc
@@ -240,10 +240,6 @@ namespace
{
if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, install_action_value_ptr()))
ptr = new generator::SomeIDsMightSupportAction<InstallAction>();
- else if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, installed_action_value_ptr()))
- ptr = new generator::SomeIDsMightSupportAction<InstalledAction>();
- else if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, uninstall_action_value_ptr()))
- ptr = new generator::SomeIDsMightSupportAction<UninstallAction>();
else if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, pretend_action_value_ptr()))
ptr = new generator::SomeIDsMightSupportAction<PretendAction>();
else if (Qtrue == rb_funcall2(action_class, rb_intern("<="), 1, config_action_value_ptr()))
diff --git a/ruby/package_database_TEST.rb b/ruby/package_database_TEST.rb
index b927ce2..a15f8af 100644
--- a/ruby/package_database_TEST.rb
+++ b/ruby/package_database_TEST.rb
@@ -2,7 +2,7 @@
# vim: set sw=4 sts=4 et tw=80 :
#
-# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+# Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
# Copyright (c) 2007 Richard Brown
#
# This file is part of the Paludis package manager. Paludis is free software;
@@ -67,7 +67,7 @@ module Paludis
db.fetch_unique_qualified_package_name('foobarbaz')
end
assert_raise NoSuchPackageError do
- db.fetch_unique_qualified_package_name('bar', Filter::SupportsAction.new(InstalledAction))
+ db.fetch_unique_qualified_package_name('bar', Filter::SupportsAction.new(ConfigAction))
end
end
diff --git a/ruby/paludis_ruby.hh b/ruby/paludis_ruby.hh
index 58b04f5..5322252 100644
--- a/ruby/paludis_ruby.hh
+++ b/ruby/paludis_ruby.hh
@@ -142,7 +142,6 @@ namespace paludis
VALUE * config_action_value_ptr();
VALUE * uninstall_action_value_ptr();
VALUE * pretend_action_value_ptr();
- VALUE * installed_action_value_ptr();
VALUE * pretend_fetch_action_value_ptr();
VALUE * dependency_labels_dep_spec_value_ptr();
diff --git a/ruby/repository_TEST.rb b/ruby/repository_TEST.rb
index 122f475..1ec084f 100644
--- a/ruby/repository_TEST.rb
+++ b/ruby/repository_TEST.rb
@@ -383,9 +383,7 @@ module Paludis
def test_some_ids_might_support
assert repo.some_ids_might_support_action(SupportsActionTest.new(InstallAction))
- assert ! repo.some_ids_might_support_action(SupportsActionTest.new(InstalledAction))
assert ! installed_repo.some_ids_might_support_action(SupportsActionTest.new(InstallAction))
- assert installed_repo.some_ids_might_support_action(SupportsActionTest.new(InstalledAction))
end
end
diff --git a/src/clients/cave/cmd_print_ids.cc b/src/clients/cave/cmd_print_ids.cc
index d30ac4e..9ac35df 100644
--- a/src/clients/cave/cmd_print_ids.cc
+++ b/src/clients/cave/cmd_print_ids.cc
@@ -83,7 +83,6 @@ namespace
"multiple times, all listed actions must be supported.",
args::StringSetArg::StringSetArgOptions
("install", "able to be installed")
- ("installed", "installed")
("uninstall", "able to be uninstalled")
("pretend", "has pretend-install-time checks")
("config", "supports post-install configuration")
@@ -274,8 +273,6 @@ PrintIDsCommand::run(
{
if (*m == "install")
fg = fg | filter::SupportsAction<InstallAction>();
- else if (*m == "installed")
- fg = fg | filter::SupportsAction<InstalledAction>();
else if (*m == "uninstall")
fg = fg | filter::SupportsAction<UninstallAction>();
else if (*m == "pretend")
diff --git a/src/clients/cave/cmd_print_owners.cc b/src/clients/cave/cmd_print_owners.cc
index 49aeb1d..7790b73 100644
--- a/src/clients/cave/cmd_print_owners.cc
+++ b/src/clients/cave/cmd_print_owners.cc
@@ -142,7 +142,8 @@ PrintOwnersCommand::run(
handler = handle_basename;
}
- std::tr1::shared_ptr<const PackageIDSequence> ids((*env)[selection::AllVersionsSorted(generator::All() | filter::SupportsAction<InstalledAction>())]);
+ std::tr1::shared_ptr<const PackageIDSequence> ids((*env)[selection::AllVersionsSorted(generator::All() |
+ filter::InstalledAtRoot(env->root()))]);
for (PackageIDSequence::ConstIterator p(ids->begin()), p_end(ids->end()); p != p_end; ++p)
{
diff --git a/src/clients/cave/cmd_resolve.cc b/src/clients/cave/cmd_resolve.cc
index 2928453..ad4afd8 100644
--- a/src/clients/cave/cmd_resolve.cc
+++ b/src/clients/cave/cmd_resolve.cc
@@ -228,7 +228,7 @@ namespace
const std::tr1::shared_ptr<const PackageIDSequence> ids((*env)[selection::AllVersionsUnsorted(
generator::Package(q.package()) |
q.make_slot_filter() |
- filter::SupportsAction<InstalledAction>())]);
+ filter::InstalledAtRoot(FSEntry("/")))]);
for (PackageIDSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ;
i != i_end ; ++i)
@@ -327,7 +327,7 @@ namespace
const std::tr1::shared_ptr<const PackageIDSequence> installed_ids((*env)[selection::BestVersionInEachSlot(
generator::Matches(spec, MatchPackageOptions()) |
- filter::SupportsAction<InstalledAction>())]);
+ filter::InstalledAtRoot(FSEntry("/")))]);
for (PackageIDSequence::ConstIterator i(installed_ids->begin()), i_end(installed_ids->end()) ;
i != i_end ; ++i)
diff --git a/src/clients/cave/cmd_show.cc b/src/clients/cave/cmd_show.cc
index 40743e4..986883b 100644
--- a/src/clients/cave/cmd_show.cc
+++ b/src/clients/cave/cmd_show.cc
@@ -682,7 +682,7 @@ namespace
for (PackageIDSequence::ConstIterator i(ids->begin()), i_end(ids->end()) ;
i != i_end ; ++i)
{
- if ((*i)->supports_action(SupportsActionTest<InstalledAction>()))
+ if ((*i)->repository()->installed_root_key())
all_installed->push_back(*i);
else if ((*i)->supports_action(SupportsActionTest<InstallAction>()))
{
@@ -721,7 +721,7 @@ namespace
cout << " ";
need_space = true;
- if ((*i)->supports_action(SupportsActionTest<InstalledAction>()))
+ if ((*i)->repository()->installed_root_key())
cout << format_general_s(f::show_package_version_installed(), stringify((*i)->canonical_form(idcf_version)));
else if (! (*i)->masked())
cout << format_general_s(f::show_package_version_installable(), stringify((*i)->canonical_form(idcf_version)));
diff --git a/src/clients/inquisitio/do_search.cc b/src/clients/inquisitio/do_search.cc
index 31d4fee..36d01a9 100644
--- a/src/clients/inquisitio/do_search.cc
+++ b/src/clients/inquisitio/do_search.cc
@@ -159,25 +159,30 @@ namespace
typedef bool result;
const bool visible_only;
- std::tr1::shared_ptr<SupportsActionTestBase> action_test;
+ bool installed, installable;
Eligible(const bool v, const std::string & k) :
- visible_only(v)
+ visible_only(v),
+ installed(true),
+ installable(false)
{
if (k == "all")
{
}
else if (k == "installable")
- action_test.reset(new SupportsActionTest<InstallAction>());
+ installed = false;
else if (k == "installed")
- action_test.reset(new SupportsActionTest<InstalledAction>());
+ installable = false;
else
throw InternalError(PALUDIS_HERE, "Bad --kind '" + k + "'");
}
bool operator() (const PackageID & id) const
{
- if (action_test && ! id.supports_action(*action_test))
+ if ((! installed) && id.repository()->installed_root_key())
+ return false;
+
+ if ((! installable) && id.supports_action(SupportsActionTest<InstallAction>()))
return false;
if (visible_only)
@@ -351,7 +356,7 @@ do_search(Environment & env)
}
else if (CommandLine::get_instance()->a_kind.argument() == "installed")
{
- if (! (*r)->some_ids_might_support_action(SupportsActionTest<InstalledAction>()))
+ if (! (*r)->installed_root_key())
continue;
}
else if (CommandLine::get_instance()->a_kind.argument() == "all")
diff --git a/src/clients/paludis/applets.cc b/src/clients/paludis/applets.cc
index 542daf2..b15efba 100644
--- a/src/clients/paludis/applets.cc
+++ b/src/clients/paludis/applets.cc
@@ -419,8 +419,7 @@ int do_regenerate_cache(const std::tr1::shared_ptr<Environment> & env, bool inst
{
if (installed)
{
- SupportsActionTest<InstalledAction> action_test;
- if (! (*r)->some_ids_might_support_action(action_test))
+ if (! (*r)->installed_root_key())
continue;
}
else
diff --git a/src/clients/paludis/owner.cc b/src/clients/paludis/owner.cc
index 5b63de5..097184b 100644
--- a/src/clients/paludis/owner.cc
+++ b/src/clients/paludis/owner.cc
@@ -92,8 +92,7 @@ do_one_owner(
for (PackageDatabase::RepositoryConstIterator r(env->package_database()->begin_repositories()),
r_end(env->package_database()->end_repositories()) ; r != r_end ; ++r)
{
- SupportsActionTest<InstalledAction> action_test;
- if (! (*r)->some_ids_might_support_action(action_test))
+ if (! (*r)->installed_root_key())
continue;
std::tr1::shared_ptr<const CategoryNamePartSet> cats((*r)->category_names());
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index 4a8a81c..cc8def6 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -508,14 +508,14 @@ ConsoleInstallTask::on_display_merge_list_entry(const DepListEntry & d)
generator::Matches(make_package_dep_spec(PartiallyMadePackageDepSpecOptions())
.package(d.package_id()->name()).in_repository(*repo), MatchPackageOptions()) :
generator::Matches(make_package_dep_spec(PartiallyMadePackageDepSpecOptions())
- .package(d.package_id()->name()), MatchPackageOptions()) | filter::SupportsAction<InstalledAction>()
+ .package(d.package_id()->name()), MatchPackageOptions()) | filter::InstalledAtRoot(environment()->root())
)]);;
std::tr1::shared_ptr<const PackageIDSequence> existing_slot_repo((*environment())[selection::AllVersionsSorted((repo ?
generator::Matches(make_package_dep_spec(PartiallyMadePackageDepSpecOptions())
.package(d.package_id()->name()).in_repository(*repo), MatchPackageOptions()) :
generator::Matches(make_package_dep_spec(PartiallyMadePackageDepSpecOptions())
- .package(d.package_id()->name()), MatchPackageOptions()) | filter::SupportsAction<InstalledAction>())
+ .package(d.package_id()->name()), MatchPackageOptions()) | filter::InstalledAtRoot(environment()->root()))
| filter::SameSlot(d.package_id()))]);
display_merge_list_entry_start(d, m);
@@ -1438,7 +1438,7 @@ ConsoleInstallTask::display_merge_list_entry_package_tags(const DepListEntry & d
std::tr1::static_pointer_cast<const DependencyDepTag>(tag->tag())->dependency());
if (d.kind() != dlk_masked && d.kind() != dlk_block && (*environment())[selection::SomeArbitraryVersion(
generator::Matches(*spec, MatchPackageOptions()) |
- filter::SupportsAction<InstalledAction>())]->empty())
+ filter::InstalledAtRoot(environment()->root()))]->empty())
unsatisfied_dependents.insert(tag->tag()->short_text());
else
dependents.insert(tag->tag()->short_text());