aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-02-28 16:17:38 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-02-28 16:50:38 +0000
commit8bbc660636c3d5617c422d6d61084717ad7315ff (patch)
tree46cc8916a3e4680b461b7650c9d27347372fe5e2
parent8d632ee9edebdbaa00c31200d97db506b5bf9cac (diff)
downloadpaludis-8bbc660636c3d5617c422d6d61084717ad7315ff.tar.gz
paludis-8bbc660636c3d5617c422d6d61084717ad7315ff.tar.xz
Define may_excludes on filters
-rw-r--r--paludis/filter.cc37
-rw-r--r--paludis/filter.hh9
-rw-r--r--paludis/filter_handler.cc7
-rw-r--r--paludis/filter_handler.hh7
-rw-r--r--src/clients/cave/cmd_print_ids.cc5
5 files changed, 64 insertions, 1 deletions
diff --git a/paludis/filter.cc b/paludis/filter.cc
index 31a6eba..e165692 100644
--- a/paludis/filter.cc
+++ b/paludis/filter.cc
@@ -105,6 +105,12 @@ Filter::ids(
return _imp->handler->ids(env, i);
}
+const RepositoryContentMayExcludes
+Filter::may_excludes() const
+{
+ return _imp->handler->may_excludes();
+}
+
std::string
Filter::as_string() const
{
@@ -167,6 +173,11 @@ namespace
struct NotMaskedFilterHandler :
AllFilterHandlerBase
{
+ virtual const RepositoryContentMayExcludes may_excludes() const
+ {
+ return { rcme_masked };
+ }
+
virtual std::shared_ptr<const RepositoryNameSet> repositories(
const Environment * const env,
const std::shared_ptr<const RepositoryNameSet> & repos) const
@@ -263,6 +274,12 @@ namespace
{
}
+ virtual const RepositoryContentMayExcludes may_excludes() const
+ {
+ /* we can exclude anything either filter would reject */
+ return f1.may_excludes() | f2.may_excludes();
+ }
+
virtual std::shared_ptr<const RepositoryNameSet> repositories(
const Environment * const env,
const std::shared_ptr<const RepositoryNameSet> & s) const
@@ -309,6 +326,11 @@ namespace
{
}
+ virtual const RepositoryContentMayExcludes may_excludes() const
+ {
+ return { };
+ }
+
virtual std::shared_ptr<const PackageIDSet> ids(
const Environment * const,
const std::shared_ptr<const PackageIDSet> & id) const
@@ -347,6 +369,11 @@ namespace
{
}
+ virtual const RepositoryContentMayExcludes may_excludes() const
+ {
+ return { };
+ }
+
virtual std::shared_ptr<const PackageIDSet> ids(
const Environment * const,
const std::shared_ptr<const PackageIDSet> & id) const
@@ -384,6 +411,11 @@ namespace
return result;
}
+ virtual const RepositoryContentMayExcludes may_excludes() const
+ {
+ return { };
+ }
+
virtual std::string as_string() const
{
return "has no slot";
@@ -404,6 +436,11 @@ namespace
{
}
+ virtual const RepositoryContentMayExcludes may_excludes() const
+ {
+ return { };
+ }
+
virtual std::shared_ptr<const PackageIDSet> ids(
const Environment * const env,
const std::shared_ptr<const PackageIDSet> & id) const
diff --git a/paludis/filter.hh b/paludis/filter.hh
index c2cdd21..b32027b 100644
--- a/paludis/filter.hh
+++ b/paludis/filter.hh
@@ -32,6 +32,7 @@
#include <paludis/action-fwd.hh>
#include <paludis/dep_spec-fwd.hh>
#include <paludis/match_package-fwd.hh>
+#include <paludis/repository-fwd.hh>
#include <memory>
/** \file
@@ -83,6 +84,14 @@ namespace paludis
///\{
/**
+ * Return any RepositoryContentMayExcludes that are implied by this
+ * filter.
+ *
+ * \since 0.59
+ */
+ const RepositoryContentMayExcludes may_excludes() const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ /**
* Filter candidate repository names.
*/
std::shared_ptr<const RepositoryNameSet> repositories(
diff --git a/paludis/filter_handler.cc b/paludis/filter_handler.cc
index 83af3db..91e59ed 100644
--- a/paludis/filter_handler.cc
+++ b/paludis/filter_handler.cc
@@ -18,6 +18,7 @@
*/
#include <paludis/filter_handler.hh>
+#include <paludis/util/options.hh>
using namespace paludis;
@@ -55,3 +56,9 @@ AllFilterHandlerBase::ids(const Environment * const,
return s;
}
+const RepositoryContentMayExcludes
+AllFilterHandlerBase::may_excludes() const
+{
+ return { };
+}
+
diff --git a/paludis/filter_handler.hh b/paludis/filter_handler.hh
index d261b7a..0699d4e 100644
--- a/paludis/filter_handler.hh
+++ b/paludis/filter_handler.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 2011 Ciaran McCreesh
* Copyright (c) 2008 David Leverton
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -25,6 +25,7 @@
#include <paludis/name-fwd.hh>
#include <paludis/environment-fwd.hh>
#include <paludis/package_id-fwd.hh>
+#include <paludis/repository-fwd.hh>
#include <paludis/util/attributes.hh>
#include <memory>
@@ -37,6 +38,8 @@ namespace paludis
virtual std::string as_string() const = 0;
+ virtual const RepositoryContentMayExcludes may_excludes() const = 0;
+
virtual std::shared_ptr<const RepositoryNameSet> repositories(
const Environment * const,
const std::shared_ptr<const RepositoryNameSet> &) const = 0;
@@ -60,6 +63,8 @@ namespace paludis
public FilterHandler
{
public:
+ virtual const RepositoryContentMayExcludes may_excludes() const;
+
virtual std::shared_ptr<const RepositoryNameSet> repositories(
const Environment * const,
const std::shared_ptr<const RepositoryNameSet> &) const;
diff --git a/src/clients/cave/cmd_print_ids.cc b/src/clients/cave/cmd_print_ids.cc
index e987d8e..eed70f1 100644
--- a/src/clients/cave/cmd_print_ids.cc
+++ b/src/clients/cave/cmd_print_ids.cc
@@ -131,6 +131,11 @@ namespace
{
}
+ virtual const RepositoryContentMayExcludes may_excludes() const
+ {
+ return { };
+ }
+
virtual std::string as_string() const
{
return "with mask '" + mask + "'";