aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-25 12:41:19 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-25 12:41:19 +0100
commit6f1742a0fd5df57a23e2c9a1078a62a471a06649 (patch)
tree286a352f5a53d776c479289518f3437c1eb58bf2
parent9aac78c7481c1c7d7190b0e9cc09abfd321efebf (diff)
downloadpaludis-6f1742a0fd5df57a23e2c9a1078a62a471a06649.tar.gz
paludis-6f1742a0fd5df57a23e2c9a1078a62a471a06649.tar.xz
binary_keywords -> binary_keywords_filter
Fixes: ticket:485
-rw-r--r--paludis/repositories/e/e_repository.cc40
-rw-r--r--paludis/repositories/e/e_repository_TEST_pbin.cc2
-rw-r--r--paludis/repositories/e/e_repository_params.hh4
-rw-r--r--paludis/repositories/e/ebuild.cc2
-rw-r--r--paludis/repositories/e/ebuild.hh2
-rw-r--r--vim/syntax/paludis-repositories-conf.vim2
6 files changed, 38 insertions, 14 deletions
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index 440fb6d..67131e8 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -165,6 +165,14 @@ namespace
return result;
}
+
+ std::shared_ptr<Set<std::string> > make_binary_keywords_filter(
+ const std::string & s)
+ {
+ auto result(std::make_shared<Set<std::string>>());
+ tokenise_whitespace(s, result->inserter());
+ return result;
+ }
}
namespace paludis
@@ -249,7 +257,7 @@ namespace paludis
#ifdef ENABLE_PBINS
std::shared_ptr<const MetadataValueKey<std::string> > binary_destination_key;
std::shared_ptr<const MetadataValueKey<std::string> > binary_src_uri_prefix_key;
- std::shared_ptr<const MetadataValueKey<std::string> > binary_keywords;
+ std::shared_ptr<const MetadataCollectionKey<Set<std::string> > > binary_keywords_filter;
#endif
std::shared_ptr<const MetadataValueKey<FSEntry> > accounts_repository_data_location_key;
std::shared_ptr<const MetadataValueKey<FSEntry> > e_updates_location_key;
@@ -343,9 +351,9 @@ namespace paludis
binary_src_uri_prefix_key(std::make_shared<LiteralMetadataValueKey<std::string> >(
"binary_uri_prefix", "binary_uri_prefix", params.binary_destination() ? mkt_normal : mkt_internal,
params.binary_uri_prefix())),
- binary_keywords(std::make_shared<LiteralMetadataValueKey<std::string> >(
- "binary_keywords", "binary_keywords", params.binary_destination() ? mkt_normal : mkt_internal,
- params.binary_keywords())),
+ binary_keywords_filter(std::make_shared<LiteralMetadataStringSetKey>(
+ "binary_keywords_filter", "binary_keywords_filter", params.binary_destination() ? mkt_normal : mkt_internal,
+ make_binary_keywords_filter(params.binary_keywords_filter()))),
#endif
accounts_repository_data_location_key(layout->accounts_repository_data_location_key()),
e_updates_location_key(layout->e_updates_location_key()),
@@ -550,7 +558,7 @@ ERepository::_add_metadata_keys() const
#ifdef ENABLE_PBINS
add_metadata_key(_imp->binary_destination_key);
add_metadata_key(_imp->binary_src_uri_prefix_key);
- add_metadata_key(_imp->binary_keywords);
+ add_metadata_key(_imp->binary_keywords_filter);
#endif
if (_imp->accounts_repository_data_location_key)
add_metadata_key(_imp->accounts_repository_data_location_key);
@@ -1493,12 +1501,12 @@ ERepository::repository_factory_create(
std::string binary_distdir(f("binary_distdir"));
- std::string binary_keywords(f("binary_keywords"));
+ std::string binary_keywords_filter(f("binary_keywords_filter"));
- if (binary_keywords.empty())
+ if (binary_keywords_filter.empty())
{
if (binary_destination)
- throw ERepositoryConfigurationError("binary_destination = true, but binary_keywords is unset or empty");
+ throw ERepositoryConfigurationError("binary_destination = true, but binary_keywords_filter is unset or empty");
}
return std::make_shared<ERepository>(make_named_values<ERepositoryParams>(
@@ -1506,7 +1514,7 @@ ERepository::repository_factory_create(
n::auto_profiles() = auto_profiles,
n::binary_destination() = binary_destination,
n::binary_distdir() = binary_distdir,
- n::binary_keywords() = binary_keywords,
+ n::binary_keywords_filter() = binary_keywords_filter,
n::binary_uri_prefix() = binary_uri_prefix,
n::builddir() = FSEntry(builddir).realpath_if_exists(),
n::cache() = cache,
@@ -2711,10 +2719,24 @@ ERepository::merge(const MergeParams & m)
binary_ebuild_location.dirname().dirname().mkdir();
binary_ebuild_location.dirname().mkdir();
+ std::string binary_keywords;
+ if (m.package_id()->keywords_key())
+ {
+ for (auto k(m.package_id()->keywords_key()->value()->begin()), k_end(m.package_id()->keywords_key()->value()->end()) ;
+ k != k_end ; ++k)
+ if (_imp->binary_keywords_filter->value()->end() != _imp->binary_keywords_filter->value()->find(stringify(*k)))
+ {
+ if (! binary_keywords.empty())
+ binary_keywords.append(" ");
+ binary_keywords.append(stringify(*k));
+ }
+ }
+
WriteBinaryEbuildCommand write_binary_ebuild_command(
make_named_values<WriteBinaryEbuildCommandParams>(
n::binary_distdir() = _imp->params.binary_distdir(),
n::binary_ebuild_location() = binary_ebuild_location,
+ n::binary_keywords() = binary_keywords,
n::builddir() = _imp->params.builddir(),
n::destination_repository() = this,
n::environment() = _imp->params.environment(),
diff --git a/paludis/repositories/e/e_repository_TEST_pbin.cc b/paludis/repositories/e/e_repository_TEST_pbin.cc
index 9a860ec..c041f0b 100644
--- a/paludis/repositories/e/e_repository_TEST_pbin.cc
+++ b/paludis/repositories/e/e_repository_TEST_pbin.cc
@@ -139,7 +139,7 @@ namespace test_cases
b_keys->insert("profile_eapi", "0");
b_keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / "distdir"));
b_keys->insert("binary_distdir", stringify(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / "distdir"));
- b_keys->insert("binary_keywords", "test");
+ b_keys->insert("binary_keywords_filter", "test");
b_keys->insert("binary_destination", "true");
b_keys->insert("master_repository", "repo" + base_eapi);
b_keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_pbin_dir" / "build"));
diff --git a/paludis/repositories/e/e_repository_params.hh b/paludis/repositories/e/e_repository_params.hh
index 73381b7..c83b89e 100644
--- a/paludis/repositories/e/e_repository_params.hh
+++ b/paludis/repositories/e/e_repository_params.hh
@@ -43,7 +43,7 @@ namespace paludis
typedef Name<struct auto_profiles_name> auto_profiles;
typedef Name<struct binary_destination_name> binary_destination;
typedef Name<struct binary_distdir_name> binary_distdir;
- typedef Name<struct binary_keywords_name> binary_keywords;
+ typedef Name<struct binary_keywords_filter_name> binary_keywords_filter;
typedef Name<struct binary_uri_prefix_name> binary_uri_prefix;
typedef Name<struct builddir_name> builddir;
typedef Name<struct cache_name> cache;
@@ -82,7 +82,7 @@ namespace paludis
NamedValue<n::auto_profiles, bool> auto_profiles;
NamedValue<n::binary_destination, bool> binary_destination;
NamedValue<n::binary_distdir, FSEntry> binary_distdir;
- NamedValue<n::binary_keywords, std::string> binary_keywords;
+ NamedValue<n::binary_keywords_filter, std::string> binary_keywords_filter;
NamedValue<n::binary_uri_prefix, std::string> binary_uri_prefix;
NamedValue<n::builddir, FSEntry> builddir;
NamedValue<n::cache, FSEntry> cache;
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 09e387f..6ab5ca9 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -1243,7 +1243,7 @@ WriteBinaryEbuildCommand::operator() ()
.with_setenv("PALUDIS_IGNORE_PIVOT_ENV_VARIABLES",
params.package_id()->eapi()->supported()->ebuild_options()->ignore_pivot_env_variables())
.with_setenv("PALUDIS_BINARY_URI_PREFIX", params.destination_repository()->params().binary_uri_prefix())
- .with_setenv("PALUDIS_BINARY_KEYWORDS", params.destination_repository()->params().binary_keywords())
+ .with_setenv("PALUDIS_BINARY_KEYWORDS", params.binary_keywords())
.with_setenv("PALUDIS_BINARY_KEYWORDS_VARIABLE", EAPIData::get_instance()->eapi_from_string("pbin-1+"
+ params.package_id()->eapi()->exported_name())->supported()->ebuild_metadata_variables()->keywords()->name())
.with_setenv("PALUDIS_BINARY_DISTDIR_VARIABLE", EAPIData::get_instance()->eapi_from_string("pbin-1+"
diff --git a/paludis/repositories/e/ebuild.hh b/paludis/repositories/e/ebuild.hh
index 49b745d..479799b 100644
--- a/paludis/repositories/e/ebuild.hh
+++ b/paludis/repositories/e/ebuild.hh
@@ -46,6 +46,7 @@ namespace paludis
typedef Name<struct aa_name> aa;
typedef Name<struct binary_distdir_name> binary_distdir;
typedef Name<struct binary_ebuild_location_name> binary_ebuild_location;
+ typedef Name<struct binary_keywords_name> binary_keywords;
typedef Name<struct builddir_name> builddir;
typedef Name<struct clearenv_name> clearenv;
typedef Name<struct commands_name> commands;
@@ -295,6 +296,7 @@ namespace paludis
{
NamedValue<n::binary_distdir, FSEntry> binary_distdir;
NamedValue<n::binary_ebuild_location, FSEntry> binary_ebuild_location;
+ NamedValue<n::binary_keywords, std::string> binary_keywords;
NamedValue<n::builddir, FSEntry> builddir;
NamedValue<n::destination_repository, const ERepository *> destination_repository;
NamedValue<n::environment, const Environment *> environment;
diff --git a/vim/syntax/paludis-repositories-conf.vim b/vim/syntax/paludis-repositories-conf.vim
index 0cece02..b628dc8 100644
--- a/vim/syntax/paludis-repositories-conf.vim
+++ b/vim/syntax/paludis-repositories-conf.vim
@@ -45,7 +45,7 @@ syn keyword PaludisRepositoriesConfKnownKey contained
\ master_repository profiles pkgdir setsdir securitydir newsdir
\ names_cache sync sync_options eclassdirs cache write_cache
\ provides_cache importance layout use_manifest
- \ binary_uri_prefix binary_keywords binary_destination binary_distdir
+ \ binary_uri_prefix binary_keywords_filter binary_destination binary_distdir
\ eapi_when_unspecified eapi_when_unknown profile_eapi_when_unspecified
\ name handler config_template config_filename