aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-05-04 17:17:16 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-05-04 17:17:16 +0000
commit8d29ce9e7e5bbf3f6899685a602444439257165b (patch)
tree13c99036ec6305ef3bd03f77ab1807fc14cca371
parent4aec2d583d215a9ae32a363d409676f5ce89819b (diff)
downloadpaludis-8d29ce9e7e5bbf3f6899685a602444439257165b.tar.gz
paludis-8d29ce9e7e5bbf3f6899685a602444439257165b.tar.xz
Don't try Gentoo mirrors for RESTRICT=mirror packages
-rw-r--r--paludis/portage_repository.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/paludis/portage_repository.cc b/paludis/portage_repository.cc
index 6eb2110..680bf70 100644
--- a/paludis/portage_repository.cc
+++ b/paludis/portage_repository.cc
@@ -1227,6 +1227,16 @@ PortageRepository::do_install(const QualifiedPackageName & q, const VersionSpec
PackageDatabaseEntry e(q, v, name());
+ bool fetch_restrict(false), no_mirror(false);
+ {
+ std::list<std::string> restricts;
+ tokeniser.tokenise(metadata->get(vmk_restrict), std::back_inserter(restricts));
+ fetch_restrict = (restricts.end() != std::find(restricts.begin(), restricts.end(), "fetch")) ||
+ (restricts.end() != std::find(restricts.begin(), restricts.end(), "nofetch"));
+ no_mirror = (restricts.end() != std::find(restricts.begin(), restricts.end(), "mirror")) ||
+ (restricts.end() != std::find(restricts.begin(), restricts.end(), "nomirror"));
+ }
+
std::string archives, flat_src_uri;
{
std::set<std::string> already_in_archives;
@@ -1279,8 +1289,7 @@ PortageRepository::do_install(const QualifiedPackageName & q, const VersionSpec
/* add mirror://gentoo/ entries */
/// \todo don't hardcode
- /// \todo avoid for nomirror?
- if (is_mirror("gentoo"))
+ if (is_mirror("gentoo") && ! no_mirror)
{
for (std::list<std::string>::iterator
m(_imp->mirrors.find("gentoo")->second.begin()),
@@ -1339,13 +1348,6 @@ PortageRepository::do_install(const QualifiedPackageName & q, const VersionSpec
expand_vars.insert(std::make_pair(stringify(*u), value));
}
- bool fetch_restrict(false);
- {
- std::list<std::string> restricts;
- tokeniser.tokenise(metadata->get(vmk_restrict), std::back_inserter(restricts));
- fetch_restrict = (restricts.end() != std::find(restricts.begin(), restricts.end(), "fetch"));
- }
-
EbuildFetchCommand fetch_cmd(EbuildCommandParams::create((
param<ecpk_environment>(_imp->env),
param<ecpk_db_entry>(&e),