aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/e
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/repositories/e')
-rw-r--r--paludis/repositories/e/can_skip_phase.cc12
-rw-r--r--paludis/repositories/e/can_skip_phase.hh6
-rw-r--r--paludis/repositories/e/dep_spec_pretty_printer.cc2
-rw-r--r--paludis/repositories/e/do_fetch_action.cc2
-rw-r--r--paludis/repositories/e/do_install_action.cc10
-rw-r--r--paludis/repositories/e/do_pretend_action.cc6
-rw-r--r--paludis/repositories/e/e_installed_repository.cc4
-rw-r--r--paludis/repositories/e/e_installed_repository.hh2
-rw-r--r--paludis/repositories/e/e_key.cc2
-rw-r--r--paludis/repositories/e/e_repository.cc14
-rw-r--r--paludis/repositories/e/e_repository.hh4
-rw-r--r--paludis/repositories/e/ebuild_id.cc32
-rw-r--r--paludis/repositories/e/exheres_profile.cc4
-rw-r--r--paludis/repositories/e/exheres_profile.hh2
-rw-r--r--paludis/repositories/e/exndbam_repository.cc4
-rw-r--r--paludis/repositories/e/myoptions_requirements_verifier.cc12
-rw-r--r--paludis/repositories/e/myoptions_requirements_verifier.hh4
-rw-r--r--paludis/repositories/e/profile.hh2
-rw-r--r--paludis/repositories/e/required_use_verifier.cc12
-rw-r--r--paludis/repositories/e/required_use_verifier.hh4
-rw-r--r--paludis/repositories/e/traditional_profile.cc10
-rw-r--r--paludis/repositories/e/traditional_profile.hh2
-rw-r--r--paludis/repositories/e/vdb_repository.cc24
-rw-r--r--paludis/repositories/e/vdb_repository.hh2
24 files changed, 103 insertions, 75 deletions
diff --git a/paludis/repositories/e/can_skip_phase.cc b/paludis/repositories/e/can_skip_phase.cc
index 5da1710eb..0aa79efd1 100644
--- a/paludis/repositories/e/can_skip_phase.cc
+++ b/paludis/repositories/e/can_skip_phase.cc
@@ -36,9 +36,13 @@ namespace
{
struct FindAnyFetchesFinder
{
+ const Environment * const env;
+ const std::shared_ptr<const PackageID> package_id;
bool result;
- FindAnyFetchesFinder() :
+ FindAnyFetchesFinder(const Environment * const e, const std::shared_ptr<const PackageID> & id) :
+ env(e),
+ package_id(id),
result(true)
{
}
@@ -66,7 +70,9 @@ namespace
}
bool
-paludis::erepository::can_skip_phase(const std::shared_ptr<const ERepositoryID> & id,
+paludis::erepository::can_skip_phase(
+ const Environment * const env,
+ const std::shared_ptr<const ERepositoryID> & id,
const EAPIPhase & phase)
{
if (! id->defined_phases_key())
@@ -87,7 +93,7 @@ paludis::erepository::can_skip_phase(const std::shared_ptr<const ERepositoryID>
{
if (id->fetches_key())
{
- FindAnyFetchesFinder f;
+ FindAnyFetchesFinder f(env, id);
id->fetches_key()->value()->top()->accept(f);
if (! f.result)
return false;
diff --git a/paludis/repositories/e/can_skip_phase.hh b/paludis/repositories/e/can_skip_phase.hh
index a5e05857c..9a01e4d4b 100644
--- a/paludis/repositories/e/can_skip_phase.hh
+++ b/paludis/repositories/e/can_skip_phase.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008 Ciaran McCreesh
+ * Copyright (c) 2008, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -28,7 +28,9 @@ namespace paludis
{
namespace erepository
{
- bool can_skip_phase(const std::shared_ptr<const ERepositoryID> & id,
+ bool can_skip_phase(
+ const Environment * const,
+ const std::shared_ptr<const ERepositoryID> & id,
const EAPIPhase &) PALUDIS_ATTRIBUTE((warn_unused_result));
}
}
diff --git a/paludis/repositories/e/dep_spec_pretty_printer.cc b/paludis/repositories/e/dep_spec_pretty_printer.cc
index bc88ff3e0..351be3250 100644
--- a/paludis/repositories/e/dep_spec_pretty_printer.cc
+++ b/paludis/repositories/e/dep_spec_pretty_printer.cc
@@ -425,7 +425,7 @@ DepSpecPrettyPrinter::visit(const GenericSpecTree::NodeType<LicenseDepSpec>::Typ
if (_imp->env && _imp->id && _imp->check_conditions)
{
- if (_imp->env->accept_license(node.spec()->text(), *_imp->id))
+ if (_imp->env->accept_license(node.spec()->text(), _imp->id))
_imp->s << _imp->formatter.format(*node.spec(), format::Accepted());
else
_imp->s << _imp->formatter.format(*node.spec(), format::Unaccepted());
diff --git a/paludis/repositories/e/do_fetch_action.cc b/paludis/repositories/e/do_fetch_action.cc
index aa61857b4..984b6688e 100644
--- a/paludis/repositories/e/do_fetch_action.cc
+++ b/paludis/repositories/e/do_fetch_action.cc
@@ -205,7 +205,7 @@ paludis::erepository::do_fetch_action(
if (skip)
continue;
- if (can_skip_phase(id, *phase))
+ if (can_skip_phase(env, id, *phase))
continue;
EbuildCommandParams command_params(make_named_values<EbuildCommandParams>(
diff --git a/paludis/repositories/e/do_install_action.cc b/paludis/repositories/e/do_install_action.cc
index 35cd931c3..9ef703749 100644
--- a/paludis/repositories/e/do_install_action.cc
+++ b/paludis/repositories/e/do_install_action.cc
@@ -51,9 +51,13 @@ namespace
{
struct AcceptLicenseFinder
{
+ const Environment * const env;
+ const std::shared_ptr<const PackageID> id;
std::stringstream s;
- AcceptLicenseFinder()
+ AcceptLicenseFinder(const Environment * const e, const std::shared_ptr<const PackageID> & i) :
+ env(e),
+ id(i)
{
s << "*";
}
@@ -189,7 +193,7 @@ paludis::erepository::do_install_action(
/* make ACCEPT_LICENSE */
if (! id->eapi()->supported()->ebuild_environment_variables()->env_accept_license().empty())
{
- AcceptLicenseFinder g;
+ AcceptLicenseFinder g(env, id);
if (id->license_key())
id->license_key()->value()->top()->accept(g);
@@ -258,7 +262,7 @@ paludis::erepository::do_install_action(
if (skip)
continue;
- if (can_skip_phase(id, *phase))
+ if (can_skip_phase(env, id, *phase))
{
output_manager->stdout_stream() << "--- No need to do anything for " << phase->equal_option("skipname") << " phase" << std::endl;
continue;
diff --git a/paludis/repositories/e/do_pretend_action.cc b/paludis/repositories/e/do_pretend_action.cc
index a22fe1235..2bc4d04b5 100644
--- a/paludis/repositories/e/do_pretend_action.cc
+++ b/paludis/repositories/e/do_pretend_action.cc
@@ -83,7 +83,7 @@ paludis::erepository::do_pretend_action(
if (id->raw_myoptions_key())
{
- MyOptionsRequirementsVerifier verifier(id);
+ MyOptionsRequirementsVerifier verifier(env, id);
id->raw_myoptions_key()->value()->top()->accept(verifier);
if (verifier.unmet_requirements() && ! verifier.unmet_requirements()->empty())
@@ -144,7 +144,7 @@ paludis::erepository::do_pretend_action(
if (id->required_use_key())
{
- RequiredUseVerifier verifier(id);
+ RequiredUseVerifier verifier(env, id);
id->required_use_key()->value()->top()->accept(verifier);
if (verifier.unmet_requirements() && ! verifier.unmet_requirements()->empty())
@@ -212,7 +212,7 @@ paludis::erepository::do_pretend_action(
for (EAPIPhases::ConstIterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
phase != phase_end ; ++phase)
{
- if (can_skip_phase(id, *phase))
+ if (can_skip_phase(env, id, *phase))
continue;
if (! output_manager)
diff --git a/paludis/repositories/e/e_installed_repository.cc b/paludis/repositories/e/e_installed_repository.cc
index c702b90ff..50584d0fb 100644
--- a/paludis/repositories/e/e_installed_repository.cc
+++ b/paludis/repositories/e/e_installed_repository.cc
@@ -139,9 +139,9 @@ EInstalledRepository::some_ids_might_not_be_masked() const
}
bool
-EInstalledRepository::is_suitable_destination_for(const PackageID & e) const
+EInstalledRepository::is_suitable_destination_for(const std::shared_ptr<const PackageID> & e) const
{
- std::string f(e.repository()->format_key() ? e.repository()->format_key()->value() : "");
+ std::string f(e->repository()->format_key() ? e->repository()->format_key()->value() : "");
return f == "e" || f == "ebuild" || f == "exheres" || f == "portage";
}
diff --git a/paludis/repositories/e/e_installed_repository.hh b/paludis/repositories/e/e_installed_repository.hh
index 4d2716c77..49a95ad79 100644
--- a/paludis/repositories/e/e_installed_repository.hh
+++ b/paludis/repositories/e/e_installed_repository.hh
@@ -64,7 +64,7 @@ namespace paludis
/* RepositoryDestinationInterface */
- virtual bool is_suitable_destination_for(const PackageID &) const
+ virtual bool is_suitable_destination_for(const std::shared_ptr<const PackageID> &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual bool is_default_destination() const
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index db3622e1e..8912e52c9 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -916,7 +916,7 @@ EKeywordsKey::pretty_print_flat(const Formatter<KeywordName> & f) const
std::shared_ptr<KeywordNameSet> k(std::make_shared<KeywordNameSet>());
k->insert(*i);
- if (_imp->env->accept_keywords(k, *_imp->id))
+ if (_imp->env->accept_keywords(k, _imp->id))
result.append(f.format(*i, format::Accepted()));
else
result.append(f.format(*i, format::Unaccepted()));
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index c9d4e2037..808d1625a 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -617,13 +617,13 @@ ERepository::package_ids(const QualifiedPackageName & n) const
}
std::shared_ptr<const RepositoryMaskInfo>
-ERepository::repository_masked(const PackageID & id) const
+ERepository::repository_masked(const std::shared_ptr<const PackageID> & id) const
{
Lock l(_imp->mutexes->repo_mask_mutex);
if (! _imp->has_repo_mask)
{
- Context context("When querying repository mask for '" + stringify(id) + "':");
+ Context context("When querying repository mask for '" + stringify(*id) + "':");
using namespace std::placeholders;
@@ -664,7 +664,7 @@ ERepository::repository_masked(const PackageID & id) const
_imp->has_repo_mask = true;
}
- RepositoryMaskMap::iterator r(_imp->repo_mask.find(id.name()));
+ RepositoryMaskMap::iterator r(_imp->repo_mask.find(id->name()));
if (_imp->repo_mask.end() == r)
return std::shared_ptr<const RepositoryMaskInfo>();
else
@@ -982,11 +982,11 @@ ERepository::params() const
}
bool
-ERepository::is_suitable_destination_for(const PackageID & e) const
+ERepository::is_suitable_destination_for(const std::shared_ptr<const PackageID> & e) const
{
- std::string f(e.repository()->format_key() ? e.repository()->format_key()->value() : "");
+ std::string f(e->repository()->format_key() ? e->repository()->format_key()->value() : "");
if (f == "e")
- return static_cast<const ERepositoryID &>(e).eapi()->supported()->can_be_pbin();
+ return static_cast<const ERepositoryID &>(*e).eapi()->supported()->can_be_pbin();
else
return false;
}
@@ -1863,7 +1863,7 @@ ERepository::merge(const MergeParams & m)
Context context("When merging '" + stringify(*m.package_id()) + "' at '" + stringify(m.image_dir())
+ "' to E repository '" + stringify(name()) + "':");
- if (! is_suitable_destination_for(*m.package_id()))
+ if (! is_suitable_destination_for(m.package_id()))
throw ActionFailedError("Not a suitable destination for '" + stringify(*m.package_id()) + "'");
auto is_replace(find_id(package_ids(m.package_id()->name()), m.package_id()->version()));
diff --git a/paludis/repositories/e/e_repository.hh b/paludis/repositories/e/e_repository.hh
index 1907135bf..0ac71e691 100644
--- a/paludis/repositories/e/e_repository.hh
+++ b/paludis/repositories/e/e_repository.hh
@@ -92,7 +92,7 @@ namespace paludis
/* RepositoryDestinationInterface */
- virtual bool is_suitable_destination_for(const PackageID &) const
+ virtual bool is_suitable_destination_for(const std::shared_ptr<const PackageID> &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual bool is_default_destination() const
@@ -162,7 +162,7 @@ namespace paludis
const std::shared_ptr<const erepository::Layout> layout() const;
const std::shared_ptr<const erepository::Profile> profile() const;
- std::shared_ptr<const RepositoryMaskInfo> repository_masked(const PackageID &) const;
+ std::shared_ptr<const RepositoryMaskInfo> repository_masked(const std::shared_ptr<const PackageID> &) const;
void regenerate_cache() const;
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 53873718a..22d021bd7 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -331,10 +331,10 @@ EbuildID::need_keys_added() const
add_metadata_key(std::make_shared<LiteralMetadataValueKey<std::string>>("EAPI", "EAPI", mkt_internal, _imp->eapi->name()));
_imp->repository_mask = std::make_shared<EMutableRepositoryMaskInfoKey>(shared_from_this(), "repository_mask", "Repository masked",
- std::static_pointer_cast<const ERepository>(repository())->repository_masked(*this), mkt_internal);
+ std::static_pointer_cast<const ERepository>(repository())->repository_masked(shared_from_this()), mkt_internal);
add_metadata_key(_imp->repository_mask);
_imp->profile_mask = std::make_shared<EMutableRepositoryMaskInfoKey>(shared_from_this(), "profile_mask", "Profile masked",
- std::static_pointer_cast<const ERepository>(repository())->profile()->profile_masked(*this), mkt_internal);
+ std::static_pointer_cast<const ERepository>(repository())->profile()->profile_masked(shared_from_this()), mkt_internal);
add_metadata_key(_imp->profile_mask);
std::shared_ptr<const Map<ChoiceNameWithPrefix, std::string> > maybe_use_descriptions;
@@ -435,16 +435,16 @@ namespace
{
bool ok;
const Environment * const env;
- bool (Environment::* const func) (const std::string &, const PackageID &) const;
- const PackageID * const id;
+ bool (Environment::* const func) (const std::string &, const std::shared_ptr<const PackageID> &) const;
+ const std::shared_ptr<const PackageID> id;
LicenceChecker(const Environment * const e,
- bool (Environment::* const f) (const std::string &, const PackageID &) const,
- const PackageID * const d) :
+ bool (Environment::* const f) (const std::string &, const std::shared_ptr<const PackageID> &) const,
+ const std::shared_ptr<const PackageID> & i) :
ok(true),
env(e),
func(f),
- id(d)
+ id(i)
{
}
@@ -481,7 +481,7 @@ namespace
void visit(const LicenseSpecTree::NodeType<LicenseDepSpec>::Type & node)
{
- if (! (env->*func)(node.spec()->text(), *id))
+ if (! (env->*func)(node.spec()->text(), id))
ok = false;
}
};
@@ -513,7 +513,7 @@ EbuildID::need_masks_added() const
if (keywords_key())
{
- if (! _imp->environment->accept_keywords(keywords_key()->value(), *this))
+ if (! _imp->environment->accept_keywords(keywords_key()->value(), shared_from_this()))
{
add_mask(std::make_shared<EUnacceptedMask>('K',
DistributionData::get_instance()->distribution_from_string(
@@ -534,7 +534,7 @@ EbuildID::need_masks_added() const
if (license_key())
{
- LicenceChecker c(_imp->environment, &Environment::accept_license, this);
+ LicenceChecker c(_imp->environment, &Environment::accept_license, shared_from_this());
license_key()->value()->top()->accept(c);
if (! c.ok)
add_mask(std::make_shared<EUnacceptedMask>('L',
@@ -542,7 +542,7 @@ EbuildID::need_masks_added() const
_imp->environment->distribution())->concept_license(), license_key()));
}
- if (! _imp->environment->unmasked_by_user(*this))
+ if (! _imp->environment->unmasked_by_user(shared_from_this()))
{
/* repo unless user */
if (_imp->repository_mask->value())
@@ -553,7 +553,7 @@ EbuildID::need_masks_added() const
add_mask(std::make_shared<ERepositoryMask>('P', "profile", _imp->profile_mask));
/* user */
- std::shared_ptr<const Mask> user_mask(_imp->environment->mask_for_user(*this, false));
+ std::shared_ptr<const Mask> user_mask(_imp->environment->mask_for_user(shared_from_this(), false));
if (user_mask)
add_mask(user_mask);
}
@@ -576,7 +576,7 @@ EbuildID::need_masks_added() const
)));
/* user */
- std::shared_ptr<const Mask> user_mask(_imp->environment->mask_for_user(*this, true));
+ std::shared_ptr<const Mask> user_mask(_imp->environment->mask_for_user(shared_from_this(), true));
if (user_mask)
add_overridden_mask(std::make_shared<OverriddenMask>(
make_named_values<OverriddenMask>(
@@ -587,7 +587,7 @@ EbuildID::need_masks_added() const
}
/* break portage */
- std::shared_ptr<const Mask> breaks_mask(_imp->environment->mask_for_breakage(*this));
+ std::shared_ptr<const Mask> breaks_mask(_imp->environment->mask_for_breakage(shared_from_this()));
if (breaks_mask)
add_mask(breaks_mask);
}
@@ -602,8 +602,8 @@ EbuildID::invalidate_masks() const
_imp->has_masks = false;
PackageID::invalidate_masks();
- _imp->repository_mask->set_value(std::static_pointer_cast<const ERepository>(repository())->repository_masked(*this));
- _imp->profile_mask->set_value(std::static_pointer_cast<const ERepository>(repository())->profile()->profile_masked(*this));
+ _imp->repository_mask->set_value(std::static_pointer_cast<const ERepository>(repository())->repository_masked(shared_from_this()));
+ _imp->profile_mask->set_value(std::static_pointer_cast<const ERepository>(repository())->profile()->profile_masked(shared_from_this()));
}
const std::string
diff --git a/paludis/repositories/e/exheres_profile.cc b/paludis/repositories/e/exheres_profile.cc
index 75eb67190..9020e62e5 100644
--- a/paludis/repositories/e/exheres_profile.cc
+++ b/paludis/repositories/e/exheres_profile.cc
@@ -358,9 +358,9 @@ ExheresProfile::environment_variable(const std::string & s) const
}
const std::shared_ptr<const RepositoryMaskInfo>
-ExheresProfile::profile_masked(const PackageID & id) const
+ExheresProfile::profile_masked(const std::shared_ptr<const PackageID> & id) const
{
- PackageMaskMap::const_iterator rr(_imp->package_mask.find(id.name()));
+ PackageMaskMap::const_iterator rr(_imp->package_mask.find(id->name()));
if (_imp->package_mask.end() == rr)
return std::shared_ptr<const RepositoryMaskInfo>();
else
diff --git a/paludis/repositories/e/exheres_profile.hh b/paludis/repositories/e/exheres_profile.hh
index 9b015c740..3123cd6c6 100644
--- a/paludis/repositories/e/exheres_profile.hh
+++ b/paludis/repositories/e/exheres_profile.hh
@@ -90,7 +90,7 @@ namespace paludis
virtual const std::string environment_variable(const std::string &) const;
- virtual const std::shared_ptr<const RepositoryMaskInfo> profile_masked(const PackageID &) const;
+ virtual const std::shared_ptr<const RepositoryMaskInfo> profile_masked(const std::shared_ptr<const PackageID> &) const;
virtual const std::shared_ptr<const SetSpecTree> system_packages() const;
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index 12b805b43..3cf7194e5 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -335,7 +335,7 @@ ExndbamRepository::merge(const MergeParams & m)
Context context("When merging '" + stringify(*m.package_id()) + "' at '" + stringify(m.image_dir())
+ "' to Exndbam repository '" + stringify(name()) + "':");
- if (! is_suitable_destination_for(*m.package_id()))
+ if (! is_suitable_destination_for(m.package_id()))
throw ActionFailedError("Not a suitable destination for '" + stringify(*m.package_id()) + "'");
std::shared_ptr<const PackageID> if_overwritten_id, if_same_name_id;
@@ -506,7 +506,7 @@ ExndbamRepository::perform_uninstall(
for (EAPIPhases::ConstIterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
phase != phase_end ; ++phase)
{
- if (can_skip_phase(id, *phase))
+ if (can_skip_phase(_imp->params.environment(), id, *phase))
{
output_manager->stdout_stream() << "--- No need to do anything for " <<
phase->equal_option("skipname") << " phase" << std::endl;
diff --git a/paludis/repositories/e/myoptions_requirements_verifier.cc b/paludis/repositories/e/myoptions_requirements_verifier.cc
index 02b6a6a74..6ba7099e4 100644
--- a/paludis/repositories/e/myoptions_requirements_verifier.cc
+++ b/paludis/repositories/e/myoptions_requirements_verifier.cc
@@ -46,6 +46,7 @@ namespace paludis
template <>
struct Imp<MyOptionsRequirementsVerifier>
{
+ const Environment * const env;
const std::shared_ptr<const ERepositoryID> id;
std::shared_ptr<Sequence<std::string> > unmet_requirements;
@@ -53,7 +54,10 @@ namespace paludis
std::list<ChildrenList> current_children_stack;
std::list<int> number_enabled_stack;
- Imp(const std::shared_ptr<const ERepositoryID> & i) :
+ Imp(
+ const Environment * const e,
+ const std::shared_ptr<const ERepositoryID> & i) :
+ env(e),
id(i),
unmet_requirements(std::make_shared<Sequence<std::string>>())
{
@@ -64,8 +68,10 @@ namespace paludis
};
}
-MyOptionsRequirementsVerifier::MyOptionsRequirementsVerifier(const std::shared_ptr<const ERepositoryID> & id) :
- Pimp<MyOptionsRequirementsVerifier>(id)
+MyOptionsRequirementsVerifier::MyOptionsRequirementsVerifier(
+ const Environment * const e,
+ const std::shared_ptr<const ERepositoryID> & id) :
+ Pimp<MyOptionsRequirementsVerifier>(e, id)
{
}
diff --git a/paludis/repositories/e/myoptions_requirements_verifier.hh b/paludis/repositories/e/myoptions_requirements_verifier.hh
index 728c4b9b5..192d24586 100644
--- a/paludis/repositories/e/myoptions_requirements_verifier.hh
+++ b/paludis/repositories/e/myoptions_requirements_verifier.hh
@@ -40,7 +40,9 @@ namespace paludis
const std::shared_ptr<const DepSpecAnnotations> &);
public:
- MyOptionsRequirementsVerifier(const std::shared_ptr<const ERepositoryID> &);
+ MyOptionsRequirementsVerifier(
+ const Environment * const,
+ const std::shared_ptr<const ERepositoryID> &);
~MyOptionsRequirementsVerifier();
const std::shared_ptr<const Sequence<std::string> > unmet_requirements() const PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/repositories/e/profile.hh b/paludis/repositories/e/profile.hh
index 5cc09da31..821c3f78a 100644
--- a/paludis/repositories/e/profile.hh
+++ b/paludis/repositories/e/profile.hh
@@ -91,7 +91,7 @@ namespace paludis
virtual const std::string environment_variable(const std::string &) const = 0;
- virtual const std::shared_ptr<const RepositoryMaskInfo> profile_masked(const PackageID &) const = 0;
+ virtual const std::shared_ptr<const RepositoryMaskInfo> profile_masked(const std::shared_ptr<const PackageID> &) const = 0;
virtual const std::shared_ptr<const SetSpecTree> system_packages() const = 0;
diff --git a/paludis/repositories/e/required_use_verifier.cc b/paludis/repositories/e/required_use_verifier.cc
index 45402ba09..f39633007 100644
--- a/paludis/repositories/e/required_use_verifier.cc
+++ b/paludis/repositories/e/required_use_verifier.cc
@@ -47,13 +47,17 @@ namespace paludis
template <>
struct Imp<RequiredUseVerifier>
{
+ const Environment * const env;
const std::shared_ptr<const ERepositoryID> id;
std::shared_ptr<Sequence<std::string> > unmet_requirements;
std::list<Met> stack;
bool top;
- Imp(const std::shared_ptr<const ERepositoryID> & i) :
+ Imp(
+ const Environment * const e,
+ const std::shared_ptr<const ERepositoryID> & i) :
+ env(e),
id(i),
unmet_requirements(std::make_shared<Sequence<std::string>>()),
top(true)
@@ -63,8 +67,10 @@ namespace paludis
};
}
-RequiredUseVerifier::RequiredUseVerifier(const std::shared_ptr<const ERepositoryID> & id) :
- Pimp<RequiredUseVerifier>(id)
+RequiredUseVerifier::RequiredUseVerifier(
+ const Environment * const e,
+ const std::shared_ptr<const ERepositoryID> & id) :
+ Pimp<RequiredUseVerifier>(e, id)
{
}
diff --git a/paludis/repositories/e/required_use_verifier.hh b/paludis/repositories/e/required_use_verifier.hh
index 5847e5afd..4622ed936 100644
--- a/paludis/repositories/e/required_use_verifier.hh
+++ b/paludis/repositories/e/required_use_verifier.hh
@@ -39,7 +39,9 @@ namespace paludis
bool matches(const std::string &);
public:
- RequiredUseVerifier(const std::shared_ptr<const ERepositoryID> &);
+ RequiredUseVerifier(
+ const Environment * const,
+ const std::shared_ptr<const ERepositoryID> &);
~RequiredUseVerifier();
const std::shared_ptr<const Sequence<std::string> > unmet_requirements() const PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/repositories/e/traditional_profile.cc b/paludis/repositories/e/traditional_profile.cc
index fa15647b4..ce8cee8d9 100644
--- a/paludis/repositories/e/traditional_profile.cc
+++ b/paludis/repositories/e/traditional_profile.cc
@@ -872,7 +872,7 @@ TraditionalProfile::use_masked(
for (PackageFlagStatusMapList::const_iterator g(i->package_use_mask.begin()),
g_end(i->package_use_mask.end()) ; g != g_end ; ++g)
{
- if (! match_package(*_imp->env, *g->first, *id, { }))
+ if (! match_package(*_imp->env, *g->first, id, { }))
continue;
FlagStatusMap::const_iterator h(g->second.find(value_prefixed));
@@ -908,7 +908,7 @@ TraditionalProfile::use_forced(
for (PackageFlagStatusMapList::const_iterator g(i->package_use_force.begin()),
g_end(i->package_use_force.end()) ; g != g_end ; ++g)
{
- if (! match_package(*_imp->env, *g->first, *id, { }))
+ if (! match_package(*_imp->env, *g->first, id, { }))
continue;
FlagStatusMap::const_iterator h(g->second.find(value_prefixed));
@@ -937,7 +937,7 @@ TraditionalProfile::use_state_ignoring_masks(
for (PackageFlagStatusMapList::const_iterator g(i->package_use.begin()),
g_end(i->package_use.end()) ; g != g_end ; ++g)
{
- if (! match_package(*_imp->env, *g->first, *id, { }))
+ if (! match_package(*_imp->env, *g->first, id, { }))
continue;
FlagStatusMap::const_iterator h(g->second.find(value_prefixed));
@@ -1037,9 +1037,9 @@ TraditionalProfile::virtuals() const
}
const std::shared_ptr<const RepositoryMaskInfo>
-TraditionalProfile::profile_masked(const PackageID & id) const
+TraditionalProfile::profile_masked(const std::shared_ptr<const PackageID> & id) const
{
- PackageMaskMap::const_iterator rr(_imp->package_mask.find(id.name()));
+ PackageMaskMap::const_iterator rr(_imp->package_mask.find(id->name()));
if (_imp->package_mask.end() == rr)
return std::shared_ptr<const RepositoryMaskInfo>();
else
diff --git a/paludis/repositories/e/traditional_profile.hh b/paludis/repositories/e/traditional_profile.hh
index cee6fd131..27868c8c0 100644
--- a/paludis/repositories/e/traditional_profile.hh
+++ b/paludis/repositories/e/traditional_profile.hh
@@ -87,7 +87,7 @@ namespace paludis
virtual const std::string environment_variable(const std::string &) const;
- virtual const std::shared_ptr<const RepositoryMaskInfo> profile_masked(const PackageID &) const;
+ virtual const std::shared_ptr<const RepositoryMaskInfo> profile_masked(const std::shared_ptr<const PackageID> &) const;
virtual const std::shared_ptr<const SetSpecTree> system_packages() const;
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index ed3e03a17..c88944b3e 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -434,7 +434,7 @@ VDBRepository::perform_uninstall(
for (EAPIPhases::ConstIterator phase(phases.begin_phases()), phase_end(phases.end_phases()) ;
phase != phase_end ; ++phase)
{
- if (can_skip_phase(id, *phase))
+ if (can_skip_phase(_imp->params.environment(), id, *phase))
{
output_manager->stdout_stream() << "--- No need to do anything for " << phase->equal_option("skipname") << " phase" << std::endl;
continue;
@@ -704,16 +704,16 @@ VDBRepository::load_provided_using_cache() const
}
void
-VDBRepository::provides_from_package_id(const PackageID & id) const
+VDBRepository::provides_from_package_id(const std::shared_ptr<const PackageID> & id) const
{
- Context context("When loading VDB PROVIDEs entry for '" + stringify(id) + "':");
+ Context context("When loading VDB PROVIDEs entry for '" + stringify(*id) + "':");
try
{
- if (! id.provide_key())
+ if (! id->provide_key())
return;
- std::shared_ptr<const ProvideSpecTree> provide(id.provide_key()->value());
+ std::shared_ptr<const ProvideSpecTree> provide(id->provide_key()->value());
DepSpecFlattener<ProvideSpecTree, PackageDepSpec> f(_imp->params.environment());
provide->top()->accept(f);
@@ -726,12 +726,12 @@ VDBRepository::provides_from_package_id(const PackageID & id) const
if (pp.category() != CategoryNamePart("virtual"))
Log::get_instance()->message("e.vdb.provide.non_virtual", ll_warning, lc_no_context)
- << "PROVIDE of non-virtual '" << pp << "' from '" << id << "' will not work as expected";
+ << "PROVIDE of non-virtual '" << pp << "' from '" << *id << "' will not work as expected";
qpns->push_back(pp);
}
- ProvidesMap::iterator it(_imp->provides_map->find(std::make_pair(id.name(), id.version())));
+ ProvidesMap::iterator it(_imp->provides_map->find(std::make_pair(id->name(), id->version())));
if (qpns->empty())
{
if (_imp->provides_map->end() != it)
@@ -740,7 +740,7 @@ VDBRepository::provides_from_package_id(const PackageID & id) const
else
{
if (_imp->provides_map->end() == it)
- _imp->provides_map->insert(std::make_pair(std::make_pair(id.name(), id.version()), qpns));
+ _imp->provides_map->insert(std::make_pair(std::make_pair(id->name(), id->version()), qpns));
else
it->second = qpns;
}
@@ -752,7 +752,7 @@ VDBRepository::provides_from_package_id(const PackageID & id) const
catch (const Exception & ee)
{
Log::get_instance()->message("e.vdb.provides.failure", ll_warning, lc_no_context) << "Skipping VDB PROVIDE entry for '"
- << id << "' due to exception '" << ee.message() << "' (" << ee.what() << ")";
+ << *id << "' due to exception '" << ee.message() << "' (" << ee.what() << ")";
}
}
@@ -779,7 +779,7 @@ VDBRepository::load_provided_the_slow_way() const
i != i_end ; ++i)
for (PackageIDSequence::ConstIterator e(i->second->begin()), e_end(i->second->end()) ;
e != e_end ; ++e)
- provides_from_package_id(**e);
+ provides_from_package_id(*e);
Log::get_instance()->message("e.vdb.provides.done", ll_debug, lc_no_context) << "Done VDB PROVIDEs map creation";
}
@@ -888,7 +888,7 @@ VDBRepository::merge(const MergeParams & m)
Context context("When merging '" + stringify(*m.package_id()) + "' at '" + stringify(m.image_dir())
+ "' to VDB repository '" + stringify(name()) + "':");
- if (! is_suitable_destination_for(*m.package_id()))
+ if (! is_suitable_destination_for(m.package_id()))
throw ActionFailedError("Not a suitable destination for '" + stringify(*m.package_id()) + "'");
std::shared_ptr<const ERepositoryID> is_replace(package_id_if_exists(m.package_id()->name(), m.package_id()->version()));
@@ -1050,7 +1050,7 @@ VDBRepository::merge(const MergeParams & m)
if (_imp->used_provides_cache || (! _imp->tried_provides_cache && load_provided_using_cache()))
{
- provides_from_package_id(*m.package_id());
+ provides_from_package_id(m.package_id());
write_provides_cache();
_imp->provides.reset();
}
diff --git a/paludis/repositories/e/vdb_repository.hh b/paludis/repositories/e/vdb_repository.hh
index 8e8dfc2ca..56b02f364 100644
--- a/paludis/repositories/e/vdb_repository.hh
+++ b/paludis/repositories/e/vdb_repository.hh
@@ -83,7 +83,7 @@ namespace paludis
void _add_metadata_keys() const;
bool load_provided_using_cache() const;
- void provides_from_package_id(const PackageID &) const;
+ void provides_from_package_id(const std::shared_ptr<const PackageID> &) const;
void load_provided_the_slow_way() const;
void write_provides_cache() const;