aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-22 23:23:34 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-22 23:23:34 +0000
commitc05f56916407d1730903472718fed9576bd214c9 (patch)
tree4ee1d0cc171813a37e889e15acedaeca3d3aa50e
parentd145928e6b0283eb9816d34332d4d062b21598b3 (diff)
downloadpaludis-c05f56916407d1730903472718fed9576bd214c9.tar.gz
paludis-c05f56916407d1730903472718fed9576bd214c9.tar.xz
Don't store keys, IDs in masks
-rw-r--r--doc/api/cplusplus/examples/example_mask.cc9
-rw-r--r--doc/api/ruby/example_mask.rb6
-rw-r--r--paludis/args/legacy/dep_list_args_group.cc6
-rw-r--r--paludis/legacy/override_functions.cc25
-rw-r--r--paludis/legacy/override_functions.hh4
-rw-r--r--paludis/mask.hh24
-rw-r--r--paludis/repositories/e/e_mask.cc28
-rw-r--r--paludis/repositories/e/e_mask.hh8
-rw-r--r--paludis/repositories/e/ebuild_id.cc14
-rw-r--r--paludis/repositories/fake/fake_package_id.cc18
-rw-r--r--paludis/repositories/fake/fake_package_id.hh4
-rw-r--r--paludis/repositories/virtuals/package_id.cc12
-rw-r--r--python/additional_tests.cc6
-rw-r--r--python/mask.cc37
-rwxr-xr-xpython/mask_TEST.py22
-rw-r--r--ruby/dep_list.cc2
-rw-r--r--ruby/dep_spec.cc8
-rw-r--r--ruby/dep_tag.cc2
-rw-r--r--ruby/mask.cc26
-rw-r--r--ruby/package_id_TEST.rb2
-rw-r--r--ruby/paludis_ruby.hh2
-rwxr-xr-xsrc/clients/cave/cmd_display_resolution.cc10
-rw-r--r--src/clients/cave/cmd_print_id_masks.cc40
-rw-r--r--src/clients/cave/cmd_show.cc19
-rw-r--r--src/output/mask_displayer.cc18
25 files changed, 188 insertions, 164 deletions
diff --git a/doc/api/cplusplus/examples/example_mask.cc b/doc/api/cplusplus/examples/example_mask.cc
index de3de72..fe98d6f 100644
--- a/doc/api/cplusplus/examples/example_mask.cc
+++ b/doc/api/cplusplus/examples/example_mask.cc
@@ -43,15 +43,13 @@ namespace
void visit(const UnacceptedMask & mask)
{
cout << left << setw(30) << " Class:" << " " << "UnacceptedMask" << endl;
- if (mask.unaccepted_key())
- cout << left << setw(30) << " Unaccepted key:" << " " << mask.unaccepted_key()->raw_name() << endl;
+ cout << left << setw(30) << " Unaccepted key:" << " " << mask.unaccepted_key_name() << endl;
}
void visit(const RepositoryMask & mask)
{
cout << left << setw(30) << " Class:" << " " << "RepositoryMask" << endl;
- if (mask.mask_key())
- cout << left << setw(30) << " Mask key:" << " " << mask.mask_key()->raw_name() << endl;
+ cout << left << setw(30) << " Mask key:" << " " << mask.mask_key_name() << endl;
}
void visit(const UnsupportedMask & mask)
@@ -63,8 +61,7 @@ namespace
void visit(const AssociationMask & mask)
{
cout << left << setw(30) << " Class:" << " " << "AssociationMask" << endl;
- if (mask.associated_package())
- cout << left << setw(30) << " Associated package:" << " " << *mask.associated_package() << endl;
+ cout << left << setw(30) << " Associated package:" << " " << mask.associated_package_spec() << endl;
}
};
}
diff --git a/doc/api/ruby/example_mask.rb b/doc/api/ruby/example_mask.rb
index e63aa92..d8724db 100644
--- a/doc/api/ruby/example_mask.rb
+++ b/doc/api/ruby/example_mask.rb
@@ -32,16 +32,16 @@ ids.each do | id |
puts " Class: ".ljust(31) + 'UserMask'
elsif mask.kind_of? UnacceptedMask
puts " Class: ".ljust(31) + 'UnacceptedMask'
- puts " Unaccepted key: ".ljust(31) + mask.unaccepted_key.raw_name unless mask.unaccepted_key.nil?
+ puts " Unaccepted key: ".ljust(31) + mask.unaccepted_key_name
elsif mask.kind_of? RepositoryMask
puts " Class: ".ljust(31) + 'RepositoryMask'
- puts " Mask key: ".ljust(31) + mask.mask_key.raw_name unless mask.mask_key.nil?
+ puts " Mask key: ".ljust(31) + mask.mask_key_name
elsif mask.kind_of? UnsupportedMask
puts " Class: ".ljust(31) + 'UnsupportedMask'
puts " Explanation: ".ljust(31) + mask.explanation
elsif mask.kind_of? AssociationMask
puts " Class: ".ljust(31) + 'AssociationMask'
- puts " Associated package: ".ljust(31) + mask.associated_package.to_s unless mask.associated_package.nil?
+ puts " Associated package: ".ljust(31) + mask.associated_package_spec.to_s
else
puts " Class: ".ljust(31) + 'Unknown'
end
diff --git a/paludis/args/legacy/dep_list_args_group.cc b/paludis/args/legacy/dep_list_args_group.cc
index 45920d1..29fd0af 100644
--- a/paludis/args/legacy/dep_list_args_group.cc
+++ b/paludis/args/legacy/dep_list_args_group.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
* Copyright (c) 2007 David Leverton
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -233,7 +233,7 @@ DepListArgsGroup::populate_dep_list_options(const Environment * env, DepListOpti
if (! options.override_masks())
options.override_masks() = std::make_shared<DepListOverrideMasksFunctions>();
options.override_masks()->push_back(std::bind(&override_tilde_keywords, env, _1, _2));
- options.override_masks()->push_back(std::bind(&override_license, _2));
+ options.override_masks()->push_back(std::bind(&override_license, _1, _2));
if (dl_override_masks.specified())
{
@@ -252,7 +252,7 @@ DepListArgsGroup::populate_dep_list_options(const Environment * env, DepListOpti
else if (*a == "repository")
options.override_masks()->push_back(std::bind(&override_repository_masks, _2));
else if (*a == "license")
- options.override_masks()->push_back(std::bind(&override_license, _2));
+ options.override_masks()->push_back(std::bind(&override_license, _1, _2));
else if (*a == "none")
{
}
diff --git a/paludis/legacy/override_functions.cc b/paludis/legacy/override_functions.cc
index 06461f9..ace84d8 100644
--- a/paludis/legacy/override_functions.cc
+++ b/paludis/legacy/override_functions.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2010 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -40,7 +40,11 @@ paludis::override_tilde_keywords(const Environment * const e, const std::shared_
if (! mm)
return false;
- const MetadataCollectionKey<KeywordNameSet> * const k(simple_visitor_cast<const MetadataCollectionKey<KeywordNameSet> >(*mm->unaccepted_key()));
+ auto ki(id->find_metadata(mm->unaccepted_key_name()));
+ if (ki == id->end_metadata())
+ return false;
+
+ auto k(simple_visitor_cast<const MetadataCollectionKey<KeywordNameSet> >(**ki));
if (! k)
return false;
@@ -65,7 +69,11 @@ paludis::override_unkeyworded(const Environment * const e, const std::shared_ptr
if (! mm)
return false;
- const MetadataCollectionKey<KeywordNameSet> * const k(simple_visitor_cast<const MetadataCollectionKey<KeywordNameSet> >(*mm->unaccepted_key()));
+ auto ki(id->find_metadata(mm->unaccepted_key_name()));
+ if (ki == id->end_metadata())
+ return false;
+
+ auto k(simple_visitor_cast<const MetadataCollectionKey<KeywordNameSet> >(**ki));
if (! k)
return false;
@@ -86,11 +94,18 @@ paludis::override_repository_masks(const Mask & m)
}
bool
-paludis::override_license(const Mask & m)
+paludis::override_license(const std::shared_ptr<const PackageID> & id, const Mask & m)
{
Context c("When working out whether mask is a license mask for override:");
const UnacceptedMask * const mm(simple_visitor_cast<const UnacceptedMask>(m));
- return mm && simple_visitor_cast<const MetadataSpecTreeKey<LicenseSpecTree> >(*mm->unaccepted_key());
+ if (! mm)
+ return false;
+
+ auto m_i(id->find_metadata(mm->unaccepted_key_name()));
+ if (m_i == id->end_metadata())
+ return false;
+
+ return simple_visitor_cast<const MetadataSpecTreeKey<LicenseSpecTree> >(**m_i);
}
diff --git a/paludis/legacy/override_functions.hh b/paludis/legacy/override_functions.hh
index 1f9764f..bd55a67 100644
--- a/paludis/legacy/override_functions.hh
+++ b/paludis/legacy/override_functions.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2010 Ciaran McCreesh
+ * Copyright (c) 2007, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -70,7 +70,7 @@ namespace paludis
* \ingroup g_dep_list
* \since 0.26
*/
- bool override_license(const Mask & m)
+ bool override_license(const std::shared_ptr<const PackageID> &, const Mask & m)
PALUDIS_ATTRIBUTE((warn_unused_result)) PALUDIS_VISIBLE;
}
diff --git a/paludis/mask.hh b/paludis/mask.hh
index 87bc8fa..2587060 100644
--- a/paludis/mask.hh
+++ b/paludis/mask.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -21,8 +21,8 @@
#define PALUDIS_GUARD_PALUDIS_MASK_HH 1
#include <paludis/mask-fwd.hh>
-#include <paludis/metadata_key-fwd.hh>
#include <paludis/package_id-fwd.hh>
+#include <paludis/dep_spec-fwd.hh>
#include <paludis/util/simple_visitor.hh>
#include <paludis/util/attributes.hh>
#include <paludis/util/fs_path.hh>
@@ -137,9 +137,11 @@ namespace paludis
{
public:
/**
- * Fetch the metadata key that is not accepted.
+ * Fetch the raw name of the metadata key that is not accepted.
+ *
+ * \since 0.59
*/
- virtual const std::shared_ptr<const MetadataKey> unaccepted_key() const = 0;
+ virtual const std::string unaccepted_key_name() const = 0;
};
/**
@@ -156,10 +158,12 @@ namespace paludis
{
public:
/**
- * Fetch a metadata key explaining the mask. May return a zero
- * pointer, if no more information is available.
+ * Fetch the raw name of a metadata key explaining the mask. May
+ * return a zero pointer, if no more information is available.
+ *
+ * \since 0.59
*/
- virtual const std::shared_ptr<const MetadataKey> mask_key() const = 0;
+ virtual const std::string mask_key_name() const = 0;
};
/**
@@ -199,9 +203,11 @@ namespace paludis
{
public:
/**
- * Fetch the associated package.
+ * Fetch a spec identifying the associated package.
+ *
+ * \since 0.59
*/
- virtual const std::shared_ptr<const PackageID> associated_package() const = 0;
+ virtual const PackageDepSpec associated_package_spec() const = 0;
};
/**
diff --git a/paludis/repositories/e/e_mask.cc b/paludis/repositories/e/e_mask.cc
index a2f9878..e2aba5b 100644
--- a/paludis/repositories/e/e_mask.cc
+++ b/paludis/repositories/e/e_mask.cc
@@ -30,18 +30,18 @@ namespace paludis
{
const char key;
const std::string description;
- const std::shared_ptr<const MetadataKey> unaccepted_key;
+ const std::string unaccepted_key_name;
- Imp(const char k, const std::string & d, const std::shared_ptr<const MetadataKey> & u) :
+ Imp(const char k, const std::string & d, const std::string & u) :
key(k),
description(d),
- unaccepted_key(u)
+ unaccepted_key_name(u)
{
}
};
}
-EUnacceptedMask::EUnacceptedMask(const char k, const std::string & d, const std::shared_ptr<const MetadataKey> & u) :
+EUnacceptedMask::EUnacceptedMask(const char k, const std::string & d, const std::string & u) :
_imp(k, d, u)
{
}
@@ -62,10 +62,10 @@ EUnacceptedMask::description() const
return _imp->description;
}
-const std::shared_ptr<const MetadataKey>
-EUnacceptedMask::unaccepted_key() const
+const std::string
+EUnacceptedMask::unaccepted_key_name() const
{
- return _imp->unaccepted_key;
+ return _imp->unaccepted_key_name;
}
namespace paludis
@@ -122,18 +122,18 @@ namespace paludis
{
const char key;
const std::string description;
- const std::shared_ptr<const MetadataKey> mask_key;
+ const std::string mask_key_name;
- Imp(const char k, const std::string & d, const std::shared_ptr<const MetadataKey> & m) :
+ Imp(const char k, const std::string & d, const std::string & m) :
key(k),
description(d),
- mask_key(m)
+ mask_key_name(m)
{
}
};
}
-ERepositoryMask::ERepositoryMask(const char k, const std::string & d, const std::shared_ptr<const MetadataKey> & m) :
+ERepositoryMask::ERepositoryMask(const char k, const std::string & d, const std::string & m) :
_imp(k, d, m)
{
}
@@ -154,9 +154,9 @@ ERepositoryMask::description() const
return _imp->description;
}
-const std::shared_ptr<const MetadataKey>
-ERepositoryMask::mask_key() const
+const std::string
+ERepositoryMask::mask_key_name() const
{
- return _imp->mask_key;
+ return _imp->mask_key_name;
}
diff --git a/paludis/repositories/e/e_mask.hh b/paludis/repositories/e/e_mask.hh
index 494755c..7ca68f8 100644
--- a/paludis/repositories/e/e_mask.hh
+++ b/paludis/repositories/e/e_mask.hh
@@ -34,12 +34,12 @@ namespace paludis
Pimp<EUnacceptedMask> _imp;
public:
- EUnacceptedMask(const char, const std::string &, const std::shared_ptr<const MetadataKey> &);
+ EUnacceptedMask(const char, const std::string &, const std::string &);
~EUnacceptedMask();
char key() const;
const std::string description() const;
- const std::shared_ptr<const MetadataKey> unaccepted_key() const;
+ const std::string unaccepted_key_name() const;
};
class EUnsupportedMask :
@@ -64,12 +64,12 @@ namespace paludis
Pimp<ERepositoryMask> _imp;
public:
- ERepositoryMask(const char, const std::string &, const std::shared_ptr<const MetadataKey> &);
+ ERepositoryMask(const char, const std::string &, const std::string &);
~ERepositoryMask();
virtual char key() const;
const std::string description() const;
- const std::shared_ptr<const MetadataKey> mask_key() const;
+ const std::string mask_key_name() const;
};
}
}
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index b01ceb5..04c2930 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -532,7 +532,7 @@ EbuildID::need_masks_added() const
{
add_mask(std::make_shared<EUnacceptedMask>('K',
DistributionData::get_instance()->distribution_from_string(
- _imp->environment->distribution())->concept_keyword(), keywords_key()));
+ _imp->environment->distribution())->concept_keyword(), keywords_key()->raw_name()));
}
else if (keywords_key()->value()->end() == std::find_if(keywords_key()->value()->begin(),
keywords_key()->value()->end(), &is_stable_keyword))
@@ -541,7 +541,7 @@ EbuildID::need_masks_added() const
make_named_values<OverriddenMask>(
n::mask() = std::make_shared<EUnacceptedMask>('~',
DistributionData::get_instance()->distribution_from_string(
- _imp->environment->distribution())->concept_keyword() + " (unstable accepted)", keywords_key()),
+ _imp->environment->distribution())->concept_keyword() + " (unstable accepted)", keywords_key()->raw_name()),
n::override_reason() = mro_accepted_unstable
)));
}
@@ -554,18 +554,18 @@ EbuildID::need_masks_added() const
if (! c.ok)
add_mask(std::make_shared<EUnacceptedMask>('L',
DistributionData::get_instance()->distribution_from_string(
- _imp->environment->distribution())->concept_license(), license_key()));
+ _imp->environment->distribution())->concept_license(), license_key()->raw_name()));
}
if (! _imp->environment->unmasked_by_user(shared_from_this()))
{
/* repo unless user */
if (_imp->repository_mask->value())
- add_mask(std::make_shared<ERepositoryMask>('R', "repository", _imp->repository_mask));
+ add_mask(std::make_shared<ERepositoryMask>('R', "repository", _imp->repository_mask->raw_name()));
/* profile unless user */
if (_imp->profile_mask->value())
- add_mask(std::make_shared<ERepositoryMask>('P', "profile", _imp->profile_mask));
+ add_mask(std::make_shared<ERepositoryMask>('P', "profile", _imp->profile_mask->raw_name()));
/* user */
std::shared_ptr<const Mask> user_mask(_imp->environment->mask_for_user(shared_from_this(), false));
@@ -578,7 +578,7 @@ EbuildID::need_masks_added() const
if (_imp->repository_mask->value())
add_overridden_mask(std::make_shared<OverriddenMask>(
make_named_values<OverriddenMask>(
- n::mask() = std::make_shared<ERepositoryMask>('r', "repository (overridden)", _imp->repository_mask),
+ n::mask() = std::make_shared<ERepositoryMask>('r', "repository (overridden)", _imp->repository_mask->raw_name()),
n::override_reason() = mro_overridden_by_user
)));
@@ -586,7 +586,7 @@ EbuildID::need_masks_added() const
if (_imp->profile_mask->value())
add_overridden_mask(std::make_shared<OverriddenMask>(
make_named_values<OverriddenMask>(
- n::mask() = std::make_shared<ERepositoryMask>('p', "profile (overridden)", _imp->profile_mask),
+ n::mask() = std::make_shared<ERepositoryMask>('p', "profile (overridden)", _imp->profile_mask->raw_name()),
n::override_reason() = mro_overridden_by_user
)));
diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc
index 48d0197..ea827b9 100644
--- a/paludis/repositories/fake/fake_package_id.cc
+++ b/paludis/repositories/fake/fake_package_id.cc
@@ -529,18 +529,18 @@ namespace paludis
{
const char key;
const std::string description;
- const std::shared_ptr<const MetadataKey> unaccepted_key;
+ const std::string unaccepted_key_name;
- Imp(const char k, const std::string & d, const std::shared_ptr<const MetadataKey> & u) :
+ Imp(const char k, const std::string & d, const std::string & u) :
key(k),
description(d),
- unaccepted_key(u)
+ unaccepted_key_name(u)
{
}
};
}
-FakeUnacceptedMask::FakeUnacceptedMask(const char c, const std::string & s, const std::shared_ptr<const MetadataKey> & k) :
+FakeUnacceptedMask::FakeUnacceptedMask(const char c, const std::string & s, const std::string & k) :
_imp(c, s, k)
{
}
@@ -561,10 +561,10 @@ FakeUnacceptedMask::description() const
return _imp->description;
}
-const std::shared_ptr<const MetadataKey>
-FakeUnacceptedMask::unaccepted_key() const
+const std::string
+FakeUnacceptedMask::unaccepted_key_name() const
{
- return _imp->unaccepted_key;
+ return _imp->unaccepted_key_name;
}
FakeUnsupportedMask::FakeUnsupportedMask()
@@ -1053,14 +1053,14 @@ FakePackageID::need_masks_added() const
if (keywords_key())
if (! _imp->env->accept_keywords(keywords_key()->value(), shared_from_this()))
- add_mask(std::make_shared<FakeUnacceptedMask>('K', "keywords", keywords_key()));
+ add_mask(std::make_shared<FakeUnacceptedMask>('K', "keywords", keywords_key()->raw_name()));
if (license_key())
{
LicenceChecker c(_imp->env, &Environment::accept_license, shared_from_this());
license_key()->value()->top()->accept(c);
if (! c.ok)
- add_mask(std::make_shared<FakeUnacceptedMask>('L', "license", license_key()));
+ add_mask(std::make_shared<FakeUnacceptedMask>('L', "license", license_key()->raw_name()));
}
if (! _imp->env->unmasked_by_user(shared_from_this()))
diff --git a/paludis/repositories/fake/fake_package_id.hh b/paludis/repositories/fake/fake_package_id.hh
index 80647d9..02ef7a0 100644
--- a/paludis/repositories/fake/fake_package_id.hh
+++ b/paludis/repositories/fake/fake_package_id.hh
@@ -182,12 +182,12 @@ namespace paludis
Pimp<FakeUnacceptedMask> _imp;
public:
- FakeUnacceptedMask(const char, const std::string &, const std::shared_ptr<const MetadataKey> &);
+ FakeUnacceptedMask(const char, const std::string &, const std::string &);
~FakeUnacceptedMask();
char key() const;
const std::string description() const;
- const std::shared_ptr<const MetadataKey> unaccepted_key() const;
+ const std::string unaccepted_key_name() const;
};
class PALUDIS_VISIBLE FakeUnsupportedMask :
diff --git a/paludis/repositories/virtuals/package_id.cc b/paludis/repositories/virtuals/package_id.cc
index c6b20de..d96ec3d 100644
--- a/paludis/repositories/virtuals/package_id.cc
+++ b/paludis/repositories/virtuals/package_id.cc
@@ -462,11 +462,11 @@ namespace
public AssociationMask
{
private:
- const std::shared_ptr<const PackageID> _id;
+ const PackageDepSpec _spec;
public:
- VirtualsAssociationMask(const std::shared_ptr<const PackageID> & i) :
- _id(i)
+ VirtualsAssociationMask(const PackageDepSpec & s) :
+ _spec(s)
{
}
@@ -480,9 +480,9 @@ namespace
return "by association";
}
- const std::shared_ptr<const PackageID> associated_package() const
+ const PackageDepSpec associated_package_spec() const
{
- return _id;
+ return _spec;
}
};
}
@@ -496,7 +496,7 @@ VirtualsPackageID::need_masks_added() const
return;
if (_imp->virtual_for->value()->masked())
- add_mask(std::make_shared<VirtualsAssociationMask>(_imp->virtual_for->value()));
+ add_mask(std::make_shared<VirtualsAssociationMask>(_imp->virtual_for->value()->uniquely_identifying_spec()));
_imp->has_masks = true;
}
diff --git a/python/additional_tests.cc b/python/additional_tests.cc
index 0f9567b..cf9c739 100644
--- a/python/additional_tests.cc
+++ b/python/additional_tests.cc
@@ -114,13 +114,13 @@ namespace mask
void test_unaccepted_mask(UnacceptedMask & m)
{
test_mask(m);
- m.unaccepted_key();
+ m.unaccepted_key_name();
}
void test_repository_mask(RepositoryMask & m)
{
test_mask(m);
- m.mask_key();
+ m.mask_key_name();
}
void test_unsupported_mask(UnsupportedMask & m)
@@ -132,7 +132,7 @@ namespace mask
void test_association_mask(AssociationMask & m)
{
test_mask(m);
- m.associated_package();
+ m.associated_package_spec();
}
}
diff --git a/python/mask.cc b/python/mask.cc
index af61d20..8884cd3 100644
--- a/python/mask.cc
+++ b/python/mask.cc
@@ -22,6 +22,7 @@
#include <paludis/mask.hh>
#include <paludis/util/make_named_values.hh>
+#include <paludis/dep_spec.hh>
using namespace paludis;
using namespace paludis::python;
@@ -148,14 +149,14 @@ struct UnacceptedMaskWrapper :
UnacceptedMask,
bp::wrapper<UnacceptedMask>
{
- virtual const std::shared_ptr<const MetadataKey> unaccepted_key() const
+ virtual const std::string unaccepted_key_name() const
{
Lock l(get_mutex());
- if (bp::override f = get_override("unaccepted_key"))
+ if (bp::override f = get_override("unaccepted_key_name"))
return f();
else
- throw PythonMethodNotImplemented("UnacceptedMask", "unaccepted_key");
+ throw PythonMethodNotImplemented("UnacceptedMask", "unaccepted_key_name");
}
virtual char key() const
@@ -183,14 +184,14 @@ struct RepositoryMaskWrapper :
RepositoryMask,
bp::wrapper<RepositoryMask>
{
- virtual const std::shared_ptr<const MetadataKey> mask_key() const
+ virtual const std::string mask_key_name() const
{
Lock l(get_mutex());
- if (bp::override f = get_override("mask_key"))
+ if (bp::override f = get_override("mask_key_name"))
return f();
else
- throw PythonMethodNotImplemented("RepositoryMask", "mask_key");
+ throw PythonMethodNotImplemented("RepositoryMask", "mask_key_name");
}
virtual char key() const
@@ -252,14 +253,14 @@ struct AssociationMaskWrapper :
AssociationMask,
bp::wrapper<AssociationMask>
{
- virtual const std::shared_ptr<const PackageID> associated_package() const
+ virtual const PackageDepSpec associated_package_spec() const
{
Lock l(get_mutex());
- if (bp::override f = get_override("associated_package"))
+ if (bp::override f = get_override("associated_package_spec"))
return f();
else
- throw PythonMethodNotImplemented("AssociationMask", "associated_package");
+ throw PythonMethodNotImplemented("AssociationMask", "associated_package_spec");
}
virtual char key() const
@@ -392,9 +393,9 @@ void expose_mask()
"Can be subclassed in Python.",
bp::init<>()
)
- .def("unaccepted_key", bp::pure_virtual(&UnacceptedMask::unaccepted_key),
- "unaccepted_key() -> MetadataKey\n"
- "Fetch the metadata key that is not accepted."
+ .def("unaccepted_key_name", bp::pure_virtual(&UnacceptedMask::unaccepted_key_name),
+ "unaccepted_key_name() -> string\n"
+ "Fetch the name of the metadata key that is not accepted."
)
.def("key", bp::pure_virtual(&Mask::key),
@@ -424,9 +425,9 @@ void expose_mask()
"Can be subclassed in Python.",
bp::init<>()
)
- .def("mask_key", bp::pure_virtual(&RepositoryMask::mask_key),
- "mask_key() -> MetadataKey\n"
- "Fetch a metadata key explaining the mask. May return None,\n"
+ .def("mask_key_name", bp::pure_virtual(&RepositoryMask::mask_key_name),
+ "mask_key_name() -> string\n"
+ "Fetch the name of a metadata key explaining the mask. May return None,\n"
"if no more information is available."
)
@@ -493,9 +494,9 @@ void expose_mask()
"Can be subclassed in Python.",
bp::init<>()
)
- .def("associated_package", bp::pure_virtual(&AssociationMask::associated_package),
- "associated_package() -> PackageID\n"
- "Fetch the associated package."
+ .def("associated_package_spec", bp::pure_virtual(&AssociationMask::associated_package_spec),
+ "associated_package_spec() -> PackageDepSpec\n"
+ "Fetch a spec for the associated package."
)
.def("key", bp::pure_virtual(&Mask::key),
diff --git a/python/mask_TEST.py b/python/mask_TEST.py
index 426823d..833b9c2 100755
--- a/python/mask_TEST.py
+++ b/python/mask_TEST.py
@@ -56,7 +56,7 @@ class TestCase_01_Masks(unittest.TestCase):
self.assertEquals(m.key(), "K")
self.assertEquals(m.description(), "keyword")
- self.assert_(isinstance(m.unaccepted_key(), MetadataKeywordNameIterableKey))
+ self.assertEquals(m.unaccepted_key_name(), "KEYWORDS")
def test_03_repository_mask(self):
q = Selection.RequireExactlyOne(Generator.Matches(
@@ -72,8 +72,7 @@ class TestCase_01_Masks(unittest.TestCase):
package_mask_path = os.path.realpath(os.path.join(os.getcwd(),
"mask_TEST_dir/testrepo/profiles/package.mask"))
- self.assertEquals(m.mask_key().value().mask_file, package_mask_path)
- self.assert_(isinstance(m.mask_key().value().comment, StringIterable))
+ self.assertEquals(m.mask_key_name(), "repository_mask")
def test_04_unsupported_mask(self):
q = Selection.RequireExactlyOne(Generator.Matches(
@@ -100,7 +99,7 @@ class TestCase_01_Masks(unittest.TestCase):
self.assertEquals(m.key(), "A")
self.assertEquals(m.description(), "by association")
- self.assertEquals(m.associated_package().name, "masked/repo")
+ self.assertEquals(m.associated_package_spec().package, "masked/repo")
elif os.environ.get("PALUDIS_ENABLE_VIRTUALS_REPOSITORY") != "no":
raise "oops"
@@ -123,8 +122,8 @@ class TestCase_02_Masks_subclassing(unittest.TestCase):
def description(self):
return "test"
- def unaccepted_key(self):
- return MetadataStringKey()
+ def unaccepted_key_name(self):
+ return "monkey"
test_unaccepted_mask(TestUnacceptedMask())
@@ -136,8 +135,8 @@ class TestCase_02_Masks_subclassing(unittest.TestCase):
def description(self):
return "test"
- def mask_key(self):
- return MetadataStringKey()
+ def mask_key_name(self):
+ return "monkey"
test_repository_mask(TestRepositoryMask())
@@ -162,12 +161,9 @@ class TestCase_02_Masks_subclassing(unittest.TestCase):
def description(self):
return "test"
- def associated_package(self):
+ def associated_package_spec(self):
e = EnvironmentFactory.instance.create("")
- q = Selection.RequireExactlyOne(Generator.Matches(
- parse_user_package_dep_spec("=masked/user-1.0", e, []), []))
- pid = iter(e[q]).next()
- return pid
+ return parse_user_package_dep_spec("=masked/user-1.0", e, [])
test_association_mask(TestAssociationMask())
diff --git a/ruby/dep_list.cc b/ruby/dep_list.cc
index 5b945b1..2c16c3d 100644
--- a/ruby/dep_list.cc
+++ b/ruby/dep_list.cc
@@ -1142,7 +1142,7 @@ namespace
{
rb_raise(rb_eArgError, "Expected one argument, not %d", argc);
}
- (*p)->push_back(std::bind(&override_license, _2));
+ (*p)->push_back(std::bind(&override_license, _1, _2));
}
else
{
diff --git a/ruby/dep_spec.cc b/ruby/dep_spec.cc
index e3ec551..358daad 100644
--- a/ruby/dep_spec.cc
+++ b/ruby/dep_spec.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011 Ciaran McCreesh
* Copyright (c) 2006, 2007, 2008 Richard Brown
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -508,7 +508,7 @@ namespace
{
std::shared_ptr<WrappedSpecBase> * p;
Data_Get_Struct(self, std::shared_ptr<WrappedSpecBase>, p);
- return package_dep_spec_to_value(std::make_shared<PackageDepSpec>(
+ return package_dep_spec_to_value(*std::make_shared<PackageDepSpec>(
std::static_pointer_cast<const WrappedSpec<BlockDepSpec> >(*p)->spec()->blocking()));
}
@@ -1348,10 +1348,10 @@ paludis::ruby::value_to_dep_tree(VALUE v)
}
VALUE
-paludis::ruby::package_dep_spec_to_value(const std::shared_ptr<const PackageDepSpec> & p)
+paludis::ruby::package_dep_spec_to_value(const PackageDepSpec & p)
{
std::shared_ptr<const WrappedSpecBase> * v_ptr(new std::shared_ptr<const WrappedSpecBase>(
- std::make_shared<WrappedSpec<PackageDepSpec>>(std::static_pointer_cast<PackageDepSpec>(p->clone()))));
+ std::make_shared<WrappedSpec<PackageDepSpec>>(std::static_pointer_cast<PackageDepSpec>(p.clone()))));
return Data_Wrap_Struct(c_package_dep_spec, 0, &Common<std::shared_ptr<const WrappedSpecBase> >::free, v_ptr);
}
diff --git a/ruby/dep_tag.cc b/ruby/dep_tag.cc
index 5d43097..908c0b8 100644
--- a/ruby/dep_tag.cc
+++ b/ruby/dep_tag.cc
@@ -123,7 +123,7 @@ namespace
{
std::shared_ptr<const DepTag> * ptr;
Data_Get_Struct(self, std::shared_ptr<const DepTag>, ptr);
- return package_dep_spec_to_value((std::static_pointer_cast<const DependencyDepTag>(*ptr))->dependency());
+ return package_dep_spec_to_value(*(std::static_pointer_cast<const DependencyDepTag>(*ptr))->dependency());
}
VALUE
diff --git a/ruby/mask.cc b/ruby/mask.cc
index 0f58ae4..0cac96e 100644
--- a/ruby/mask.cc
+++ b/ruby/mask.cc
@@ -130,19 +130,19 @@ namespace
* Document-method: unaccepted_key
*
* call-seq:
- * unaccepted_key -> MetadataKey or Nil
+ * unaccepted_key -> String
*
- * Fetch the metadata key that is not accepted.
+ * Fetch the name of the metadata key that is not accepted.
*/
/*
* Document-method: mask_key
*
* call-seq:
- * mask_key -> MetadataKey or Nil
+ * mask_key -> String
*
- * Fetch a metadata key explaining the mask.
+ * Fetch the name of a metadata key explaining the mask.
*/
- template <typename T_, const std::shared_ptr<const MetadataKey> (T_::* m_) () const>
+ template <typename T_, const std::string (T_::* m_) () const>
struct MaskMetadataKey
{
static VALUE
@@ -151,13 +151,13 @@ namespace
std::shared_ptr<const Mask> * ptr;
Data_Get_Struct(self, std::shared_ptr<const Mask>, ptr);
std::shared_ptr<const T_> cast_ptr(std::static_pointer_cast<const T_>(*ptr));
- return ((*cast_ptr).*m_)() ? metadata_key_to_value(((*cast_ptr).*m_)()) : Qnil;
+ return rb_str_new2(((*cast_ptr).*m_)().c_str());
}
};
/*
* call-seq:
- * associated_package -> PackageID or Nil
+ * associated_package_spec -> PackageDepSpec
*
* Fetch the associated package.
*/
@@ -167,7 +167,7 @@ namespace
std::shared_ptr<const Mask> * ptr;
Data_Get_Struct(self, std::shared_ptr<const Mask>, ptr);
std::shared_ptr<const AssociationMask> cast_ptr(std::static_pointer_cast<const AssociationMask>(*ptr));
- return (cast_ptr)->associated_package() ? package_id_to_value((cast_ptr)->associated_package()) : Qnil;
+ return package_dep_spec_to_value((cast_ptr)->associated_package_spec());
}
@@ -206,8 +206,8 @@ namespace
* (for example) a MetadataCollectionKey or MetadataSpecTreeKey is not accepted by user configuration.
*/
c_unaccepted_mask = rb_define_class_under(paludis_module(), "UnacceptedMask", c_mask);
- rb_define_method(c_unaccepted_mask, "unaccepted_key",
- RUBY_FUNC_CAST((&MaskMetadataKey<UnacceptedMask,&UnacceptedMask::unaccepted_key>::fetch)), 0);
+ rb_define_method(c_unaccepted_mask, "unaccepted_key_name",
+ RUBY_FUNC_CAST((&MaskMetadataKey<UnacceptedMask,&UnacceptedMask::unaccepted_key_name>::fetch)), 0);
/*
* Document-class: Paludis::RepositoryMask
@@ -215,8 +215,8 @@ namespace
* A RepositoryMask is a Mask that signifies that a PackageID has been marked as masked by a Repository.
*/
c_repository_mask = rb_define_class_under(paludis_module(), "RepositoryMask", c_mask);
- rb_define_method(c_repository_mask, "mask_key",
- RUBY_FUNC_CAST((&MaskMetadataKey<RepositoryMask,&RepositoryMask::mask_key>::fetch)), 0);
+ rb_define_method(c_repository_mask, "mask_key_name",
+ RUBY_FUNC_CAST((&MaskMetadataKey<RepositoryMask,&RepositoryMask::mask_key_name>::fetch)), 0);
/*
* Document-class: Paludis::UnsupportedMask
@@ -238,7 +238,7 @@ namespace
* masked by association.
*/
c_association_mask = rb_define_class_under(paludis_module(), "AssociationMask", c_mask);
- rb_define_method(c_association_mask, "associated_package", RUBY_FUNC_CAST(&association_mask_associated_package), 0);
+ rb_define_method(c_association_mask, "associated_package_spec", RUBY_FUNC_CAST(&association_mask_associated_package), 0);
}
}
diff --git a/ruby/package_id_TEST.rb b/ruby/package_id_TEST.rb
index 169adc2..a6df863 100644
--- a/ruby/package_id_TEST.rb
+++ b/ruby/package_id_TEST.rb
@@ -181,7 +181,7 @@ module Paludis
assert_equal 1, masks.length
mask = masks.first
assert_kind_of RepositoryMask, mask
- assert_equal "repository_mask", mask.mask_key.raw_name
+ assert_equal "repository_mask", mask.mask_key_name
end
def test_hash
diff --git a/ruby/paludis_ruby.hh b/ruby/paludis_ruby.hh
index 6888fd2..925bf2e 100644
--- a/ruby/paludis_ruby.hh
+++ b/ruby/paludis_ruby.hh
@@ -99,7 +99,7 @@ namespace paludis
#endif
template <typename T_> VALUE dep_tree_to_value(const std::shared_ptr<const T_> &);
template <typename T_> std::shared_ptr<const T_> value_to_dep_tree(VALUE);
- VALUE package_dep_spec_to_value(const std::shared_ptr<const PackageDepSpec> &);
+ VALUE package_dep_spec_to_value(const PackageDepSpec &);
VALUE uri_label_to_value(const std::shared_ptr<const URILabel> &);
VALUE dependencies_label_to_value(const std::shared_ptr<const DependenciesLabel> &);
VALUE mask_to_value(std::shared_ptr<const Mask>);
diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc
index dbb12ad..a9ef2af 100755
--- a/src/clients/cave/cmd_display_resolution.cc
+++ b/src/clients/cave/cmd_display_resolution.cc
@@ -1026,16 +1026,16 @@ namespace
{
cout << fuc(fs_masked_by(), fv<'i'>(indent), fv<'c'>(colour), fv<'d'>(m.description()));
MaskedByKeyVisitor v{env, id, indent + " "};
- if (m.mask_key())
- m.mask_key()->accept(v);
+ if (! m.mask_key_name().empty())
+ (*id->find_metadata(m.mask_key_name()))->accept(v);
}
void visit(const UnacceptedMask & m) const
{
cout << fuc(fs_masked_by(), fv<'i'>(indent), fv<'c'>(colour), fv<'d'>(m.description()));
MaskedByKeyVisitor v{env, id, indent + " "};
- if (m.unaccepted_key())
- m.unaccepted_key()->accept(v);
+ if (! m.unaccepted_key_name().empty())
+ (*id->find_metadata(m.unaccepted_key_name()))->accept(v);
}
void visit(const UnsupportedMask & m) const
@@ -1046,7 +1046,7 @@ namespace
void visit(const AssociationMask & m) const
{
cout << fuc(fs_masked_by_explanation(), fv<'i'>(indent), fv<'c'>(colour), fv<'d'>(m.description()),
- fv<'x'>("associated package '" + stringify(*m.associated_package()) + "'"));
+ fv<'x'>("associated package '" + stringify(m.associated_package_spec()) + "'"));
}
};
diff --git a/src/clients/cave/cmd_print_id_masks.cc b/src/clients/cave/cmd_print_id_masks.cc
index 1937eb6..9664c11 100644
--- a/src/clients/cave/cmd_print_id_masks.cc
+++ b/src/clients/cave/cmd_print_id_masks.cc
@@ -103,33 +103,34 @@ namespace
struct GetInfo
{
- const std::pair<std::shared_ptr<const MetadataKey>, std::string> visit(const UserMask &) const
+ const std::pair<std::string, std::string> visit(const UserMask &) const
{
- return std::make_pair(make_null_shared_ptr(), "");
+ return std::make_pair("", "");
}
- const std::pair<std::shared_ptr<const MetadataKey>, std::string> visit(const UnacceptedMask & m) const
+ const std::pair<std::string, std::string> visit(const UnacceptedMask & m) const
{
- return std::make_pair(m.unaccepted_key(), "");
+ return std::make_pair(m.unaccepted_key_name(), "");
}
- const std::pair<std::shared_ptr<const MetadataKey>, std::string> visit(const RepositoryMask & m) const
+ const std::pair<std::string, std::string> visit(const RepositoryMask & m) const
{
- return std::make_pair(m.mask_key(), "");
+ return std::make_pair(m.mask_key_name(), "");
}
- const std::pair<std::shared_ptr<const MetadataKey>, std::string> visit(const UnsupportedMask &) const
+ const std::pair<std::string, std::string> visit(const UnsupportedMask &) const
{
- return std::make_pair(make_null_shared_ptr(), "");
+ return std::make_pair("", "");
}
- const std::pair<std::shared_ptr<const MetadataKey>, std::string> visit(const AssociationMask & m) const
+ const std::pair<std::string, std::string> visit(const AssociationMask & m) const
{
- return std::make_pair(make_null_shared_ptr(), stringify(*m.associated_package()));
+ return std::make_pair("", stringify(m.associated_package_spec()));
}
};
void do_one_mask(
+ const std::shared_ptr<const PackageID> & id,
const std::shared_ptr<const Mask> & mask,
const MaskOverrideReason & override,
const PrintIDMasksCommandLine & cmdline
@@ -139,12 +140,15 @@ namespace
m->insert('k', std::string(1, mask->key()));
m->insert('d', mask->description());
- std::pair<std::shared_ptr<const MetadataKey>, std::string> info(
- mask->accept_returning<std::pair<std::shared_ptr<const MetadataKey>, std::string> >(GetInfo()));
- m->insert('r', info.first ? info.first->raw_name() : "");
- m->insert('=', info.first ? "=" : "");
- m->insert('h', info.first ? info.first->human_name() : "");
- m->insert('v', info.first ? format_plain_metadata_key_value(info.first) : info.second);
+ auto info(mask->accept_returning<std::pair<std::string, std::string> >(GetInfo()));
+ std::shared_ptr<const MetadataKey> info_key;
+ if (! info.first.empty())
+ info_key = *id->find_metadata(info.first);
+
+ m->insert('r', info_key ? info_key->raw_name() : "");
+ m->insert('=', info_key ? "=" : "");
+ m->insert('h', info_key ? info_key->human_name() : "");
+ m->insert('v', info_key ? format_plain_metadata_key_value(info_key) : info.second);
m->insert('(', last_mro == override ? "" : "(");
m->insert(')', last_mro == override ? "" : ")");
@@ -201,12 +205,12 @@ PrintIDMasksCommand::run(
if (! cmdline.a_no_active.specified())
for (PackageID::MasksConstIterator m((*i)->begin_masks()), m_end((*i)->end_masks()) ;
m != m_end ; ++m)
- do_one_mask(*m, last_mro, cmdline);
+ do_one_mask(*i, *m, last_mro, cmdline);
if (cmdline.a_overridden.specified())
for (PackageID::OverriddenMasksConstIterator m((*i)->begin_overridden_masks()), m_end((*i)->end_overridden_masks()) ;
m != m_end ; ++m)
- do_one_mask((*m)->mask(), (*m)->override_reason(), cmdline);
+ do_one_mask(*i, (*m)->mask(), (*m)->override_reason(), cmdline);
}
return EXIT_SUCCESS;
diff --git a/src/clients/cave/cmd_show.cc b/src/clients/cave/cmd_show.cc
index e3e323b..e4cdfa8 100644
--- a/src/clients/cave/cmd_show.cc
+++ b/src/clients/cave/cmd_show.cc
@@ -967,12 +967,15 @@ namespace
struct MaskDisplayer
{
const std::shared_ptr<const Environment> env;
+ const std::shared_ptr<const PackageID> id;
const ShowCommandLine & cmdline;
const int indent;
std::ostream & out;
- MaskDisplayer(const std::shared_ptr<const Environment> & e, const ShowCommandLine & c, const int i, std::ostream & o) :
+ MaskDisplayer(const std::shared_ptr<const Environment> & e,
+ const std::shared_ptr<const PackageID> & d, const ShowCommandLine & c, const int i, std::ostream & o) :
env(e),
+ id(d),
cmdline(c),
indent(i),
out(o)
@@ -981,10 +984,10 @@ namespace
void visit(const UnacceptedMask & m)
{
- if (m.unaccepted_key())
+ if (! m.unaccepted_key_name().empty())
{
InfoDisplayer i(env, cmdline, indent, false, make_null_shared_ptr(), make_null_shared_ptr(), false, out);
- m.unaccepted_key()->accept(i);
+ (*id->find_metadata(m.unaccepted_key_name()))->accept(i);
}
else
{
@@ -1016,7 +1019,7 @@ namespace
out << fuc(
(cmdline.a_raw_names.specified() ? fs_metadata_value_raw() : fs_metadata_value_human()),
fv<'s'>(cmdline.a_raw_names.specified() ? stringify(m.key()) : "by " + m.description()),
- fv<'v'>(stringify(*m.associated_package())),
+ fv<'v'>(stringify(m.associated_package_spec())),
fv<'i'>(std::string(indent, ' ')),
fv<'b'>(""),
fv<'p'>("")
@@ -1037,10 +1040,10 @@ namespace
void visit(const RepositoryMask & m)
{
- if (m.mask_key())
+ if (! m.mask_key_name().empty())
{
InfoDisplayer i(env, cmdline, indent, false, make_null_shared_ptr(), make_null_shared_ptr(), false, out);
- m.mask_key()->accept(i);
+ (*id->find_metadata(m.mask_key_name()))->accept(i);
}
else
{
@@ -1097,14 +1100,14 @@ namespace
if (best->masked())
{
out << fuc(fs_package_id_masks(), fv<'s'>("Masked"));
- MaskDisplayer d(env, cmdline, 2, out);
+ MaskDisplayer d(env, best, cmdline, 2, out);
std::for_each(indirect_iterator(best->begin_masks()), indirect_iterator(best->end_masks()), accept_visitor(d));
}
if (best->begin_overridden_masks() != best->end_overridden_masks())
{
out << fuc(fs_package_id_masks_overridden(), fv<'s'>("Overridden Masks"));
- MaskDisplayer d(env, cmdline, 2, out);
+ MaskDisplayer d(env, best, cmdline, 2, out);
for (PackageID::OverriddenMasksConstIterator m(best->begin_overridden_masks()), m_end(best->end_overridden_masks()) ;
m != m_end ; ++m)
(*m)->mask()->accept(d);
diff --git a/src/output/mask_displayer.cc b/src/output/mask_displayer.cc
index 3b0a683..765232d 100644
--- a/src/output/mask_displayer.cc
+++ b/src/output/mask_displayer.cc
@@ -29,6 +29,8 @@
#include <paludis/util/timestamp.hh>
#include <paludis/name.hh>
#include <paludis/metadata_key.hh>
+#include <paludis/package_id.hh>
+#include <paludis/dep_spec.hh>
#include <sstream>
using namespace paludis;
@@ -241,10 +243,10 @@ MaskDisplayer::visit(const UnacceptedMask & m)
if (_imp->want_description)
_imp->s << m.description() << " (";
- if (m.unaccepted_key())
+ if (! m.unaccepted_key_name().empty())
{
KeyPrettyPrinter k(_imp->env, _imp->id);
- m.unaccepted_key()->accept(k);
+ (*_imp->id->find_metadata(m.unaccepted_key_name()))->accept(k);
_imp->s << k.s.str();
}
@@ -265,19 +267,19 @@ MaskDisplayer::visit(const RepositoryMask & m)
{
_imp->s << m.description();
- if (m.mask_key())
+ if (! m.mask_key_name().empty())
{
KeyPrettyPrinter k(_imp->env, _imp->id);
- m.mask_key()->accept(k);
+ (*_imp->id->find_metadata(m.mask_key_name()))->accept(k);
_imp->s << " (" << k.s.str() << ")";
}
}
else
{
- if (m.mask_key())
+ if (! m.mask_key_name().empty())
{
KeyPrettyPrinter k(_imp->env, _imp->id);
- m.mask_key()->accept(k);
+ (*_imp->id->find_metadata(m.mask_key_name()))->accept(k);
_imp->s << k.s.str();
}
else
@@ -298,8 +300,8 @@ void
MaskDisplayer::visit(const AssociationMask & m)
{
if (_imp->want_description)
- _imp->s << m.description() << " (associated package '" << *m.associated_package() << "')";
+ _imp->s << m.description() << " (associated package '" << m.associated_package_spec() << "')";
else
- _imp->s << *m.associated_package();
+ _imp->s << m.associated_package_spec();
}