diff options
author | 2010-08-01 14:34:38 +0100 | |
---|---|---|
committer | 2010-08-01 14:34:38 +0100 | |
commit | d97e4de383cf625e2fb96ce663b86fe4d8816629 (patch) | |
tree | ca775817edd00ee4a8126a81b420498943ce63d6 | |
parent | 38f49f09d7d83eb993d8a229751c01aafcde7544 (diff) | |
download | paludis-d97e4de383cf625e2fb96ce663b86fe4d8816629.tar.gz paludis-d97e4de383cf625e2fb96ce663b86fe4d8816629.tar.xz |
Nothing is fine too when making binaries for accounts etc
-rw-r--r-- | src/clients/cave/resolve_common.cc | 46 |
1 files changed, 38 insertions, 8 deletions
diff --git a/src/clients/cave/resolve_common.cc b/src/clients/cave/resolve_common.cc index 8697ed2..52aefe8 100644 --- a/src/clients/cave/resolve_common.cc +++ b/src/clients/cave/resolve_common.cc @@ -406,23 +406,53 @@ namespace struct UseExistingVisitor { + const Environment * const env; const ResolveCommandLineResolutionOptions & resolution_options; const bool from_set; + const Resolvent resolvent; - UseExistingVisitor(const ResolveCommandLineResolutionOptions & c, const bool f) : + UseExistingVisitor(const Environment * const e, const ResolveCommandLineResolutionOptions & c, const bool f, const Resolvent & r) : + env(e), resolution_options(c), - from_set(f) + from_set(f), + resolvent(r) { } + bool creating_binary_and_no_binaryable_ids() const + { + if (resolvent.destination_type() != dt_create_binary) + return false; + + auto origin_ids((*env)[selection::AllVersionsSorted( + generator::Package(resolvent.package()) | + make_slot_filter(resolvent) | + filter::SupportsAction<InstallAction>() | + filter::NotMasked() + )]); + if (origin_ids->empty()) + return false; + else + { + for (auto i(origin_ids->begin()), i_end(origin_ids->end()) ; + i != i_end ; ++i) + if (can_make_binary_for(*i)) + return false; + + return true; + } + } + std::pair<UseExisting, bool> visit(const DependencyReason &) const { - return std::make_pair(use_existing_from_cmdline(resolution_options.a_keep, false), false); + return std::make_pair(use_existing_from_cmdline(resolution_options.a_keep, false), + creating_binary_and_no_binaryable_ids()); } std::pair<UseExisting, bool> visit(const TargetReason &) const { - return std::make_pair(use_existing_from_cmdline(resolution_options.a_keep_targets, from_set), false); + return std::make_pair(use_existing_from_cmdline(resolution_options.a_keep_targets, from_set), + creating_binary_and_no_binaryable_ids()); } std::pair<UseExisting, bool> visit(const DependentReason &) const @@ -447,13 +477,13 @@ namespace std::pair<UseExisting, bool> visit(const SetReason & r) const { - UseExistingVisitor v(resolution_options, true); + UseExistingVisitor v(env, resolution_options, true, resolvent); return r.reason_for_set()->accept_returning<std::pair<UseExisting, bool> >(v); } std::pair<UseExisting, bool> visit(const LikeOtherDestinationTypeReason & r) const { - UseExistingVisitor v(resolution_options, true); + UseExistingVisitor v(env, resolution_options, true, resolvent); return r.reason_for_other()->accept_returning<std::pair<UseExisting, bool> >(v); } }; @@ -494,7 +524,7 @@ namespace const ResolveCommandLineResolutionOptions & resolution_options, const PackageDepSpecList & without, const PackageDepSpecList & with, - const std::shared_ptr<const Resolution> &, + const std::shared_ptr<const Resolution> & resolution, const PackageDepSpec & spec, const std::shared_ptr<const Reason> & reason) { @@ -506,7 +536,7 @@ namespace return std::make_pair(ue_never, false); } - UseExistingVisitor v(resolution_options, false); + UseExistingVisitor v(env, resolution_options, false, resolution->resolvent()); return reason->accept_returning<std::pair<UseExisting, bool> >(v); } |