aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-19 13:04:25 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-19 13:04:25 +0000
commitdf660379a0c4e6fffd66fab54cc3f3f9e1f54e96 (patch)
tree6742868f74cce286a7213b0c2f49a1ea3c02fd0c
parent2fbd0b1d5be90017142303cbdef842d807184812 (diff)
downloadpaludis-df660379a0c4e6fffd66fab54cc3f3f9e1f54e96.tar.gz
paludis-df660379a0c4e6fffd66fab54cc3f3f9e1f54e96.tar.xz
Use mask tokens
-rw-r--r--paludis/repositories/e/ebuild_id.cc59
1 files changed, 27 insertions, 32 deletions
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index cd276e2..03d4284 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -560,56 +560,51 @@ EbuildID::need_masks_added() const
_imp->environment->distribution())->concept_license(), license_key()->raw_name()));
}
- auto repo_masks(e_repo->repository_masks(shared_from_this()));
- auto profile_masks(e_repo->profile()->profile_masks(shared_from_this()));
- if (! _imp->environment->unmasked_by_user(shared_from_this(), ""))
{
- /* repo unless user */
- for (auto r(repo_masks->begin()), r_end(repo_masks->end()) ;
- r != r_end ; ++r)
- add_mask(std::make_shared<ERepositoryMask>('R', "repository", r->comment(), "", r->mask_file()));
+ auto repo_masks(e_repo->repository_masks(shared_from_this()));
- /* profile unless user */
- for (auto r(profile_masks->begin()), r_end(profile_masks->end()) ;
- r != r_end ; ++r)
- add_mask(std::make_shared<ERepositoryMask>('P', "profile", r->comment(), "", r->mask_file()));
-
- /* user */
- std::shared_ptr<const Mask> user_mask(_imp->environment->mask_for_user(shared_from_this(), false));
- if (user_mask)
- add_mask(user_mask);
- }
- else
- {
- /* repo overridden by user */
for (auto r(repo_masks->begin()), r_end(repo_masks->end()) ;
r != r_end ; ++r)
- add_overridden_mask(std::make_shared<OverriddenMask>(
- make_named_values<OverriddenMask>(
- n::mask() = std::make_shared<ERepositoryMask>('r', "repository (overridden)",
- r->comment(), "", r->mask_file()),
- n::override_reason() = mro_overridden_by_user
- )));
+ if (_imp->environment->unmasked_by_user(shared_from_this(), r->token()))
+ add_overridden_mask(std::make_shared<OverriddenMask>(
+ make_named_values<OverriddenMask>(
+ n::mask() = std::make_shared<ERepositoryMask>('r', "repository (overridden)",
+ r->comment(), r->token(), r->mask_file()),
+ n::override_reason() = mro_overridden_by_user
+ )));
+ else
+ add_mask(std::make_shared<ERepositoryMask>('R', "repository", r->comment(), r->token(), r->mask_file()));
+ }
- /* profile unless user */
+ {
+ auto profile_masks(e_repo->profile()->profile_masks(shared_from_this()));
for (auto r(profile_masks->begin()), r_end(profile_masks->end()) ;
r != r_end ; ++r)
- add_overridden_mask(std::make_shared<OverriddenMask>(
+ if (_imp->environment->unmasked_by_user(shared_from_this(), r->token()))
+ add_overridden_mask(std::make_shared<OverriddenMask>(
make_named_values<OverriddenMask>(
n::mask() = std::make_shared<ERepositoryMask>('p', "profile (overridden)",
- r->comment(), "", r->mask_file()),
+ r->comment(), r->token(), r->mask_file()),
n::override_reason() = mro_overridden_by_user
)));
+ else
+ add_mask(std::make_shared<ERepositoryMask>('P', "profile", r->comment(), r->token(), r->mask_file()));
+ }
+ {
/* user */
- std::shared_ptr<const Mask> user_mask(_imp->environment->mask_for_user(shared_from_this(), true));
+ std::shared_ptr<const Mask> user_mask(_imp->environment->mask_for_user(shared_from_this(), false));
if (user_mask)
- add_overridden_mask(std::make_shared<OverriddenMask>(
+ {
+ if (_imp->environment->unmasked_by_user(shared_from_this(), "user"))
+ add_overridden_mask(std::make_shared<OverriddenMask>(
make_named_values<OverriddenMask>(
n::mask() = user_mask,
n::override_reason() = mro_overridden_by_user
)));
-
+ else
+ add_mask(user_mask);
+ }
}
/* break portage */