aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-08-28 13:50:36 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-08-28 13:50:36 +0000
commit7c80ae93eb06f7152c3485503cfaa7675fc8f8e0 (patch)
treec31a7eac03a7662aac6b4847b667b22344abe720
parentf865ba58c0642a7429f6d7d786a82c385b230fe6 (diff)
downloadpaludis-7c80ae93eb06f7152c3485503cfaa7675fc8f8e0.tar.gz
paludis-7c80ae93eb06f7152c3485503cfaa7675fc8f8e0.tar.xz
Kill per-profile checks, just do them manually
-rw-r--r--paludis/repositories/e/qa/qa_checks.cc14
-rw-r--r--paludis/repositories/e/qa/qa_checks.hh12
-rw-r--r--paludis/repositories/e/qa/qa_checks_group.cc1
-rw-r--r--paludis/repositories/e/qa/qa_controller.cc28
-rw-r--r--paludis/repositories/e/qa/visibility.cc100
-rw-r--r--paludis/repositories/e/qa/visibility.hh1
-rw-r--r--paludis/repositories/e/qa/visibility_TEST.cc8
7 files changed, 67 insertions, 97 deletions
diff --git a/paludis/repositories/e/qa/qa_checks.cc b/paludis/repositories/e/qa/qa_checks.cc
index 25c60f4..d845dd6 100644
--- a/paludis/repositories/e/qa/qa_checks.cc
+++ b/paludis/repositories/e/qa/qa_checks.cc
@@ -42,13 +42,11 @@ namespace paludis
const tr1::shared_ptr<QAChecksGroup<TreeCheckFunction> > tree_checks_group;
const tr1::shared_ptr<QAChecksGroup<CategoryDirCheckFunction> > category_dir_checks_group;
const tr1::shared_ptr<QAChecksGroup<PackageIDCheckFunction> > package_id_checks_group;
- const tr1::shared_ptr<QAChecksGroup<PerProfilePackageIDCheckFunction> > per_profile_package_id_checks_group;
Implementation() :
tree_checks_group(new QAChecksGroup<TreeCheckFunction>),
category_dir_checks_group(new QAChecksGroup<CategoryDirCheckFunction>),
- package_id_checks_group(new QAChecksGroup<PackageIDCheckFunction>),
- per_profile_package_id_checks_group(new QAChecksGroup<PerProfilePackageIDCheckFunction>)
+ package_id_checks_group(new QAChecksGroup<PackageIDCheckFunction>)
{
}
};
@@ -84,8 +82,8 @@ QAChecks::QAChecks() :
tr1::bind(extractors_check, _1, _2, _5, "extractors"));
_imp->package_id_checks_group->add_prerequirement("extractors", "eapi_supported");
- _imp->per_profile_package_id_checks_group->add_check("visibility",
- tr1::bind(visibility_check, _1, _2, _3, _4, _5, _6, "visibility"));
+ _imp->package_id_checks_group->add_check("visibility",
+ tr1::bind(visibility_check, _1, _2, _3, _4, _5, "visibility"));
}
QAChecks::~QAChecks()
@@ -110,9 +108,3 @@ QAChecks::package_id_checks_group()
return _imp->package_id_checks_group;
}
-const tr1::shared_ptr<QAChecksGroup<PerProfilePackageIDCheckFunction> >
-QAChecks::per_profile_package_id_checks_group()
-{
- return _imp->per_profile_package_id_checks_group;
-}
-
diff --git a/paludis/repositories/e/qa/qa_checks.hh b/paludis/repositories/e/qa/qa_checks.hh
index aeb6f92..7826819 100644
--- a/paludis/repositories/e/qa/qa_checks.hh
+++ b/paludis/repositories/e/qa/qa_checks.hh
@@ -63,15 +63,6 @@ namespace paludis
const tr1::shared_ptr<const ERepositoryID> &
)> PackageIDCheckFunction;
- typedef tr1::function<bool (
- const FSEntry &,
- QAReporter &,
- const Environment * const,
- const tr1::shared_ptr<const ERepository> &,
- const tr1::shared_ptr<const ERepositoryID> &,
- const ERepository::ProfilesIterator &
- )> PerProfilePackageIDCheckFunction;
-
class QAChecks :
private PrivateImplementationPattern<QAChecks>,
public InstantiationPolicy<QAChecks, instantiation_method::SingletonTag>
@@ -91,9 +82,6 @@ namespace paludis
const tr1::shared_ptr<QAChecksGroup<PackageIDCheckFunction> >
package_id_checks_group() PALUDIS_ATTRIBUTE((warn_unused_result));
-
- const tr1::shared_ptr<QAChecksGroup<PerProfilePackageIDCheckFunction> >
- per_profile_package_id_checks_group() PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
}
diff --git a/paludis/repositories/e/qa/qa_checks_group.cc b/paludis/repositories/e/qa/qa_checks_group.cc
index 7b3f7e5..d2f8111 100644
--- a/paludis/repositories/e/qa/qa_checks_group.cc
+++ b/paludis/repositories/e/qa/qa_checks_group.cc
@@ -115,5 +115,4 @@ QAChecksGroup<T_>::need_ordering() const
template class QAChecksGroup<TreeCheckFunction>;
template class QAChecksGroup<PackageIDCheckFunction>;
-template class QAChecksGroup<PerProfilePackageIDCheckFunction>;
diff --git a/paludis/repositories/e/qa/qa_controller.cc b/paludis/repositories/e/qa/qa_controller.cc
index 3dab366..72eb8ca 100644
--- a/paludis/repositories/e/qa/qa_controller.cc
+++ b/paludis/repositories/e/qa/qa_controller.cc
@@ -181,27 +181,13 @@ QAController::_run_id(const tr1::shared_ptr<const PackageID> & i)
using namespace tr1::placeholders;
try
{
- if (QAChecks::get_instance()->package_id_checks_group()->end() ==
- std::find_if(
- QAChecks::get_instance()->package_id_checks_group()->begin(),
- QAChecks::get_instance()->package_id_checks_group()->end(),
- tr1::bind(std::equal_to<bool>(), false,
- tr1::bind<bool>(tr1::mem_fn(&PackageIDCheckFunction::operator() ),
- _1, _imp->repo->layout()->package_file(*i), tr1::ref(_imp->reporter),
- _imp->env, _imp->repo, tr1::static_pointer_cast<const ERepositoryID>(i)))))
- {
- for (ERepository::ProfilesIterator p(_imp->repo->begin_profiles()), p_end(_imp->repo->end_profiles()) ;
- p != p_end ; ++p)
- {
- std::find_if(
- QAChecks::get_instance()->per_profile_package_id_checks_group()->begin(),
- QAChecks::get_instance()->per_profile_package_id_checks_group()->end(),
- tr1::bind(std::equal_to<bool>(), false,
- tr1::bind<bool>(tr1::mem_fn(&PerProfilePackageIDCheckFunction::operator() ),
- _1, _imp->repo->layout()->package_file(*i), tr1::ref(_imp->reporter),
- _imp->env, _imp->repo, tr1::static_pointer_cast<const ERepositoryID>(i), p)));
- }
- }
+ std::find_if(
+ QAChecks::get_instance()->package_id_checks_group()->begin(),
+ QAChecks::get_instance()->package_id_checks_group()->end(),
+ tr1::bind(std::equal_to<bool>(), false,
+ tr1::bind<bool>(tr1::mem_fn(&PackageIDCheckFunction::operator() ),
+ _1, _imp->repo->layout()->package_file(*i), tr1::ref(_imp->reporter),
+ _imp->env, _imp->repo, tr1::static_pointer_cast<const ERepositoryID>(i))));
}
catch (const Exception & e)
{
diff --git a/paludis/repositories/e/qa/visibility.cc b/paludis/repositories/e/qa/visibility.cc
index 1877858..ba3dd21 100644
--- a/paludis/repositories/e/qa/visibility.cc
+++ b/paludis/repositories/e/qa/visibility.cc
@@ -256,57 +256,25 @@ paludis::erepository::visibility_check(
const Environment * const env,
const tr1::shared_ptr<const ERepository> & repo,
const tr1::shared_ptr<const PackageID> & id,
- const ERepository::ProfilesIterator & profile,
const std::string & name)
{
- Context context("When performing check '" + name + "' using visibility_check on ID '" + stringify(*id) +
- "' with profile '" + stringify(profile->path) + "':");
+ Context context("When performing check '" + name + "' using visibility_check on ID '" + stringify(*id) + "':");
+
Log::get_instance()->message(ll_debug, lc_context) << "visibility_check '"
- << entry << "', '" << *id << "', '" << profile->path << "', '" << name << "'";
+ << entry << "', '" << *id << "', '" << name << "'";
- if (repo->repository_masked(*id) || profile->profile->profile_masked(*id) || ! id->keywords_key())
+ if (repo->repository_masked(*id) || ! id->keywords_key())
return true;
- std::set<KeywordName> accepted_keywords, overlap;
- WhitespaceTokeniser::get_instance()->tokenise(profile->profile->environment_variable(
- repo->accept_keywords_variable()), create_inserter<KeywordName>(std::inserter(accepted_keywords, accepted_keywords.begin())));
-
- std::set_intersection(accepted_keywords.begin(), accepted_keywords.end(),
- id->keywords_key()->value()->begin(), id->keywords_key()->value()->end(),
- std::inserter(overlap, overlap.begin()));
-
- if (! overlap.empty())
+ for (ERepository::ProfilesIterator p(repo->begin_profiles()), p_end(repo->end_profiles()) ;
+ p != p_end ; ++p)
{
- if (id->build_dependencies_key())
- {
- Checker c(entry, &reporter, env, *id, repo, accepted_keywords, profile, name, false, *id->build_dependencies_key());
- id->build_dependencies_key()->value()->accept(c);
- }
-
- if (id->run_dependencies_key())
- {
- Checker c(entry, &reporter, env, *id, repo, accepted_keywords, profile, name, false, *id->run_dependencies_key());
- id->run_dependencies_key()->value()->accept(c);
- }
+ if (p->profile->profile_masked(*id))
+ continue;
- if (id->post_dependencies_key())
- {
- Checker c(entry, &reporter, env, *id, repo, accepted_keywords, profile, name, false, *id->post_dependencies_key());
- id->post_dependencies_key()->value()->accept(c);
- }
-
- if (id->suggested_dependencies_key())
- {
- Checker c(entry, &reporter, env, *id, repo, accepted_keywords, profile, name, false, *id->suggested_dependencies_key());
- id->post_dependencies_key()->value()->accept(c);
- }
- }
- else
- {
- for (std::set<KeywordName>::iterator i(accepted_keywords.begin()), i_end(accepted_keywords.end()) ;
- i != i_end ; ++i)
- if ('~' != stringify(*i).at(0))
- accepted_keywords.insert(KeywordName("~" + stringify(*i)));
+ std::set<KeywordName> accepted_keywords, overlap;
+ WhitespaceTokeniser::get_instance()->tokenise(p->profile->environment_variable(
+ repo->accept_keywords_variable()), create_inserter<KeywordName>(std::inserter(accepted_keywords, accepted_keywords.begin())));
std::set_intersection(accepted_keywords.begin(), accepted_keywords.end(),
id->keywords_key()->value()->begin(), id->keywords_key()->value()->end(),
@@ -316,28 +284,66 @@ paludis::erepository::visibility_check(
{
if (id->build_dependencies_key())
{
- Checker c(entry, &reporter, env, *id, repo, accepted_keywords, profile, name, true, *id->build_dependencies_key());
+ Checker c(entry, &reporter, env, *id, repo, accepted_keywords, p, name, false, *id->build_dependencies_key());
id->build_dependencies_key()->value()->accept(c);
}
if (id->run_dependencies_key())
{
- Checker c(entry, &reporter, env, *id, repo, accepted_keywords, profile, name, true, *id->run_dependencies_key());
+ Checker c(entry, &reporter, env, *id, repo, accepted_keywords, p, name, false, *id->run_dependencies_key());
id->run_dependencies_key()->value()->accept(c);
}
if (id->post_dependencies_key())
{
- Checker c(entry, &reporter, env, *id, repo, accepted_keywords, profile, name, true, *id->post_dependencies_key());
+ Checker c(entry, &reporter, env, *id, repo, accepted_keywords, p, name, false, *id->post_dependencies_key());
id->post_dependencies_key()->value()->accept(c);
}
if (id->suggested_dependencies_key())
{
- Checker c(entry, &reporter, env, *id, repo, accepted_keywords, profile, name, true, *id->suggested_dependencies_key());
+ Checker c(entry, &reporter, env, *id, repo, accepted_keywords, p, name, false, *id->suggested_dependencies_key());
id->post_dependencies_key()->value()->accept(c);
}
}
+ else
+ {
+ for (std::set<KeywordName>::iterator i(accepted_keywords.begin()), i_end(accepted_keywords.end()) ;
+ i != i_end ; ++i)
+ if ('~' != stringify(*i).at(0))
+ accepted_keywords.insert(KeywordName("~" + stringify(*i)));
+
+ std::set_intersection(accepted_keywords.begin(), accepted_keywords.end(),
+ id->keywords_key()->value()->begin(), id->keywords_key()->value()->end(),
+ std::inserter(overlap, overlap.begin()));
+
+ if (! overlap.empty())
+ {
+ if (id->build_dependencies_key())
+ {
+ Checker c(entry, &reporter, env, *id, repo, accepted_keywords, p, name, true, *id->build_dependencies_key());
+ id->build_dependencies_key()->value()->accept(c);
+ }
+
+ if (id->run_dependencies_key())
+ {
+ Checker c(entry, &reporter, env, *id, repo, accepted_keywords, p, name, true, *id->run_dependencies_key());
+ id->run_dependencies_key()->value()->accept(c);
+ }
+
+ if (id->post_dependencies_key())
+ {
+ Checker c(entry, &reporter, env, *id, repo, accepted_keywords, p, name, true, *id->post_dependencies_key());
+ id->post_dependencies_key()->value()->accept(c);
+ }
+
+ if (id->suggested_dependencies_key())
+ {
+ Checker c(entry, &reporter, env, *id, repo, accepted_keywords, p, name, true, *id->suggested_dependencies_key());
+ id->post_dependencies_key()->value()->accept(c);
+ }
+ }
+ }
}
return true;
diff --git a/paludis/repositories/e/qa/visibility.hh b/paludis/repositories/e/qa/visibility.hh
index 1271a80..81cb258 100644
--- a/paludis/repositories/e/qa/visibility.hh
+++ b/paludis/repositories/e/qa/visibility.hh
@@ -37,7 +37,6 @@ namespace paludis
const Environment * const env,
const tr1::shared_ptr<const ERepository> &,
const tr1::shared_ptr<const PackageID> &,
- const ERepository::ProfilesIterator &,
const std::string &) PALUDIS_VISIBLE;
}
}
diff --git a/paludis/repositories/e/qa/visibility_TEST.cc b/paludis/repositories/e/qa/visibility_TEST.cc
index 6fb2222..f6e2746 100644
--- a/paludis/repositories/e/qa/visibility_TEST.cc
+++ b/paludis/repositories/e/qa/visibility_TEST.cc
@@ -78,7 +78,7 @@ namespace test_cases
tr1::shared_ptr<const PackageID> id1(*env.package_database()->query(query::Matches(PackageDepSpec(
"=cat-one/visible-1", pds_pm_unspecific)), qo_require_exactly_one)->begin());
TestReporter r1;
- TEST_CHECK(visibility_check(FSEntry("/var/empty"), r1, &env, repo, id1, repo->begin_profiles(), "visibility"));
+ TEST_CHECK(visibility_check(FSEntry("/var/empty"), r1, &env, repo, id1, "visibility"));
TEST_CHECK_EQUAL(r1.count, 0u);
}
@@ -86,7 +86,7 @@ namespace test_cases
tr1::shared_ptr<const PackageID> id2(*env.package_database()->query(query::Matches(PackageDepSpec(
"=cat-one/visible-2", pds_pm_unspecific)), qo_require_exactly_one)->begin());
TestReporter r2;
- TEST_CHECK(visibility_check(FSEntry("/var/empty"), r2, &env, repo, id2, repo->begin_profiles(), "visibility"));
+ TEST_CHECK(visibility_check(FSEntry("/var/empty"), r2, &env, repo, id2, "visibility"));
TEST_CHECK_EQUAL(r2.count, 0u);
}
@@ -94,7 +94,7 @@ namespace test_cases
tr1::shared_ptr<const PackageID> id3(*env.package_database()->query(query::Matches(PackageDepSpec(
"=cat-one/masked-1", pds_pm_unspecific)), qo_require_exactly_one)->begin());
TestReporter r3;
- TEST_CHECK(visibility_check(FSEntry("/var/empty"), r3, &env, repo, id3, repo->begin_profiles(), "visibility"));
+ TEST_CHECK(visibility_check(FSEntry("/var/empty"), r3, &env, repo, id3, "visibility"));
TEST_CHECK_EQUAL(r3.count, 0u);
}
@@ -102,7 +102,7 @@ namespace test_cases
tr1::shared_ptr<const PackageID> id4(*env.package_database()->query(query::Matches(PackageDepSpec(
"=cat-one/needs-masked-1", pds_pm_unspecific)), qo_require_exactly_one)->begin());
TestReporter r4;
- TEST_CHECK(visibility_check(FSEntry("/var/empty"), r4, &env, repo, id4, repo->begin_profiles(), "visibility"));
+ TEST_CHECK(visibility_check(FSEntry("/var/empty"), r4, &env, repo, id4, "visibility"));
TestMessageSuffix s4(r4.messages);
TEST_CHECK_EQUAL(r4.count, 1u);
}