aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-05-22 22:33:20 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-05-22 22:33:20 +0000
commitdba69d827e2c0df73829c8ff95ff424230f8b856 (patch)
treeeb7bcdda8b8db58cef57ccc42f5a4eaea7c429d5
parentb2a3de9c4942c25e1158624840b0bf8277d9fcef (diff)
downloadpaludis-dba69d827e2c0df73829c8ff95ff424230f8b856.tar.gz
paludis-dba69d827e2c0df73829c8ff95ff424230f8b856.tar.xz
Clean up various small todo items: Don't hardcode mirror://gentoo/, replace some InternalError throws with better exceptions
-rw-r--r--paludis/environment.cc4
-rw-r--r--paludis/portage_repository.cc19
2 files changed, 11 insertions, 12 deletions
diff --git a/paludis/environment.cc b/paludis/environment.cc
index 9a16e8b..01e9517 100644
--- a/paludis/environment.cc
+++ b/paludis/environment.cc
@@ -108,12 +108,12 @@ namespace
void visit(const PackageDepAtom *) PALUDIS_ATTRIBUTE((noreturn))
{
- throw InternalError(PALUDIS_HERE, "todo: encountered PackageDepAtom in licence?"); /// \bug todo
+ throw InternalError(PALUDIS_HERE, "Encountered PackageDepAtom in licence?");
}
void visit(const BlockDepAtom *) PALUDIS_ATTRIBUTE((noreturn))
{
- throw InternalError(PALUDIS_HERE, "todo: encountered BlockDepAtom in licence?"); /// \bug todo
+ throw InternalError(PALUDIS_HERE, "Encountered BlockDepAtom in licence?");
}
///}
};
diff --git a/paludis/portage_repository.cc b/paludis/portage_repository.cc
index 9098bcb..6772048 100644
--- a/paludis/portage_repository.cc
+++ b/paludis/portage_repository.cc
@@ -307,7 +307,9 @@ Implementation<PortageRepository>::add_profile(const FSEntry & f) const
std::string arch(profile_env["ARCH"]);
if (arch.empty())
- throw InternalError(PALUDIS_HERE, "todo: ARCH unset"); /// \todo
+ throw PortageRepositoryConfigurationError("ARCH variable is unset for repository at '"
+ + stringify(location) + "'");
+
use[UseFlagName(arch)] = use_enabled;
}
@@ -1001,7 +1003,6 @@ bool
PortageRepository::do_query_profile_masks(const CategoryNamePart &,
const PackageNamePart &, const VersionSpec &) const
{
- /// \todo
return false;
}
@@ -1254,7 +1255,6 @@ PortageRepository::do_is_expand_flag(const UseFlagName & u) const
_imp->has_profile = true;
}
- /// \todo VV no need for this to be linear
for (UseFlagSet::const_iterator i(_imp->expand_list.begin()),
i_end(_imp->expand_list.end()) ; i != i_end ; ++i)
if (0 == strncasecmp(
@@ -1294,7 +1294,6 @@ PortageRepository::do_is_mirror(const std::string & s) const
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)
@@ -1420,18 +1419,18 @@ PortageRepository::do_install(const QualifiedPackageName & q, const VersionSpec
flat_src_uri.append(" ");
/* add mirror://gentoo/ entries */
- /// \todo don't hardcode
- if (is_mirror("gentoo") && ! no_mirror)
+ std::string master_mirror(strip_trailing_string(stringify(name()), "x-"));
+ if (is_mirror(master_mirror) && ! no_mirror)
{
for (Environment::MirrorIterator
- m(_imp->env->begin_mirrors("gentoo")),
- m_end(_imp->env->end_mirrors("gentoo")) ;
+ m(_imp->env->begin_mirrors(master_mirror)),
+ m_end(_imp->env->end_mirrors(master_mirror)) ;
m != m_end ; ++m)
flat_src_uri.append(m->second + "/" + (*ff)->text().substr(p + 1) + " ");
for (std::list<std::string>::iterator
- m(_imp->mirrors.find("gentoo")->second.begin()),
- m_end(_imp->mirrors.find("gentoo")->second.end()) ;
+ m(_imp->mirrors.find(master_mirror)->second.begin()),
+ m_end(_imp->mirrors.find(master_mirror)->second.end()) ;
m != m_end ; ++m)
flat_src_uri.append(*m + "/" + (*ff)->text().substr(p + 1) + " ");
}