aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-07-14 03:07:35 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-07-14 03:14:00 +0100
commitfabd135405ff2866b91035a565359bd1574019a9 (patch)
tree697fb9da14e6d0575c2e963aa650b6d290379383
parent56ce29592f7c244795f20e0b99987f1854da01ea (diff)
downloadpaludis-fabd135405ff2866b91035a565359bd1574019a9.tar.gz
paludis-fabd135405ff2866b91035a565359bd1574019a9.tar.xz
Reporting needs tweaks for previous (continued)
-rw-r--r--paludis/report_task.cc50
-rw-r--r--paludis/report_task.hh5
-rw-r--r--src/clients/paludis/report.cc44
3 files changed, 60 insertions, 39 deletions
diff --git a/paludis/report_task.cc b/paludis/report_task.cc
index 89b47f7..cdc2d11 100644
--- a/paludis/report_task.cc
+++ b/paludis/report_task.cc
@@ -194,28 +194,37 @@ ReportTask::execute()
v != v_end ; ++v)
{
bool is_missing(false);
- std::tr1::shared_ptr<const PackageID> origin;
- std::tr1::shared_ptr<RepositoryName> repo_name;
+ std::tr1::shared_ptr<PackageIDSequence> origins;
- if ((*v)->source_origin_key())
+ if ((*v)->from_repositories_key())
{
- repo_name.reset(new RepositoryName((*v)->source_origin_key()->value()));
-
- std::tr1::shared_ptr<const PackageIDSequence> installable(
- (*e)[selection::BestVersionOnly(
- generator::Matches(make_package_dep_spec()
- .package((*v)->name())
- .version_requirement(VersionRequirement(vo_equal, (*v)->version()))
- .repository(*repo_name)) |
- filter::SupportsAction<InstallAction>())]);
-
- if (installable->empty())
- is_missing = ! ((*v)->transient_key() && (*v)->transient_key()->value());
- else
- origin = *installable->last();
+ is_missing = ! ((*v)->transient_key() && (*v)->transient_key()->value());
+
+ for (Set<std::string>::ConstIterator o((*v)->from_repositories_key()->value()->begin()),
+ o_end((*v)->from_repositories_key()->value()->end()) ;
+ o != o_end ; ++o)
+ {
+ std::tr1::shared_ptr<const PackageIDSequence> installable(
+ (*e)[selection::BestVersionOnly(
+ generator::Matches(make_package_dep_spec()
+ .package((*v)->name())
+ .version_requirement(VersionRequirement(vo_equal, (*v)->version()))
+ .in_repository(RepositoryName(*o))) |
+ filter::SupportsAction<InstallAction>())]);
+
+ if (! installable->empty())
+ {
+ is_missing = false;
+ if (! origins)
+ origins.reset(new PackageIDSequence);
+ origins->push_back(*installable->last());
+ }
+ }
}
- bool is_masked(origin && origin->masked());
+ bool is_masked(origins && origins->end() == std::find_if(origins->begin(),
+ origins->end(), std::tr1::bind(std::tr1::mem_fn(&PackageID::masked),
+ std::tr1::placeholders::_1)));
bool is_vulnerable(false);
bool is_unused(false);
@@ -230,7 +239,7 @@ ReportTask::execute()
{
on_report_package_failure_pre(*v);
if (is_masked)
- on_report_package_is_masked(*v, origin);
+ on_report_package_is_masked(*v, origins);
if (is_vulnerable)
{
on_report_package_is_vulnerable_pre(*v);
@@ -239,7 +248,7 @@ ReportTask::execute()
on_report_package_is_vulnerable_post(*v);
}
if (is_missing)
- on_report_package_is_missing(*v, *repo_name);
+ on_report_package_is_missing(*v);
if (is_unused)
on_report_package_is_unused(*v);
on_report_package_failure_post(*v);
@@ -255,3 +264,4 @@ ReportTask::execute()
on_report_all_post();
}
+
diff --git a/paludis/report_task.hh b/paludis/report_task.hh
index e836c70..bce701b 100644
--- a/paludis/report_task.hh
+++ b/paludis/report_task.hh
@@ -73,12 +73,11 @@ namespace paludis
virtual void on_report_package_success(const std::tr1::shared_ptr<const PackageID> & id) = 0;
virtual void on_report_package_failure_pre(const std::tr1::shared_ptr<const PackageID> & id) = 0;
virtual void on_report_package_is_masked(const std::tr1::shared_ptr<const PackageID> & id,
- const std::tr1::shared_ptr<const PackageID> & origin) = 0;
+ const std::tr1::shared_ptr<const PackageIDSequence> & origins) = 0;
virtual void on_report_package_is_vulnerable_pre(const std::tr1::shared_ptr<const PackageID> & id) = 0;
virtual void on_report_package_is_vulnerable(const std::tr1::shared_ptr<const PackageID> & id, const GLSADepTag & glsa_tag) = 0;
virtual void on_report_package_is_vulnerable_post(const std::tr1::shared_ptr<const PackageID> & id) = 0;
- virtual void on_report_package_is_missing(const std::tr1::shared_ptr<const PackageID> & id,
- const RepositoryName & repo_name) = 0;
+ virtual void on_report_package_is_missing(const std::tr1::shared_ptr<const PackageID> & id) = 0;
virtual void on_report_package_is_unused(const std::tr1::shared_ptr<const PackageID> & id) = 0;
virtual void on_report_package_failure_post(const std::tr1::shared_ptr<const PackageID> & id) = 0;
virtual void on_report_check_package_post(const QualifiedPackageName & p) = 0;
diff --git a/src/clients/paludis/report.cc b/src/clients/paludis/report.cc
index ae7c607..a4b0d87 100644
--- a/src/clients/paludis/report.cc
+++ b/src/clients/paludis/report.cc
@@ -24,7 +24,9 @@
#include <paludis/mask.hh>
#include <paludis/dep_tag.hh>
#include <paludis/package_id.hh>
+#include <paludis/metadata_key.hh>
#include <paludis/util/visitor-impl.hh>
+#include <paludis/util/join.hh>
#include <iostream>
/** \file
@@ -58,11 +60,11 @@ namespace
virtual void on_report_check_package_pre(const QualifiedPackageName & p);
virtual void on_report_package_success(const std::tr1::shared_ptr<const PackageID> & id);
virtual void on_report_package_failure_pre(const std::tr1::shared_ptr<const PackageID> & id);
- virtual void on_report_package_is_masked(const std::tr1::shared_ptr<const PackageID> & id, const std::tr1::shared_ptr<const PackageID> & origin);
+ virtual void on_report_package_is_masked(const std::tr1::shared_ptr<const PackageID> & id, const std::tr1::shared_ptr<const PackageIDSequence> & origin);
virtual void on_report_package_is_vulnerable_pre(const std::tr1::shared_ptr<const PackageID> & id);
virtual void on_report_package_is_vulnerable(const std::tr1::shared_ptr<const PackageID> & id, const GLSADepTag & glsa_tag);
virtual void on_report_package_is_vulnerable_post(const std::tr1::shared_ptr<const PackageID> & id);
- virtual void on_report_package_is_missing(const std::tr1::shared_ptr<const PackageID> & id, const RepositoryName & repo_name);
+ virtual void on_report_package_is_missing(const std::tr1::shared_ptr<const PackageID> & id);
virtual void on_report_package_is_unused(const std::tr1::shared_ptr<const PackageID> & id);
virtual void on_report_package_failure_post(const std::tr1::shared_ptr<const PackageID> & id);
virtual void on_report_check_package_post(const QualifiedPackageName & p);
@@ -98,24 +100,33 @@ namespace
void
OurReportTask::on_report_package_is_masked(const std::tr1::shared_ptr<const PackageID> & id,
- const std::tr1::shared_ptr<const PackageID> & origin)
+ const std::tr1::shared_ptr<const PackageIDSequence> & origins)
{
cout << endl << " Masked by: ";
- bool comma(false);
- for (PackageID::MasksConstIterator m(origin->begin_masks()), m_end(origin->end_masks()) ;
- m != m_end ; ++m)
+ bool outer_comma(false);
+ for (PackageIDSequence::ConstIterator o(origins->begin()), o_end(origins->end()) ;
+ o != o_end ; ++o)
{
- if (comma)
- cout << ", ";
+ if (outer_comma)
+ cout << "; ";
- MaskDisplayer d(env, id, true);
- (*m)->accept(d);
- cout << d.result();
+ bool comma(false);
+ for (PackageID::MasksConstIterator m((*o)->begin_masks()), m_end((*o)->end_masks()) ;
+ m != m_end ; ++m)
+ {
+ if (comma)
+ cout << ", ";
+
+ MaskDisplayer d(env, id, true);
+ (*m)->accept(d);
+ cout << d.result();
- comma = true;
+ comma = true;
+ }
+ cout << " in '" << (*o)->repository()->name() << "'";
+ outer_comma = true;
}
- cout << " in its original repository '" << origin->repository()->name() << "'";
++_n_errors;
}
@@ -139,10 +150,11 @@ namespace
}
void
- OurReportTask::on_report_package_is_missing(const std::tr1::shared_ptr<const PackageID> &,
- const RepositoryName & repo_name)
+ OurReportTask::on_report_package_is_missing(const std::tr1::shared_ptr<const PackageID> & id)
{
- cout << endl << " No longer exists in its original repository '" << repo_name << "'";
+ cout << endl << " No longer exists in original repositories '" <<
+ join(id->from_repositories_key()->value()->begin(), id->from_repositories_key()->value()->end(),
+ "', '") << "'";
++_n_errors;
}