aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/e
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-27 15:49:38 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-01-27 16:33:59 +0000
commit36b75ed1f5b48cb9ed9bc81024ca74e9641856eb (patch)
treef3b66e6900ec59a5f98ca8ec7178306a4dd37627 /paludis/repositories/e
parent3cac76bba19afa2bd70307024d6f6f6485526d29 (diff)
downloadpaludis-36b75ed1f5b48cb9ed9bc81024ca74e9641856eb.tar.gz
paludis-36b75ed1f5b48cb9ed9bc81024ca74e9641856eb.tar.xz
Export legal values for choice parameters
Fixes: ticket:1100
Diffstat (limited to 'paludis/repositories/e')
-rw-r--r--paludis/repositories/e/e_choice_value.cc13
-rw-r--r--paludis/repositories/e/e_choice_value.hh7
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc2
-rw-r--r--paludis/repositories/e/ebuild_id.cc2
4 files changed, 17 insertions, 7 deletions
diff --git a/paludis/repositories/e/e_choice_value.cc b/paludis/repositories/e/e_choice_value.cc
index 86157c616..fec3508e0 100644
--- a/paludis/repositories/e/e_choice_value.cc
+++ b/paludis/repositories/e/e_choice_value.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 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
@@ -26,7 +26,7 @@ using namespace paludis::erepository;
EChoiceValue::EChoiceValue(const ChoicePrefixName & r, const UnprefixedChoiceName & v, const ChoiceNameWithPrefix & np, const QualifiedPackageName & p,
const std::shared_ptr<const UseDesc> & d,
bool b, bool def, bool l, bool x, const std::string & o,
- const std::string & pv) :
+ const std::string & pv, const std::shared_ptr<const PermittedChoiceValueParameterValues> & e) :
_prefix(r),
_unprefixed_name(v),
_name_with_prefix(np),
@@ -37,7 +37,8 @@ EChoiceValue::EChoiceValue(const ChoicePrefixName & r, const UnprefixedChoiceNam
_locked(l),
_explicitly_listed(x),
_override_description(o),
- _parameter(pv)
+ _parameter(pv),
+ _permitted(e)
{
}
@@ -93,3 +94,9 @@ EChoiceValue::parameter() const
return _parameter;
}
+const std::shared_ptr<const PermittedChoiceValueParameterValues>
+EChoiceValue::permitted_parameter_values() const
+{
+ return _permitted;
+}
+
diff --git a/paludis/repositories/e/e_choice_value.hh b/paludis/repositories/e/e_choice_value.hh
index a27c5a530..71fc2604e 100644
--- a/paludis/repositories/e/e_choice_value.hh
+++ b/paludis/repositories/e/e_choice_value.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh
+ * Copyright (c) 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
@@ -47,6 +47,7 @@ namespace paludis
const bool _explicitly_listed;
const std::string _override_description;
const std::string _parameter;
+ const std::shared_ptr<const PermittedChoiceValueParameterValues> _permitted;
public:
EChoiceValue(const ChoicePrefixName & r,
@@ -57,7 +58,8 @@ namespace paludis
bool b, bool def,
bool l, bool x,
const std::string & o,
- const std::string & pr);
+ const std::string & pr,
+ const std::shared_ptr<const PermittedChoiceValueParameterValues> & e);
const UnprefixedChoiceName unprefixed_name() const;
const ChoiceNameWithPrefix name_with_prefix() const;
@@ -67,6 +69,7 @@ namespace paludis
const std::string description() const;
bool explicitly_listed() const;
const std::string parameter() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ const std::shared_ptr<const PermittedChoiceValueParameterValues> permitted_parameter_values() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
}
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index e27057236..7a43ff606 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -1065,7 +1065,7 @@ EInstalledRepositoryID::make_choice_value(const std::shared_ptr<const Choice> &
enabled = (raw_use_key()->value()->end() != raw_use_key()->value()->find(name_with_prefix));
return std::make_shared<EChoiceValue>(c->prefix(), v, ChoiceNameWithPrefix(name_with_prefix), name(), std::shared_ptr<const UseDesc>(),
- enabled, enabled, true, explicitly_listed, override_description, "");
+ enabled, enabled, true, explicitly_listed, override_description, "", make_null_shared_ptr());
}
void
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 86933dd0c..0b3a03051 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -1484,7 +1484,7 @@ EbuildID::make_choice_value(
return std::make_shared<EChoiceValue>(choice->prefix(), value_name, ChoiceNameWithPrefix(name_with_prefix), name(),
e_repo->use_desc(),
- enabled, enabled_by_default, force_locked || locked, explicitly_listed, override_description, "");
+ enabled, enabled_by_default, force_locked || locked, explicitly_listed, override_description, "", make_null_shared_ptr());
}
namespace