aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-05 10:23:53 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-05 10:23:53 +0000
commit18375286ec27c59665c553eddc0c439c2be12ef8 (patch)
tree9dd596931a458bfbfbfa2ff8bda02e5bc528dcfc
parent5724eb4dd0f68d101f3f44fc072369dc8c14d458 (diff)
downloadpaludis-18375286ec27c59665c553eddc0c439c2be12ef8.tar.gz
paludis-18375286ec27c59665c553eddc0c439c2be12ef8.tar.xz
Just warn rather than die if thirdpartymirrors isn't present
-rw-r--r--paludis/portage_repository.cc36
1 files changed, 22 insertions, 14 deletions
diff --git a/paludis/portage_repository.cc b/paludis/portage_repository.cc
index ca40187..cacaf86 100644
--- a/paludis/portage_repository.cc
+++ b/paludis/portage_repository.cc
@@ -989,24 +989,32 @@ PortageRepository::do_is_mirror(const std::string & s) const
{
static Tokeniser<delim_kind::AnyOfTag, delim_mode::DelimiterTag> tokeniser(" \t\n");
- LineConfigFile mirrors(_imp->location / "profiles" / "thirdpartymirrors");
- for (LineConfigFile::Iterator line(mirrors.begin()) ; line != mirrors.end() ; ++line)
+ if ((_imp->location / "profiles" / "thirdpartymirrors").exists())
{
- std::vector<std::string> entries;
- tokeniser.tokenise(*line, std::back_inserter(entries));
- if (! entries.empty())
+ LineConfigFile mirrors(_imp->location / "profiles" / "thirdpartymirrors");
+ for (LineConfigFile::Iterator line(mirrors.begin()) ; line != mirrors.end() ; ++line)
{
- /* pick up to five random mirrors only */
- /// \todo param this
- static Random r;
- std::random_shuffle(next(entries.begin()), entries.end(), r);
- if (entries.size() > 6)
- entries.resize(6);
- _imp->mirrors.insert(std::make_pair(
- entries.at(0),
- std::list<std::string>(next(entries.begin()), entries.end())));
+ std::vector<std::string> entries;
+ tokeniser.tokenise(*line, std::back_inserter(entries));
+ if (! entries.empty())
+ {
+ /* pick up to five random mirrors only */
+ /// \todo param this
+ static Random r;
+ std::random_shuffle(next(entries.begin()), entries.end(), r);
+ if (entries.size() > 6)
+ entries.resize(6);
+ _imp->mirrors.insert(std::make_pair(
+ entries.at(0),
+ std::list<std::string>(next(entries.begin()), entries.end())));
+ }
}
}
+ else
+ Log::get_instance()->message(ll_warning, "No thirdpartymirrors file found in '"
+ + stringify(_imp->location / "profiles") + "', so mirror:// SRC_URI "
+ "components cannot be fetched");
+
_imp->has_mirrors = true;
}