aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-10-01 16:35:42 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-10-01 16:35:42 +0000
commitf40fbd963a32af568baf844d9555a4ca3bc2fc65 (patch)
tree2fd22a70558671d8f40ed7d6d5d6bc8dfb9cadf1
parent10c60e65e1c66ac8eb734b2bae9ec14a77b85d66 (diff)
downloadpaludis-f40fbd963a32af568baf844d9555a4ca3bc2fc65.tar.gz
paludis-f40fbd963a32af568baf844d9555a4ca3bc2fc65.tar.xz
Fix mirror, fetch restricts. Fixes: ticket:383
-rw-r--r--doc/examples/example_dep_label.cc8
-rw-r--r--paludis/repositories/e/e_key.cc23
-rw-r--r--paludis/repositories/e/eapi.cc225
-rw-r--r--paludis/repositories/e/eapi.sr3
-rw-r--r--paludis/repositories/e/eapis/0.conf11
-rw-r--r--paludis/repositories/e/eapis/exheres-0.conf24
-rw-r--r--paludis/repositories/e/eapis/paludis-1.conf11
-rw-r--r--paludis/repositories/e/ebuild_entries.cc19
8 files changed, 186 insertions, 138 deletions
diff --git a/doc/examples/example_dep_label.cc b/doc/examples/example_dep_label.cc
index 914c299..d416e75 100644
--- a/doc/examples/example_dep_label.cc
+++ b/doc/examples/example_dep_label.cc
@@ -26,6 +26,7 @@ using namespace paludis;
using std::cout;
using std::endl;
using std::setw;
+using std::left;
/* We store our results in a map from distfile name to whether it is fetch
* restricted. */
@@ -125,7 +126,7 @@ namespace
/* When we encounter a URIDepSpec, store its distfile name.
* We handle 'a -> b' style specs by taking 'b' as the
* distfile name. */
- _results.insert(std::make_pair(s.renamed_url_suffix(), _restricted.back()));
+ _results.insert(std::make_pair(s.filename(), _restricted.back()));
}
void visit_leaf(const LabelsDepSpec<URILabelVisitorTypes> & l)
@@ -175,10 +176,11 @@ int main(int, char *[])
}
/* Display summary of results */
- cout << setw(60) << "Distfile Name" << ": " << "Fetch Restricted?" << endl;
+ cout << left << setw(59) << "Distfile Name" << "| " << "Fetch Restricted?" << endl;
+ cout << std::string(59, '-') << "+" << std::string(18, '-') << endl;
for (ResultsMap::const_iterator r(results.begin()), r_end(results.end()) ;
r != r_end ; ++r)
- cout << setw(60) << r->first << ": " << (r->second ? "yes" : "no") << endl;
+ cout << left << setw(59) << r->first << "| " << (r->second ? "yes" : "no") << endl;
return EXIT_SUCCESS;
}
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index 9ae07d6..e7bc542 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -40,6 +40,7 @@
#include <paludis/repository.hh>
#include <paludis/environment.hh>
#include <paludis/stringify_formatter-impl.hh>
+#include <paludis/dep_spec_flattener.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
@@ -360,7 +361,27 @@ EURIKey::initial_label() const
Lock l(_imp->value_mutex);
if (! _imp->initial_label)
- _imp->initial_label = *parse_uri_label("default:", *_imp->id->eapi())->begin();
+ {
+ DepSpecFlattener f(_imp->env, _imp->id);
+ if (_imp->id->restrict_key())
+ _imp->id->restrict_key()->value()->accept(f);
+ for (DepSpecFlattener::ConstIterator i(f.begin()), i_end(f.end()) ;
+ i != i_end ; ++i)
+ {
+ if (_imp->id->eapi()->supported->ebuild_options->restrict_fetch->end() !=
+ std::find(_imp->id->eapi()->supported->ebuild_options->restrict_fetch->begin(),
+ _imp->id->eapi()->supported->ebuild_options->restrict_fetch->end(), (*i)->text()))
+ _imp->initial_label = *parse_uri_label("default-restrict-fetch:", *_imp->id->eapi())->begin();
+
+ else if (_imp->id->eapi()->supported->ebuild_options->restrict_fetch->end() !=
+ std::find(_imp->id->eapi()->supported->ebuild_options->restrict_fetch->begin(),
+ _imp->id->eapi()->supported->ebuild_options->restrict_fetch->end(), (*i)->text()))
+ _imp->initial_label = *parse_uri_label("default-restrict-mirror:", *_imp->id->eapi())->begin();
+ }
+
+ if (! _imp->initial_label)
+ _imp->initial_label = *parse_uri_label("default:", *_imp->id->eapi())->begin();
+ }
return _imp->initial_label;
}
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index 3798eb9..e18eb16 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -26,6 +26,7 @@
#include <paludis/util/system.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/destringify.hh>
+#include <paludis/util/set.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/stringify.hh>
@@ -36,6 +37,8 @@
#include <map>
#include <vector>
+#include <libwrapiter/libwrapiter_output_iterator.hh>
+
using namespace paludis;
using namespace paludis::erepository;
@@ -64,113 +67,121 @@ namespace paludis
KeyValueConfigFile k(*d, KeyValueConfigFileOptions());
- values.insert(std::make_pair(strip_trailing_string(d->basename(), ".conf"),
- make_shared_ptr(new EAPI(strip_trailing_string(d->basename(), ".conf"), make_shared_ptr(new SupportedEAPI(
- SupportedEAPI::create()
- .package_dep_spec_parse_mode(destringify<PackageDepSpecParseMode>(
- k.get("package_dep_spec_parse_mode")))
- .strict_package_dep_spec_parse_mode(destringify<PackageDepSpecParseMode>(
- k.get("strict_package_dep_spec_parse_mode").empty() ?
- k.get("package_dep_spec_parse_mode") :
- k.get("strict_package_dep_spec_parse_mode")))
- .dependency_spec_tree_parse_mode(destringify<DependencySpecTreeParseMode>(
- k.get("dependency_spec_tree_parse_mode")))
- .iuse_flag_parse_mode(destringify<IUseFlagParseMode>(
- k.get("iuse_flag_parse_mode")))
- .strict_iuse_flag_parse_mode(destringify<IUseFlagParseMode>(
- k.get("strict_iuse_flag_parse_mode").empty() ?
- k.get("iuse_flag_parse_mode") :
- k.get("strict_iuse_flag_parse_mode")))
- .breaks_portage(destringify<bool>(k.get("breaks_portage")))
- .uri_supports_arrow(destringify<bool>(k.get("uri_supports_arrow")))
-
- .ebuild_options(make_shared_ptr(new EAPIEbuildOptions(
- EAPIEbuildOptions::create()
- .want_portage_emulation_vars(destringify<bool>(k.get("want_portage_emulation_vars")))
- .require_use_expand_in_iuse(destringify<bool>(k.get("require_use_expand_in_iuse")))
- .rdepend_defaults_to_depend(destringify<bool>(k.get("rdepend_defaults_to_depend")))
- .non_empty_variables(k.get("non_empty_variables"))
- .directory_variables(k.get("directory_variables"))
- .directory_if_exists_variables(k.get("directory_if_exists_variables"))
- .ebuild_must_not_set_variables(k.get("ebuild_must_not_set_variables"))
- .vdb_from_env_variables(k.get("vdb_from_env_variables"))
- .vdb_from_env_unless_empty_variables(k.get("vdb_from_env_unless_empty_variables"))
- .source_merged_variables(k.get("source_merged_variables"))
- .must_not_change_variables(k.get("must_not_change_variables"))
- .save_variables(k.get("save_variables"))
- .save_base_variables(k.get("save_base_variables"))
- .save_unmodifiable_variables(k.get("save_unmodifiable_variables"))
- .support_eclasses(destringify<bool>(k.get("support_eclasses")))
- .support_exlibs(destringify<bool>(k.get("support_exlibs")))
- .utility_path_suffixes(k.get("utility_path_suffixes"))
- .ebuild_module_suffixes(k.get("ebuild_module_suffixes"))
- .use_expand_separator(destringify<char>(k.get("use_expand_separator")))
- )))
-
- .ebuild_phases(make_shared_ptr(new EAPIEbuildPhases(
- EAPIEbuildPhases::create()
- .ebuild_install(k.get("ebuild_install"))
- .ebuild_uninstall(k.get("ebuild_uninstall"))
- .ebuild_pretend(k.get("ebuild_pretend"))
- .ebuild_metadata(k.get("ebuild_metadata"))
- .ebuild_nofetch(k.get("ebuild_nofetch"))
- .ebuild_variable(k.get("ebuild_variable"))
- .ebuild_info(k.get("ebuild_info"))
- .ebuild_config(k.get("ebuild_config")))))
-
- .ebuild_metadata_variables(make_shared_ptr(new EAPIEbuildMetadataVariables(
- EAPIEbuildMetadataVariables::create()
- .metadata_build_depend(k.get("metadata_build_depend"))
- .metadata_run_depend(k.get("metadata_run_depend"))
- .metadata_slot(k.get("metadata_slot"))
- .metadata_src_uri(k.get("metadata_src_uri"))
- .metadata_restrict(k.get("metadata_restrict"))
- .metadata_homepage(k.get("metadata_homepage"))
- .metadata_license(k.get("metadata_license"))
- .metadata_description(k.get("metadata_description"))
- .metadata_keywords(k.get("metadata_keywords"))
- .metadata_eclass_keywords(k.get("metadata_eclass_keywords"))
- .metadata_inherited(k.get("metadata_inherited"))
- .metadata_iuse(k.get("metadata_iuse"))
- .metadata_pdepend(k.get("metadata_pdepend"))
- .metadata_provide(k.get("metadata_provide"))
- .metadata_eapi(k.get("metadata_eapi"))
- .description_build_depend(k.get("description_build_depend"))
- .description_run_depend(k.get("description_run_depend"))
- .description_slot(k.get("description_slot"))
- .description_src_uri(k.get("description_src_uri"))
- .description_restrict(k.get("description_restrict"))
- .description_homepage(k.get("description_homepage"))
- .description_license(k.get("description_license"))
- .description_description(k.get("description_description"))
- .description_keywords(k.get("description_keywords"))
- .description_eclass_keywords(k.get("description_eclass_keywords"))
- .description_inherited(k.get("description_inherited"))
- .description_iuse(k.get("description_iuse"))
- .description_pdepend(k.get("description_pdepend"))
- .description_provide(k.get("description_provide"))
- .description_eapi(k.get("description_eapi"))
- )))
-
- .ebuild_environment_variables(make_shared_ptr(new EAPIEbuildEnvironmentVariables(
- EAPIEbuildEnvironmentVariables::create()
- .env_use(k.get("env_use"))
- .env_use_expand(k.get("env_use_expand"))
- .env_use_expand_hidden(k.get("env_use_expand_hidden"))
- .env_aa(k.get("env_aa"))
- .env_arch(k.get("env_arch"))
- .env_kv(k.get("env_kv"))
- .env_portdir(k.get("env_portdir"))
- .env_distdir(k.get("env_distdir"))
- .env_accept_keywords(k.get("env_accept_keywords"))
- .description_use(k.get("description_use"))
- )))
-
- .uri_labels(make_shared_ptr(new EAPILabels(k.get("uri_labels"))))
-
- .dependency_labels(make_shared_ptr(new EAPILabels(k.get("dependency_labels"))))
-
- ))))));
+ tr1::shared_ptr<EAPI> eapi(new EAPI(strip_trailing_string(d->basename(), ".conf"), make_shared_ptr(new SupportedEAPI(
+ SupportedEAPI::create()
+ .package_dep_spec_parse_mode(destringify<PackageDepSpecParseMode>(
+ k.get("package_dep_spec_parse_mode")))
+ .strict_package_dep_spec_parse_mode(destringify<PackageDepSpecParseMode>(
+ k.get("strict_package_dep_spec_parse_mode").empty() ?
+ k.get("package_dep_spec_parse_mode") :
+ k.get("strict_package_dep_spec_parse_mode")))
+ .dependency_spec_tree_parse_mode(destringify<DependencySpecTreeParseMode>(
+ k.get("dependency_spec_tree_parse_mode")))
+ .iuse_flag_parse_mode(destringify<IUseFlagParseMode>(
+ k.get("iuse_flag_parse_mode")))
+ .strict_iuse_flag_parse_mode(destringify<IUseFlagParseMode>(
+ k.get("strict_iuse_flag_parse_mode").empty() ?
+ k.get("iuse_flag_parse_mode") :
+ k.get("strict_iuse_flag_parse_mode")))
+ .breaks_portage(destringify<bool>(k.get("breaks_portage")))
+ .uri_supports_arrow(destringify<bool>(k.get("uri_supports_arrow")))
+
+ .ebuild_options(make_shared_ptr(new EAPIEbuildOptions(
+ EAPIEbuildOptions::create()
+ .want_portage_emulation_vars(destringify<bool>(k.get("want_portage_emulation_vars")))
+ .require_use_expand_in_iuse(destringify<bool>(k.get("require_use_expand_in_iuse")))
+ .rdepend_defaults_to_depend(destringify<bool>(k.get("rdepend_defaults_to_depend")))
+ .non_empty_variables(k.get("non_empty_variables"))
+ .directory_variables(k.get("directory_variables"))
+ .directory_if_exists_variables(k.get("directory_if_exists_variables"))
+ .ebuild_must_not_set_variables(k.get("ebuild_must_not_set_variables"))
+ .vdb_from_env_variables(k.get("vdb_from_env_variables"))
+ .vdb_from_env_unless_empty_variables(k.get("vdb_from_env_unless_empty_variables"))
+ .source_merged_variables(k.get("source_merged_variables"))
+ .must_not_change_variables(k.get("must_not_change_variables"))
+ .save_variables(k.get("save_variables"))
+ .save_base_variables(k.get("save_base_variables"))
+ .save_unmodifiable_variables(k.get("save_unmodifiable_variables"))
+ .support_eclasses(destringify<bool>(k.get("support_eclasses")))
+ .support_exlibs(destringify<bool>(k.get("support_exlibs")))
+ .utility_path_suffixes(k.get("utility_path_suffixes"))
+ .ebuild_module_suffixes(k.get("ebuild_module_suffixes"))
+ .use_expand_separator(destringify<char>(k.get("use_expand_separator")))
+ .restrict_fetch(make_shared_ptr(new Set<std::string>))
+ .restrict_mirror(make_shared_ptr(new Set<std::string>))
+ )))
+
+ .ebuild_phases(make_shared_ptr(new EAPIEbuildPhases(
+ EAPIEbuildPhases::create()
+ .ebuild_install(k.get("ebuild_install"))
+ .ebuild_uninstall(k.get("ebuild_uninstall"))
+ .ebuild_pretend(k.get("ebuild_pretend"))
+ .ebuild_metadata(k.get("ebuild_metadata"))
+ .ebuild_nofetch(k.get("ebuild_nofetch"))
+ .ebuild_variable(k.get("ebuild_variable"))
+ .ebuild_info(k.get("ebuild_info"))
+ .ebuild_config(k.get("ebuild_config")))))
+
+ .ebuild_metadata_variables(make_shared_ptr(new EAPIEbuildMetadataVariables(
+ EAPIEbuildMetadataVariables::create()
+ .metadata_build_depend(k.get("metadata_build_depend"))
+ .metadata_run_depend(k.get("metadata_run_depend"))
+ .metadata_slot(k.get("metadata_slot"))
+ .metadata_src_uri(k.get("metadata_src_uri"))
+ .metadata_restrict(k.get("metadata_restrict"))
+ .metadata_homepage(k.get("metadata_homepage"))
+ .metadata_license(k.get("metadata_license"))
+ .metadata_description(k.get("metadata_description"))
+ .metadata_keywords(k.get("metadata_keywords"))
+ .metadata_eclass_keywords(k.get("metadata_eclass_keywords"))
+ .metadata_inherited(k.get("metadata_inherited"))
+ .metadata_iuse(k.get("metadata_iuse"))
+ .metadata_pdepend(k.get("metadata_pdepend"))
+ .metadata_provide(k.get("metadata_provide"))
+ .metadata_eapi(k.get("metadata_eapi"))
+ .description_build_depend(k.get("description_build_depend"))
+ .description_run_depend(k.get("description_run_depend"))
+ .description_slot(k.get("description_slot"))
+ .description_src_uri(k.get("description_src_uri"))
+ .description_restrict(k.get("description_restrict"))
+ .description_homepage(k.get("description_homepage"))
+ .description_license(k.get("description_license"))
+ .description_description(k.get("description_description"))
+ .description_keywords(k.get("description_keywords"))
+ .description_eclass_keywords(k.get("description_eclass_keywords"))
+ .description_inherited(k.get("description_inherited"))
+ .description_iuse(k.get("description_iuse"))
+ .description_pdepend(k.get("description_pdepend"))
+ .description_provide(k.get("description_provide"))
+ .description_eapi(k.get("description_eapi"))
+ )))
+
+ .ebuild_environment_variables(make_shared_ptr(new EAPIEbuildEnvironmentVariables(
+ EAPIEbuildEnvironmentVariables::create()
+ .env_use(k.get("env_use"))
+ .env_use_expand(k.get("env_use_expand"))
+ .env_use_expand_hidden(k.get("env_use_expand_hidden"))
+ .env_aa(k.get("env_aa"))
+ .env_arch(k.get("env_arch"))
+ .env_kv(k.get("env_kv"))
+ .env_portdir(k.get("env_portdir"))
+ .env_distdir(k.get("env_distdir"))
+ .env_accept_keywords(k.get("env_accept_keywords"))
+ .description_use(k.get("description_use"))
+ )))
+
+ .uri_labels(make_shared_ptr(new EAPILabels(k.get("uri_labels"))))
+
+ .dependency_labels(make_shared_ptr(new EAPILabels(k.get("dependency_labels"))))
+
+ ))));
+
+ WhitespaceTokeniser::get_instance()->tokenise(k.get("restrict_fetch"),
+ eapi->supported->ebuild_options->restrict_fetch->inserter());
+ WhitespaceTokeniser::get_instance()->tokenise(k.get("restrict_mirror"),
+ eapi->supported->ebuild_options->restrict_mirror->inserter());
+
+ values.insert(std::make_pair(strip_trailing_string(d->basename(), ".conf"), eapi));
}
MakeHashedMap<std::string, tr1::shared_ptr<const EAPI> >::Type::const_iterator i(values.find("0"));
diff --git a/paludis/repositories/e/eapi.sr b/paludis/repositories/e/eapi.sr
index 9eaa68f..a4c6b9e 100644
--- a/paludis/repositories/e/eapi.sr
+++ b/paludis/repositories/e/eapi.sr
@@ -132,6 +132,9 @@ make_class_EAPIEbuildOptions()
key vdb_from_env_variables std::string
key vdb_from_env_unless_empty_variables std::string
+ key restrict_fetch "tr1::shared_ptr<Set<std::string> >"
+ key restrict_mirror "tr1::shared_ptr<Set<std::string> >"
+
doxygen_comment << "END"
/**
* Information about a supported EAPI's ebuild options.
diff --git a/paludis/repositories/e/eapis/0.conf b/paludis/repositories/e/eapis/0.conf
index 2ec1f98..9c87e0b 100644
--- a/paludis/repositories/e/eapis/0.conf
+++ b/paludis/repositories/e/eapis/0.conf
@@ -21,12 +21,12 @@ vdb_from_env_variables = \
CATEGORY CHOST COUNTER DEPEND DESCRIPTION EAPI FEATURES \
HOMEPAGE INHERITED IUSE KEYWORDS LICENSE PDEPEND PF \
PROVIDE RDEPEND SLOT SRC_URI USE CONFIG_PROTECT CONFIG_PROTECT_MASK \
- VDB_FORMAT PKGMANAGER
+ VDB_FORMAT PKGMANAGER USE_EXPAND
vdb_from_env_unless_empty_variables = \
ASFLAGS CBUILD CC CFLAGS CHOST CTARGET CXX CXXFLAGS \
EXTRA_ECONF EXTRA_EINSTALL EXTRA_EMAKE LDFLAGS LIBCXXFLAGS \
- REPOSITORY
+ REPOSITORY RESTRICT
non_empty_variables = \
P PV PR PN PVR PF CATEGORY FILESDIR ECLASSDIR PORTDIR \
@@ -146,5 +146,10 @@ env_portdir = PORTDIR
env_distdir = DISTDIR
uri_labels = \
- default = URIMirrorsThenListedLabel
+ default = URIMirrorsThenListedLabel ; \
+ default-restrict-fetch = URIManualOnlyLabel ; \
+ default-restrict-mirror = URILocalMirrorsOnlyLabel
+
+restrict_mirror = mirror nomirror
+restrict_fetch = fetch nofetch
diff --git a/paludis/repositories/e/eapis/exheres-0.conf b/paludis/repositories/e/eapis/exheres-0.conf
index 2e56980..9d64d00 100644
--- a/paludis/repositories/e/eapis/exheres-0.conf
+++ b/paludis/repositories/e/eapis/exheres-0.conf
@@ -20,12 +20,12 @@ vdb_from_env_variables = \
CATEGORY CHOST DEPENDENCIES DESCRIPTION EAPI \
HOMEPAGE INHERITED MYOPTIONS PLATFORMS LICENSE PF \
SLOT SRC_URI OPTIONS CONFIG_PROTECT CONFIG_PROTECT_MASK \
- VDB_FORMAT PKGMANAGER
+ VDB_FORMAT PKGMANAGER SUBOPTIONS
vdb_from_env_unless_empty_variables = \
ASFLAGS CBUILD CC CFLAGS CHOST CTARGET CXX CXXFLAGS \
EXTRA_ECONF EXTRA_EINSTALL EXTRA_EMAKE LDFLAGS LIBCXXFLAGS \
- REPOSITORY
+ REPOSITORY RESTRICT
non_empty_variables = \
P PV PR PN PVR PF CATEGORY FILESDIR EXLIBSDIRS FETCHEDDIR REPODIR \
@@ -147,13 +147,15 @@ env_portdir = REPODIR
env_distdir = FETCHEDDIR
uri_labels = \
- default = URIListedThenMirrorsLabel ; \
- mirrors-first = URIMirrorsThenListedLabel ; \
- mirrors-only = URIMirrorsOnlyLabel ; \
- listed-only = URIListedOnlyLabel ; \
- listed-first = URIListedThenMirrorsLabel ; \
- local-only = URILocalMirrorsOnlyLabel ; \
- manual = URIManualOnlyLabel
+ default = URIListedThenMirrorsLabel ; \
+ default-restrict-fetch = URIManualOnlyLabel ; \
+ default-restrict-mirror = URILocalMirrorsOnlyLabel ; \
+ mirrors-first = URIMirrorsThenListedLabel ; \
+ mirrors-only = URIMirrorsOnlyLabel ; \
+ listed-only = URIListedOnlyLabel ; \
+ listed-first = URIListedThenMirrorsLabel ; \
+ local-only = URILocalMirrorsOnlyLabel ; \
+ manual = URIManualOnlyLabel
dependency_labels = \
host = DependencyHostLabel ; \
@@ -166,3 +168,7 @@ dependency_labels = \
recommended = DependencyRecommendedLabel ; \
required = DependencyRequiredLabel ; \
@ = DependencyABILabel
+
+restrict_mirror = mirror
+restrict_fetch = fetch
+
diff --git a/paludis/repositories/e/eapis/paludis-1.conf b/paludis/repositories/e/eapis/paludis-1.conf
index 99b4a45..aefd271 100644
--- a/paludis/repositories/e/eapis/paludis-1.conf
+++ b/paludis/repositories/e/eapis/paludis-1.conf
@@ -21,12 +21,12 @@ vdb_from_env_variables = \
CATEGORY CHOST COUNTER DEPEND DESCRIPTION EAPI FEATURES \
HOMEPAGE INHERITED IUSE KEYWORDS LICENSE PDEPEND PF \
PROVIDE RDEPEND SLOT SRC_URI USE CONFIG_PROTECT CONFIG_PROTECT_MASK \
- VDB_FORMAT PKGMANAGER
+ VDB_FORMAT PKGMANAGER USE_EXPAND
vdb_from_env_unless_empty_variables = \
ASFLAGS CBUILD CC CFLAGS CHOST CTARGET CXX CXXFLAGS \
EXTRA_ECONF EXTRA_EINSTALL EXTRA_EMAKE LDFLAGS LIBCXXFLAGS \
- REPOSITORY
+ REPOSITORY SUBOPTIONS
non_empty_variables = \
P PV PR PN PVR PF CATEGORY FILESDIR ECLASSDIR PORTDIR \
@@ -148,5 +148,10 @@ env_portdir = PORTDIR
env_distdir = DISTDIR
uri_labels = \
- default = URIListedThenMirrorsLabel
+ default = URIListedThenMirrorsLabel ; \
+ default-restrict-fetch = URIManualOnlyLabel ; \
+ default-restrict-mirror = URILocalMirrorsOnlyLabel
+
+restrict_mirror = mirror
+restrict_fetch = fetch
diff --git a/paludis/repositories/e/ebuild_entries.cc b/paludis/repositories/e/ebuild_entries.cc
index feb79ab..840e73a 100644
--- a/paludis/repositories/e/ebuild_entries.cc
+++ b/paludis/repositories/e/ebuild_entries.cc
@@ -309,23 +309,18 @@ EbuildEntries::fetch(const tr1::shared_ptr<const ERepositoryID> & id,
Context context("When fetching '" + stringify(*id) + "':");
- bool fetch_restrict(false), no_mirror(false);
+ bool fetch_restrict(false);
{
DepSpecFlattener restricts(_imp->params.environment, id);
if (id->restrict_key())
id->restrict_key()->value()->accept(restricts);
- fetch_restrict =
- restricts.end() != std::find_if(restricts.begin(), restricts.end(),
- tr1::bind(std::equal_to<std::string>(), tr1::bind(tr1::mem_fn(&StringDepSpec::text), _1), "fetch")) ||
- restricts.end() != std::find_if(restricts.begin(), restricts.end(),
- tr1::bind(std::equal_to<std::string>(), tr1::bind(tr1::mem_fn(&StringDepSpec::text), _1), "nofetch"));
-
- no_mirror =
- restricts.end() != std::find_if(restricts.begin(), restricts.end(),
- tr1::bind(std::equal_to<std::string>(), tr1::bind(tr1::mem_fn(&StringDepSpec::text), _1), "mirror")) ||
- restricts.end() != std::find_if(restricts.begin(), restricts.end(),
- tr1::bind(std::equal_to<std::string>(), tr1::bind(tr1::mem_fn(&StringDepSpec::text), _1), "nomirror"));
+ for (DepSpecFlattener::ConstIterator i(restricts.begin()), i_end(restricts.end()) ;
+ i != i_end ; ++i)
+ if (id->eapi()->supported->ebuild_options->restrict_fetch->end() !=
+ std::find(id->eapi()->supported->ebuild_options->restrict_fetch->begin(),
+ id->eapi()->supported->ebuild_options->restrict_fetch->end(), (*i)->text()))
+ fetch_restrict = true;
}
bool fetch_userpriv_ok(_imp->environment->reduced_gid() != getgid());