aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-06 09:36:32 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-06 10:56:04 +0100
commitace301ee02a48bf6a348ec02820c0f0730466aab (patch)
treee4f6fdbf6b1d993bdf6a61fda9d04006feba3bf5
parent42be90444057f963083ad2fc1b7223ec22973e8b (diff)
downloadpaludis-ace301ee02a48bf6a348ec02820c0f0730466aab.tar.gz
paludis-ace301ee02a48bf6a348ec02820c0f0730466aab.tar.xz
Some IDs are unbinaryable
-rw-r--r--paludis/package_id.hh1
-rw-r--r--paludis/repositories/accounts/accounts_id.cc1
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_id.cc1
-rw-r--r--src/clients/cave/resolve_common.cc39
4 files changed, 35 insertions, 7 deletions
diff --git a/paludis/package_id.hh b/paludis/package_id.hh
index c60aa99..505f41c 100644
--- a/paludis/package_id.hh
+++ b/paludis/package_id.hh
@@ -322,6 +322,7 @@ namespace paludis
* - "transient", saying that an installed ID's origin is expected not to exist
* - "used", saying that an installed ID should not be treated as unused
* - "unbinaryable", saying that we should be excluded from requests to create a binary
+ * - "unchrootable", saying that we should be excluded from requests to install to a chroot
*
* \since 0.48
*/
diff --git a/paludis/repositories/accounts/accounts_id.cc b/paludis/repositories/accounts/accounts_id.cc
index 1a13a4d..0a1466e 100644
--- a/paludis/repositories/accounts/accounts_id.cc
+++ b/paludis/repositories/accounts/accounts_id.cc
@@ -57,6 +57,7 @@ namespace
behaviours_key(std::make_shared<LiteralMetadataStringSetKey>("behaviours", "behaviours", mkt_internal, behaviours_value))
{
behaviours_value->insert("unbinaryable");
+ behaviours_value->insert("unchrootable");
}
};
}
diff --git a/paludis/repositories/unavailable/unavailable_repository_id.cc b/paludis/repositories/unavailable/unavailable_repository_id.cc
index 8b1944f..0dc64f6 100644
--- a/paludis/repositories/unavailable/unavailable_repository_id.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_id.cc
@@ -53,6 +53,7 @@ namespace
behaviours_key(std::make_shared<LiteralMetadataStringSetKey>("behaviours", "behaviours", mkt_internal, behaviours_value))
{
behaviours_value->insert("unbinaryable");
+ behaviours_value->insert("unchrootable");
}
};
}
diff --git a/src/clients/cave/resolve_common.cc b/src/clients/cave/resolve_common.cc
index 658c334..d551062 100644
--- a/src/clients/cave/resolve_common.cc
+++ b/src/clients/cave/resolve_common.cc
@@ -108,6 +108,13 @@ namespace
return id->behaviours_key()->value()->end() == id->behaviours_key()->value()->find("unbinaryable");
}
+ bool can_chroot(const std::shared_ptr<const PackageID> & id)
+ {
+ if (! id->behaviours_key())
+ return true;
+ return id->behaviours_key()->value()->end() == id->behaviours_key()->value()->find("unchrootable");
+ }
+
struct UnmaskableFilterHandler :
AllFilterHandlerBase
{
@@ -249,7 +256,7 @@ namespace
chroot_if_possible = true;
}
- if (chroot_if_possible)
+ if (chroot_if_possible && package_id_unless_error && can_chroot(package_id_unless_error))
extras += dt_install_to_chroot;
}
@@ -436,10 +443,28 @@ namespace
{
}
- bool creating_binary_and_no_binaryable_ids() const
+ bool creating_and_no_appropriate_ids() const
{
- if (resolvent.destination_type() != dt_create_binary)
- return false;
+ bool (* can)(const std::shared_ptr<const PackageID> &)(0);
+ switch (resolvent.destination_type())
+ {
+ case dt_install_to_slash:
+ return false;
+
+ case dt_create_binary:
+ can = &can_make_binary_for;
+ break;
+
+ case dt_install_to_chroot:
+ can = &can_chroot;
+ break;
+
+ case last_dt:
+ break;
+ }
+
+ if (! can)
+ throw InternalError(PALUDIS_HERE, "unhandled dt");
auto origin_ids((*env)[selection::AllVersionsSorted(
generator::Package(resolvent.package()) |
@@ -453,7 +478,7 @@ namespace
{
for (auto i(origin_ids->begin()), i_end(origin_ids->end()) ;
i != i_end ; ++i)
- if (can_make_binary_for(*i))
+ if ((*can)(*i))
return false;
return true;
@@ -463,13 +488,13 @@ namespace
std::pair<UseExisting, bool> visit(const DependencyReason &) const
{
return std::make_pair(use_existing_from_cmdline(resolution_options.a_keep, false),
- creating_binary_and_no_binaryable_ids());
+ creating_and_no_appropriate_ids());
}
std::pair<UseExisting, bool> visit(const TargetReason &) const
{
return std::make_pair(use_existing_from_cmdline(resolution_options.a_keep_targets, from_set),
- creating_binary_and_no_binaryable_ids());
+ creating_and_no_appropriate_ids());
}
std::pair<UseExisting, bool> visit(const DependentReason &) const