aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-05-13 11:11:31 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-05-13 11:11:31 +0000
commit91c7d2dc773f996f6663eea22889eb8baaf16ddb (patch)
tree0dee12d1544d591a62bff13e4fc529993fb98a8f
parent921c36728a09e2b3609ca68356ffcfb2c65c1b06 (diff)
downloadpaludis-91c7d2dc773f996f6663eea22889eb8baaf16ddb.tar.gz
paludis-91c7d2dc773f996f6663eea22889eb8baaf16ddb.tar.xz
Support IUSE defaults
-rw-r--r--paludis/repositories/gentoo/portage_repository.cc4
-rw-r--r--paludis/repositories/gentoo/portage_repository_profile.cc24
-rw-r--r--paludis/repositories/gentoo/portage_repository_profile.hh2
3 files changed, 24 insertions, 6 deletions
diff --git a/paludis/repositories/gentoo/portage_repository.cc b/paludis/repositories/gentoo/portage_repository.cc
index 68bf5ab..f2c86b6 100644
--- a/paludis/repositories/gentoo/portage_repository.cc
+++ b/paludis/repositories/gentoo/portage_repository.cc
@@ -225,7 +225,7 @@ namespace paludis
return;
profile_ptr.reset(new PortageRepositoryProfile(
- params.environment, repo->name(), *params.profiles));
+ params.environment, repo, repo->name(), *params.profiles));
}
void
@@ -261,7 +261,7 @@ namespace paludis
.path(*profiles.begin())
.status(tokens.at(2))
.profile(std::tr1::shared_ptr<PortageRepositoryProfile>(new PortageRepositoryProfile(
- params.environment, repo->name(), profiles))));
+ params.environment, repo, repo->name(), profiles))));
}
}
diff --git a/paludis/repositories/gentoo/portage_repository_profile.cc b/paludis/repositories/gentoo/portage_repository_profile.cc
index 48da248..dbef86e 100644
--- a/paludis/repositories/gentoo/portage_repository_profile.cc
+++ b/paludis/repositories/gentoo/portage_repository_profile.cc
@@ -20,6 +20,7 @@
#include <paludis/repositories/gentoo/portage_repository_profile.hh>
#include <paludis/repositories/gentoo/portage_repository_profile_file.hh>
#include <paludis/repositories/gentoo/portage_repository_exceptions.hh>
+#include <paludis/repositories/gentoo/portage_repository.hh>
#include <paludis/util/log.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/iterator.hh>
@@ -30,6 +31,7 @@
#include <paludis/environment.hh>
#include <paludis/match_package.hh>
#include <paludis/hashed_containers.hh>
+#include <paludis/version_metadata.hh>
#include <list>
#include <algorithm>
@@ -107,6 +109,7 @@ namespace paludis
///\{
const Environment * const env;
+ const PortageRepository * const repository;
///\}
@@ -152,9 +155,10 @@ namespace paludis
///\name Basic operations
///\{
- Implementation(const Environment * const e, const RepositoryName & name,
- const FSEntryCollection & dirs) :
+ Implementation(const Environment * const e, const PortageRepository * const p,
+ const RepositoryName & name, const FSEntryCollection & dirs) :
env(e),
+ repository(p),
system_packages(new AllDepSpec),
system_tag(new GeneralSetDepTag(SetName("system"), stringify(name)))
{
@@ -569,9 +573,10 @@ Implementation<PortageRepositoryProfile>::handle_profile_arch_var()
}
PortageRepositoryProfile::PortageRepositoryProfile(
- const Environment * const env, const RepositoryName & name, const FSEntryCollection & location) :
+ const Environment * const env, const PortageRepository * const p, const RepositoryName & name,
+ const FSEntryCollection & location) :
PrivateImplementationPattern<PortageRepositoryProfile>(
- new Implementation<PortageRepositoryProfile>(env, name, location))
+ new Implementation<PortageRepositoryProfile>(env, p, name, location))
{
}
@@ -659,6 +664,17 @@ PortageRepositoryProfile::use_state_ignoring_masks(const UseFlagName & u,
}
}
+ if (use_unspecified == result && e)
+ {
+ std::tr1::shared_ptr<const VersionMetadata> m(_imp->repository->version_metadata(e->name, e->version));
+ if (m->ebuild_interface)
+ {
+ IUseFlagCollection::Iterator i(m->ebuild_interface->iuse()->find(IUseFlag(u, use_unspecified)));
+ if (i != m->ebuild_interface->iuse()->end())
+ result = i->state;
+ }
+ }
+
return result;
}
diff --git a/paludis/repositories/gentoo/portage_repository_profile.hh b/paludis/repositories/gentoo/portage_repository_profile.hh
index 9b17978..9bee182 100644
--- a/paludis/repositories/gentoo/portage_repository_profile.hh
+++ b/paludis/repositories/gentoo/portage_repository_profile.hh
@@ -38,6 +38,7 @@
namespace paludis
{
class Environment;
+ class PortageRepository;
/**
* Holds the profile data (but <em>not</em> the profiles/ top level data) for
@@ -55,6 +56,7 @@ namespace paludis
///\{
PortageRepositoryProfile(const Environment * const env,
+ const PortageRepository * const,
const RepositoryName & name,
const FSEntryCollection & location);
~PortageRepositoryProfile();