aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-12-24 10:58:09 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-12-24 10:58:09 +0000
commit8968183b4069483d1a7fbcd8bad62920ec166479 (patch)
treef06bfbcba8185c3228117209e05492422f24182e
parent8a97076e357f98e7674f3da386b0bb06c29f5b84 (diff)
downloadpaludis-8968183b4069483d1a7fbcd8bad62920ec166479.tar.gz
paludis-8968183b4069483d1a7fbcd8bad62920ec166479.tar.xz
Add RepositoryUseInterface::describe_use_flag
-rw-r--r--paludis/repositories/fake/fake_repository_base.cc7
-rw-r--r--paludis/repositories/fake/fake_repository_base.hh2
-rw-r--r--paludis/repositories/portage/portage_repository.cc7
-rw-r--r--paludis/repositories/portage/portage_repository.hh2
-rw-r--r--paludis/repositories/vdb/vdb_repository.cc7
-rw-r--r--paludis/repositories/vdb/vdb_repository.hh3
-rw-r--r--paludis/repository.hh15
7 files changed, 43 insertions, 0 deletions
diff --git a/paludis/repositories/fake/fake_repository_base.cc b/paludis/repositories/fake/fake_repository_base.cc
index b6b5b01..03253fe 100644
--- a/paludis/repositories/fake/fake_repository_base.cc
+++ b/paludis/repositories/fake/fake_repository_base.cc
@@ -287,3 +287,10 @@ FakeRepositoryBase::sets_list() const
return result;
}
+std::string
+FakeRepositoryBase::do_describe_use_flag(const UseFlagName &,
+ const PackageDatabaseEntry * const) const
+{
+ return "";
+}
+
diff --git a/paludis/repositories/fake/fake_repository_base.hh b/paludis/repositories/fake/fake_repository_base.hh
index 5d0090f..44e6731 100644
--- a/paludis/repositories/fake/fake_repository_base.hh
+++ b/paludis/repositories/fake/fake_repository_base.hh
@@ -58,6 +58,8 @@ namespace paludis
virtual UseFlagNameCollection::ConstPointer do_use_expand_prefixes() const;
virtual UseFlagName do_use_expand_name(const UseFlagName & u) const;
virtual UseFlagName do_use_expand_value(const UseFlagName & u) const;
+ virtual std::string do_describe_use_flag(const UseFlagName &,
+ const PackageDatabaseEntry * const) const;
/* end of RepositoryUseInterface */
diff --git a/paludis/repositories/portage/portage_repository.cc b/paludis/repositories/portage/portage_repository.cc
index 64f3088..7b06c9f 100644
--- a/paludis/repositories/portage/portage_repository.cc
+++ b/paludis/repositories/portage/portage_repository.cc
@@ -1116,3 +1116,10 @@ PortageRepository::set_profile(const ProfilesIterator & iter)
}
}
+std::string
+PortageRepository::do_describe_use_flag(const UseFlagName &,
+ const PackageDatabaseEntry * const) const
+{
+ return "";
+}
+
diff --git a/paludis/repositories/portage/portage_repository.hh b/paludis/repositories/portage/portage_repository.hh
index 78c0358..b3ccdc5 100644
--- a/paludis/repositories/portage/portage_repository.hh
+++ b/paludis/repositories/portage/portage_repository.hh
@@ -128,6 +128,8 @@ namespace paludis
virtual UseFlagName do_use_expand_name(const UseFlagName & u) const;
virtual UseFlagName do_use_expand_value(const UseFlagName & u) const;
virtual UseFlagNameCollection::ConstPointer do_use_expand_prefixes() const;
+ virtual std::string do_describe_use_flag(const UseFlagName &,
+ const PackageDatabaseEntry * const) const;
/* end of RepositoryUseInterface */
diff --git a/paludis/repositories/vdb/vdb_repository.cc b/paludis/repositories/vdb/vdb_repository.cc
index e492945..3d8987b 100644
--- a/paludis/repositories/vdb/vdb_repository.cc
+++ b/paludis/repositories/vdb/vdb_repository.cc
@@ -1435,6 +1435,13 @@ VDBRepository::is_suitable_destination_for(const PackageDatabaseEntry & e) const
return _imp->env->package_database()->fetch_repository(e.repository)->format() == "ebuild";
}
+std::string
+VDBRepository::do_describe_use_flag(const UseFlagName &,
+ const PackageDatabaseEntry * const) const
+{
+ return "";
+}
+
#ifdef PALUDIS_ENABLE_VISIBILITY
# pragma GCC visibility push(default)
#endif
diff --git a/paludis/repositories/vdb/vdb_repository.hh b/paludis/repositories/vdb/vdb_repository.hh
index 4d1b39f..f2bdf0c 100644
--- a/paludis/repositories/vdb/vdb_repository.hh
+++ b/paludis/repositories/vdb/vdb_repository.hh
@@ -153,6 +153,9 @@ namespace paludis
virtual bool is_suitable_destination_for(const PackageDatabaseEntry &) const;
+ virtual std::string do_describe_use_flag(const UseFlagName &,
+ const PackageDatabaseEntry * const) const;
+
typedef CountedPtr<VDBRepository, count_policy::InternalCountTag> Pointer;
typedef CountedPtr<const VDBRepository, count_policy::InternalCountTag> ConstPointer;
};
diff --git a/paludis/repository.hh b/paludis/repository.hh
index e5c279a..12c9e7b 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -497,6 +497,12 @@ namespace paludis
*/
virtual UseFlagNameCollection::ConstPointer do_use_expand_prefixes() const = 0;
+ /**
+ * Override in descendents: describe a use flag.
+ */
+ virtual std::string do_describe_use_flag(const UseFlagName &,
+ const PackageDatabaseEntry * const) const = 0;
+
///\}
public:
@@ -564,6 +570,15 @@ namespace paludis
return do_use_expand_prefixes();
}
+ /**
+ * Describe a use flag.
+ */
+ std::string describe_use_flag(const UseFlagName & n,
+ const PackageDatabaseEntry * const pkg) const
+ {
+ return do_describe_use_flag(n, pkg);
+ }
+
///\}
virtual ~RepositoryUseInterface() { }