aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-27 16:51:30 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-27 16:51:30 +0100
commit443e934ecade4f54dcf178f18d5acae570de17e1 (patch)
treea347f4e02ba8366d022ce55252c38d8e5540d07b
parent01153084a9c4666da49d482d55bbdb56667b3b04 (diff)
downloadpaludis-443e934ecade4f54dcf178f18d5acae570de17e1.tar.gz
paludis-443e934ecade4f54dcf178f18d5acae570de17e1.tar.xz
--no-binaries-for
-rw-r--r--src/clients/cave/cmd_resolve.cc53
-rw-r--r--src/clients/cave/cmd_resolve_cmdline.cc3
-rw-r--r--src/clients/cave/cmd_resolve_cmdline.hh1
3 files changed, 46 insertions, 11 deletions
diff --git a/src/clients/cave/cmd_resolve.cc b/src/clients/cave/cmd_resolve.cc
index 187b4a2..5d397f4 100644
--- a/src/clients/cave/cmd_resolve.cc
+++ b/src/clients/cave/cmd_resolve.cc
@@ -212,10 +212,17 @@ namespace
struct DestinationTypesFinder
{
+ const Environment * const env;
const ResolveCommandLine & cmdline;
+ const std::tr1::shared_ptr<const PackageID> package_id;
- DestinationTypesFinder(const ResolveCommandLine & c) :
- cmdline(c)
+ DestinationTypesFinder(
+ const Environment * const e,
+ const ResolveCommandLine & c,
+ const std::tr1::shared_ptr<const PackageID> & i) :
+ env(e),
+ cmdline(c),
+ package_id(i)
{
}
@@ -224,7 +231,27 @@ namespace
DestinationTypes result;
if (cmdline.resolution_options.a_create_binaries.specified())
- result += dt_create_binary;
+ {
+ bool b(true);
+
+ if (cmdline.resolution_options.a_no_binaries_for.specified() && package_id)
+ {
+ for (args::StringSetArg::ConstIterator a(cmdline.resolution_options.a_no_binaries_for.begin_args()),
+ a_end(cmdline.resolution_options.a_no_binaries_for.end_args()) ;
+ a != a_end ; ++a)
+ if (match_package(*env,
+ parse_user_package_dep_spec(*a, env, UserPackageDepSpecOptions() + updso_allow_wildcards),
+ *package_id, MatchPackageOptions()))
+ {
+ b = false;
+ break;
+ }
+ }
+
+ if (b)
+ result += dt_create_binary;
+ }
+
if (cmdline.resolution_options.a_install_to_root.specified())
result += dt_install_to_slash;
@@ -237,14 +264,18 @@ namespace
DestinationTypes visit(const DependencyReason & reason) const
{
DestinationTypes result;
- if (is_buildish_dep(reason.sanitised_dependency()))
+
+ bool is_buildish(is_buildish_dep(reason.sanitised_dependency())),
+ is_runish(is_runish_dep(reason.sanitised_dependency()));
+
+ if ((! is_buildish) && (! is_runish))
+ throw InternalError(PALUDIS_HERE, "not buildish or runish. eek.");
+
+ if (is_buildish)
result += dt_install_to_slash;
- if (is_runish_dep(reason.sanitised_dependency()))
+ if (is_runish)
result |= visit(TargetReason());
- if (result.none())
- throw InternalError(PALUDIS_HERE, "picked no dts");
-
return result;
}
@@ -260,13 +291,13 @@ namespace
};
DestinationTypes get_destination_types_for_fn(
- const Environment * const,
+ const Environment * const env,
const ResolveCommandLine & cmdline,
const PackageDepSpec &,
- const std::tr1::shared_ptr<const PackageID> &,
+ const std::tr1::shared_ptr<const PackageID> & id,
const std::tr1::shared_ptr<const Reason> & reason)
{
- DestinationTypesFinder f(cmdline);
+ DestinationTypesFinder f(env, cmdline, id);
return reason->accept_returning<DestinationTypes>(f);
}
diff --git a/src/clients/cave/cmd_resolve_cmdline.cc b/src/clients/cave/cmd_resolve_cmdline.cc
index 1a68c0d..a6855fd 100644
--- a/src/clients/cave/cmd_resolve_cmdline.cc
+++ b/src/clients/cave/cmd_resolve_cmdline.cc
@@ -167,6 +167,9 @@ ResolveCommandLineResolutionOptions::ResolveCommandLineResolutionOptions(args::A
// a_fetch(&g_destination_options, "fetch", 'f', "Only fetch packages, do not install anything", true),
a_create_binaries(&g_destination_options, "create-binaries", 'b', "Create binary packages in the specified "
"repository. Specify multiple times if different binary destination types are required."),
+ a_no_binaries_for(&g_destination_options, "no-binaries-for", 'B', "Do not create binary packages from any "
+ "origin ID matching this spec. May be specified multiple times. (e.g. --no-binaries-for '*/*::accounts' "
+ "--no-binaries-for '*/*::virtuals')"),
// a_install_to_chroot(&g_destination_options, "install-to-chroot", '\0', "Install packages to the environment-configured chroot", true),
a_install_to_root(&g_destination_options, "install-to-root", '/', "Install packages to /", true),
diff --git a/src/clients/cave/cmd_resolve_cmdline.hh b/src/clients/cave/cmd_resolve_cmdline.hh
index 1f638d9..2a1e733 100644
--- a/src/clients/cave/cmd_resolve_cmdline.hh
+++ b/src/clients/cave/cmd_resolve_cmdline.hh
@@ -86,6 +86,7 @@ namespace paludis
args::ArgsGroup g_destination_options;
// args::SwitchArg a_fetch;
args::StringSetArg a_create_binaries;
+ args::StringSetArg a_no_binaries_for;
// args::SwitchArg a_install_to_chroot;
args::SwitchArg a_install_to_root;