aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-01-18 09:49:46 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-01-18 09:49:46 +0000
commit199d8e00b454fdf85860e69333f38f652861cf79 (patch)
tree1881c7eabb594f310c3996cc3342b66f5cf729ed
parent16c8efb2e50cb395096580480cbdc672c78317ef (diff)
downloadpaludis-199d8e00b454fdf85860e69333f38f652861cf79.tar.gz
paludis-199d8e00b454fdf85860e69333f38f652861cf79.tar.xz
Let DepList discard circular deps silently. Let DepList take both sides of use conditionals.
-rw-r--r--paludis/dep_list/dep_list.cc33
-rw-r--r--paludis/dep_list/dep_list.sr1
-rw-r--r--paludis/dep_list/options.cc4
-rw-r--r--paludis/dep_list/options.hh19
-rw-r--r--src/clients/adjutrix/display_default_system_resolution.cc2
-rw-r--r--src/clients/adjutrix/what_needs_keywording.cc27
6 files changed, 76 insertions, 10 deletions
diff --git a/paludis/dep_list/dep_list.cc b/paludis/dep_list/dep_list.cc
index 41a745f..9b7c977 100644
--- a/paludis/dep_list/dep_list.cc
+++ b/paludis/dep_list/dep_list.cc
@@ -56,6 +56,7 @@ DepListOptions::DepListOptions() :
uninstalled_deps_suggested(dl_deps_try_post),
suggested(dl_suggested_show),
circular(dl_circular_error),
+ use(dl_use_deps_standard),
blocks(dl_blocks_accumulate),
dependency_tags(false)
{
@@ -450,6 +451,9 @@ DepList::AddVisitor::visit(const PackageDepAtom * const a)
+ stringify(existing_merge_list_entry->package) + "'");
return;
}
+ else if (d->_imp->opts.circular == dl_circular_discard_silently)
+ return;
+
throw CircularDependencyError("Atom '" + stringify(*a) + "' matched by merge list entry '" +
stringify(existing_merge_list_entry->package) + "', which does not yet have its "
"dependencies installed");
@@ -502,6 +506,7 @@ DepList::AddVisitor::visit(const PackageDepAtom * const a)
mask_mask.set(mr_profile_mask);
if (masks_to_override.test(dl_override_licenses))
mask_mask.set(mr_license);
+ mask_mask.set(mr_by_association);
mask_mask.flip();
bool override_tilde_keywords(masks_to_override.test(dl_override_tilde_keywords));
@@ -633,8 +638,28 @@ DepList::AddVisitor::visit(const PackageDepAtom * const a)
void
DepList::AddVisitor::visit(const UseDepAtom * const a)
{
- if (d->_imp->env->query_use(a->flag(), d->_imp->current_pde()) ^ a->inverse())
- std::for_each(a->begin(), a->end(), accept_visitor(this));
+ if (d->_imp->opts.use == dl_use_deps_standard)
+ {
+ if (d->_imp->env->query_use(a->flag(), d->_imp->current_pde()) ^ a->inverse())
+ std::for_each(a->begin(), a->end(), accept_visitor(this));
+ }
+ else
+ {
+ RepositoryUseInterface * u;
+ if ((! d->_imp->current_pde()) || (! ((u = d->_imp->env->package_database()->fetch_repository(
+ d->_imp->current_pde()->repository)->use_interface))))
+ std::for_each(a->begin(), a->end(), accept_visitor(this));
+ else if (a->inverse())
+ {
+ if (! u->query_use_force(a->flag(), d->_imp->current_pde()))
+ std::for_each(a->begin(), a->end(), accept_visitor(this));
+ }
+ else
+ {
+ if (! u->query_use_mask(a->flag(), d->_imp->current_pde()))
+ std::for_each(a->begin(), a->end(), accept_visitor(this));
+ }
+ }
}
void
@@ -1104,7 +1129,9 @@ DepList::add_postdeps(DepAtom::ConstPointer d, const DepListDepsOption opt, cons
}
catch (const CircularDependencyError &)
{
- Save<DepListCircularOption> save_circular(&_imp->opts.circular, dl_circular_discard);
+ Save<DepListCircularOption> save_circular(&_imp->opts.circular,
+ _imp->opts.circular == dl_circular_discard_silently ?
+ dl_circular_discard_silently : dl_circular_discard);
Save<MergeList::iterator> save_merge_list_insert_position(&_imp->merge_list_insert_position,
_imp->merge_list.end());
add_in_role(d, s + " dependencies as post dependencies with cycle breaking");
diff --git a/paludis/dep_list/dep_list.sr b/paludis/dep_list/dep_list.sr
index b99af1c..0c7612e 100644
--- a/paludis/dep_list/dep_list.sr
+++ b/paludis/dep_list/dep_list.sr
@@ -21,6 +21,7 @@ make_class_DepListOptions()
key suggested DepListSuggestedOption
key circular DepListCircularOption
+ key use DepListUseOption
key blocks DepListBlocksOption
key override_masks DepListOverrideMasks
diff --git a/paludis/dep_list/options.cc b/paludis/dep_list/options.cc
index a791a60..5b235b1 100644
--- a/paludis/dep_list/options.cc
+++ b/paludis/dep_list/options.cc
@@ -241,6 +241,10 @@ paludis::operator<< (std::ostream & o, const DepListCircularOption & s)
o << "circular_discard";
continue;
+ case dl_circular_discard_silently:
+ o << "circular_discard_silently";
+ continue;
+
case last_dl_circular:
;
}
diff --git a/paludis/dep_list/options.hh b/paludis/dep_list/options.hh
index 53fba50..520ab5a 100644
--- a/paludis/dep_list/options.hh
+++ b/paludis/dep_list/options.hh
@@ -137,8 +137,9 @@ namespace paludis
*/
enum DepListCircularOption
{
- dl_circular_error, ///< As an error
- dl_circular_discard, ///< Discard them
+ dl_circular_error, ///< As an error
+ dl_circular_discard, ///< Discard them
+ dl_circular_discard_silently, ///< Discard them silently (not for user visible use)
last_dl_circular
};
@@ -156,6 +157,20 @@ namespace paludis
};
/**
+ * How we handle use deps.
+ *
+ * Not for end user use. Used by adjutrix and qa.
+ *
+ * \ingroup grpdepresolver
+ */
+ enum DepListUseOption
+ {
+ dl_use_deps_standard, ///< Behave as standard
+ dl_use_deps_take_all, ///< Take both sides of use conditionals except on masks
+ last_dl_use_deps
+ };
+
+ /**
* State of a DepListEntry.
*
* \ingroup grpdepresolver
diff --git a/src/clients/adjutrix/display_default_system_resolution.cc b/src/clients/adjutrix/display_default_system_resolution.cc
index 418b384..bde5bea 100644
--- a/src/clients/adjutrix/display_default_system_resolution.cc
+++ b/src/clients/adjutrix/display_default_system_resolution.cc
@@ -69,7 +69,7 @@ namespace
cout << std::left << std::setw(20) << (desc + ":") << display_profile << endl;
DepListOptions d_options;
- d_options.circular = dl_circular_discard;
+ d_options.circular = dl_circular_discard_silently;
DepList d(&env, d_options);
try
diff --git a/src/clients/adjutrix/what_needs_keywording.cc b/src/clients/adjutrix/what_needs_keywording.cc
index 9e6bea5..0598ba8 100644
--- a/src/clients/adjutrix/what_needs_keywording.cc
+++ b/src/clients/adjutrix/what_needs_keywording.cc
@@ -52,19 +52,24 @@ int do_what_needs_keywording(NoConfigEnvironment & env)
env.set_accept_unstable('~' == stringify(target_keyword).at(0));
DepListOptions d_options;
- d_options.circular = dl_circular_discard;
+ d_options.circular = dl_circular_discard_silently;
+ d_options.use = dl_use_deps_take_all;
+ d_options.blocks = dl_blocks_discard;
d_options.override_masks.set(dl_override_tilde_keywords);
d_options.override_masks.set(dl_override_unkeyworded);
+ d_options.override_masks.set(dl_override_repository_masks);
+ d_options.override_masks.set(dl_override_profile_masks);
DepList d(&env, d_options);
cout << std::setw(30) << std::left << "Package";
cout << std::setw(20) << std::left << "Version";
- cout << std::setw(20) << std::left << "Current Keywords";
+ cout << std::setw(18) << std::left << "Current Keywords";
+ cout << std::setw(10) << std::left << "Masks";
cout << endl;
cout << std::string(29, '=') << " " << std::string(19, '=') << " "
- << std::string(19, '=') << endl;
+ << std::string(17, '=') << " " << std::string(9, '=') << endl;
for (CommandLine::ParametersIterator p(next(CommandLine::get_instance()->begin_parameters())),
p_end(CommandLine::get_instance()->end_parameters()) ; p != p_end ; ++p)
@@ -76,6 +81,8 @@ int do_what_needs_keywording(NoConfigEnvironment & env)
cout << std::setw(30) << std::left << stringify(p->package.name);
cout << std::setw(20) << std::left << stringify(p->package.version);
+ std::string current;
+
VersionMetadata::ConstPointer m(env.package_database()->fetch_repository(
p->package.repository)->version_metadata(p->package.name,
p->package.version));
@@ -89,9 +96,21 @@ int do_what_needs_keywording(NoConfigEnvironment & env)
if (*k == "-*"
|| *k == stringify(target_keyword)
|| k->substr(1) == stringify(target_arch))
- cout << *k << " ";
+ current.append(stringify(*k) + " ");
}
+ cout << std::setw(18) << std::left << current;
+
+ std::string masks;
+
+ MaskReasons r(env.mask_reasons(p->package));
+ if (r.test(mr_repository_mask))
+ masks.append("R");
+ if (r.test(mr_profile_mask))
+ masks.append("P");
+
+ cout << std::setw(10) << std::left << masks;
+
cout << endl;
}